File tree Expand file tree Collapse file tree 3 files changed +17
-4
lines changed
Expand file tree Collapse file tree 3 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -90,7 +90,10 @@ describe('DsfrFooter', () => {
9090 } ,
9191 props : {
9292 a11yCompliance : 'totalement conforme' ,
93- afterMandatoryLinks : [ { label : 'After' , to : testIdAfterLink } ] ,
93+ afterMandatoryLinks : [
94+ { label : 'After' , to : testIdAfterLink } ,
95+ { label : 'After ext' , to : 'https://example.com' } ,
96+ ] ,
9497 beforeMandatoryLinks : [ { label : 'Before' , to : testIdBeforeLink } ] ,
9598 partners,
9699 } ,
@@ -100,10 +103,13 @@ describe('DsfrFooter', () => {
100103
101104 const ecosystemLinksLis = container . querySelectorAll ( '.fr-footer__content-list .fr-footer__content-link' )
102105 const partnerLinks = container . querySelectorAll ( '.fr-footer__partners-link' )
106+ const bottomLinks = container . querySelectorAll ( '.fr-footer__bottom-link' )
107+ const extLinks = [ ...bottomLinks ] . filter ( ( link ) => link . getAttribute ( 'href' ) ?. startsWith ( 'https' ) )
103108
104109 // Then
105110 expect ( ecosystemLinksLis ) . toHaveLength ( 4 )
106111 expect ( partnerLinks ) . toHaveLength ( 3 )
112+ expect ( extLinks ) . toHaveLength ( 1 )
107113 expect ( getByTestId ( testIdMentionsLegales ) ) . toHaveClass ( 'fr-footer__bottom-link' )
108114 expect ( getByTestId ( testIdBeforeLink ) ) . toHaveClass ( 'fr-footer__bottom-link' )
109115 expect ( getByTestId ( testIdAfterLink ) ) . toHaveClass ( 'fr-footer__bottom-link' )
Original file line number Diff line number Diff line change @@ -33,9 +33,9 @@ export type DsfrFooterProps = {
3333 cookiesLink ?: string
3434 logoText ?: string | string [ ]
3535 descText ?: string
36- beforeMandatoryLinks ?: { label : string , to : RouteLocationRaw | undefined } [ ]
37- afterMandatoryLinks ?: { label : string , to : RouteLocationRaw | undefined } [ ]
38- mandatoryLinks ?: { label : string , to : RouteLocationRaw | undefined } [ ]
36+ beforeMandatoryLinks ?: { label : string , to : string | RouteLocationRaw | undefined } [ ]
37+ afterMandatoryLinks ?: { label : string , to : string | RouteLocationRaw | undefined } [ ]
38+ mandatoryLinks ?: { label : string , to : string | RouteLocationRaw | undefined } [ ]
3939 ecosystemLinks ?: { label : string , href : string } [ ]
4040 operatorLinkText ?: string
4141 operatorTo ?: RouteLocationRaw | undefined
Original file line number Diff line number Diff line change @@ -187,7 +187,14 @@ const aLicenceHref = computed(() => {
187187 :key =" index"
188188 class =" fr-footer__bottom-item"
189189 >
190+ <a
191+ v-if =" typeof link.to === 'string' && link.to.startsWith('http')"
192+ class =" fr-footer__bottom-link"
193+ :href =" link.to"
194+ :data-testid =" link.to"
195+ >{{ link.label }}</a >
190196 <RouterLink
197+ v-else
191198 class =" fr-footer__bottom-link"
192199 :to =" link.to ?? '#'"
193200 :data-testid =" link.to"
You can’t perform that action at this time.
0 commit comments