File tree Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Original file line number Diff line number Diff 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'
Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ defineSlots<{
9494}>()
9595
9696const mandatoryLinks = computed (() => {
97- return [
97+ return props . mandatoryLinks ?? [
9898 {
9999 label: ` Accessibilité : ${props .a11yCompliance } ` ,
100100 to: props .a11yComplianceLink ,
You canât perform that action at this time.
0 commit comments