@@ -130,9 +130,9 @@ describe('Footer', () => {
130130 test ( 'renders all footer sections with correct titles' , ( ) => {
131131 renderFooter ( )
132132
133- mockFooterSections . forEach ( ( section ) => {
133+ for ( const section of mockFooterSections ) {
134134 expect ( screen . getByText ( section . title ) ) . toBeInTheDocument ( )
135- } )
135+ }
136136 } )
137137
138138 test ( 'renders all section links correctly' , ( ) => {
@@ -150,22 +150,22 @@ describe('Footer', () => {
150150 }
151151 }
152152 }
153- regularLinks . forEach ( ( link ) => {
153+ for ( const link of regularLinks ) {
154154 const linkElement = screen . getByRole ( 'link' , { name : link . text } )
155155 expect ( linkElement ) . toBeInTheDocument ( )
156156 expect ( linkElement ) . toHaveAttribute ( 'href' , link . href )
157157 expect ( linkElement ) . toHaveAttribute ( 'target' , '_blank' )
158- } )
158+ }
159159
160- spanElements . forEach ( ( link ) => {
160+ for ( const link of spanElements ) {
161161 expect ( screen . getByText ( link . text ) ) . toBeInTheDocument ( )
162- } )
162+ }
163163 } )
164164
165165 test ( 'renders social media icons with correct attributes' , ( ) => {
166166 renderFooter ( )
167167
168- mockFooterIcons . forEach ( ( icon ) => {
168+ for ( const icon of mockFooterIcons ) {
169169 const link = screen . getByLabelText ( `OWASP Nest ${ icon . label } ` )
170170 expect ( link ) . toBeInTheDocument ( )
171171 expect ( link ) . toHaveAttribute ( 'href' , icon . href )
@@ -174,7 +174,7 @@ describe('Footer', () => {
174174
175175 const iconElement = link . querySelector ( '[data-testid="font-awesome-icon"]' )
176176 expect ( iconElement ) . toBeInTheDocument ( )
177- } )
177+ }
178178 } )
179179
180180 test ( 'renders copyright information with current year' , ( ) => {
@@ -271,40 +271,40 @@ describe('Footer', () => {
271271 renderFooter ( )
272272
273273 const buttons = screen . getAllByRole ( 'button' )
274- buttons . forEach ( ( button , index ) => {
274+
275+ for ( const [ index , button ] of buttons . entries ( ) ) {
275276 const sectionTitle = mockFooterSections [ index ] . title
276277 expect ( button ) . toHaveAttribute ( 'aria-controls' , `footer-section-${ sectionTitle } ` )
277278 expect ( button ) . toHaveAttribute ( 'aria-expanded' )
278- } )
279+ }
279280 } )
280281
281282 test ( 'has correct section IDs matching aria-controls' , ( ) => {
282283 renderFooter ( )
283284
284- mockFooterSections . forEach ( ( section ) => {
285+ for ( const section of mockFooterSections ) {
285286 const sectionElement = document . getElementById ( `footer-section-${ section . title } ` )
286287 expect ( sectionElement ) . toBeInTheDocument ( )
287- } )
288+ }
288289 } )
289290
290291 test ( 'has proper semantic structure' , ( ) => {
291292 renderFooter ( )
292293
293294 expect ( screen . getByRole ( 'contentinfo' ) ) . toBeInTheDocument ( )
294295
295- mockFooterSections . forEach ( ( section ) => {
296+ for ( const section of mockFooterSections ) {
296297 const heading = screen . getByRole ( 'heading' , { name : section . title , level : 3 } )
297298 expect ( heading ) . toBeInTheDocument ( )
298- } )
299+ }
299300 } )
300301
301302 test ( 'has proper aria-labels for social media links' , ( ) => {
302303 renderFooter ( )
303-
304- mockFooterIcons . forEach ( ( icon ) => {
304+ for ( const icon of mockFooterIcons ) {
305305 const link = screen . getByLabelText ( `OWASP Nest ${ icon . label } ` )
306306 expect ( link ) . toBeInTheDocument ( )
307- } )
307+ }
308308 } )
309309 } )
310310
@@ -335,10 +335,10 @@ describe('Footer', () => {
335335 renderFooter ( )
336336
337337 const buttons = screen . getAllByRole ( 'button' )
338- buttons . forEach ( ( button ) => {
338+ for ( const button of buttons ) {
339339 expect ( button ) . toHaveClass ( 'flex' , 'w-full' , 'items-center' , 'justify-between' )
340340 expect ( button ) . toHaveAttribute ( 'data-disable-animation' , 'true' )
341- } )
341+ }
342342 } )
343343
344344 test ( 'applies correct section content classes for collapsed/expanded states' , ( ) => {
@@ -381,9 +381,9 @@ describe('Footer', () => {
381381
382382 const buttons = screen . getAllByRole ( 'button' )
383383 expect ( buttons . length ) . toBeGreaterThan ( 0 )
384- buttons . forEach ( ( button ) => {
384+ for ( const button of buttons ) {
385385 expect ( button ) . toHaveAttribute ( 'data-disable-animation' , 'true' )
386- } )
386+ }
387387 } )
388388 } )
389389} )
0 commit comments