Skip to content

Commit 4c37428

Browse files
authored
Merge pull request #1193 from dnum-mi/develop
Develop
2 parents 876cf6a + 52e4c0c commit 4c37428

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

src/components/DsfrFooter/DsfrFooter.spec.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,35 @@ describe('DsfrFooter', () => {
142142
expect(getByTestId(testIdMentionsLegales)).toHaveClass('fr-footer__bottom-link')
143143
})
144144

145+
it('should render provided mandatoryLinks when passed as prop', async () => {
146+
// Given
147+
const mandatoryLinks = [
148+
{ label: 'Cookies', to: '/cookies' },
149+
{ label: 'Accessibilité', to: '/a11y' },
150+
]
151+
152+
// When
153+
const { container } = render(DsfrFooter, {
154+
global: {
155+
plugins: [router],
156+
components: {
157+
VIcon,
158+
},
159+
},
160+
props: {
161+
mandatoryLinks,
162+
},
163+
})
164+
165+
await router.isReady()
166+
167+
const linkEls = container.querySelectorAll('.fr-footer__bottom-item')
168+
169+
// Then
170+
expect(linkEls).toHaveLength(mandatoryLinks.length)
171+
expect(linkEls[0]).toHaveTextContent(mandatoryLinks[0].label)
172+
})
173+
145174
it('should not display div.fr-footer__bottom-copy if licenceText is empty string', async () => {
146175
// Given
147176
const testIdMentionsLegales = '/mentions-legales'

src/components/DsfrFooter/DsfrFooter.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ defineSlots<{
9494
}>()
9595
9696
const mandatoryLinks = computed(() => {
97-
return [
97+
return props.mandatoryLinks ?? [
9898
{
9999
label: `Accessibilité : ${props.a11yCompliance}`,
100100
to: props.a11yComplianceLink,

0 commit comments

Comments
 (0)