Skip to content

Commit

Permalink
test(nuxt-ripple): fixed footer tests and social links
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffdowdle committed Sep 5, 2023
1 parent a656d68 commit e047c19
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 9 deletions.
4 changes: 4 additions & 0 deletions examples/nuxt-app/test/features/site/shared-elements.feature
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ Feature: Shared site elements
Then the footer nav section with title "Level 1 - Item 2" should have the following links
| text | url |
| Level 1 - Item 2 | /level-1-item-2 |
Then the footer nav section with title "Connect with us" should have the following links
| text | url |
| Facebook | https://www.facebook.com/ |
| LinkedIn | https://www.linkedin.com/ |
Then the footer should have the following links
| text | url |
| Footer link 1 | /footer-link-1 |
Expand Down
16 changes: 16 additions & 0 deletions examples/nuxt-app/test/fixtures/site/shared-elements.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,22 @@
}
}
},
"socialLinks": [
{
"id": "social_link-0",
"text": "Facebook",
"url": "https://www.facebook.com/",
"icon": "icon-facebook",
"iconColour": "currentColor"
},
{
"id": "social_link-1",
"text": "LinkedIn",
"url": "https://www.linkedin.com/",
"icon": "icon-linkedin",
"iconColour": "currentColor"
}
],
"menus": {
"menuMain": [
{
Expand Down
23 changes: 14 additions & 9 deletions packages/nuxt-ripple/components/TideBaseLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -147,15 +147,20 @@ const showBreadcrumbs = computed(() => route.path !== '/')
const showDraftAlert = computed(() => props.page?.status === 'draft')
const footerNav = computed(() => {
const footerNav = props.site?.menus.menuFooter || []
return [
...footerNav,
{
text: 'Connect with us',
id: '__footer_connect_with_us',
items: props.site?.socialLinks
}
]
const menuMain = props.site?.menus.menuMain || []
if (props.site?.socialLinks?.length) {
return [
...menuMain,
{
text: 'Connect with us',
id: '__footer_connect_with_us',
items: props.site?.socialLinks
}
]
}
return menuMain
})
const nuxtApp = useNuxtApp()
Expand Down
1 change: 1 addition & 0 deletions packages/ripple-tide-api/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export interface TideSiteData {
twitter: any
og: any
}
socialLinks: TideMenuItem[]
menus: {
menuMain: TideMenuItem[]
menuFooter: TideMenuItem[]
Expand Down

0 comments on commit e047c19

Please sign in to comment.