File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -180,12 +180,17 @@ test.describe('About Page', () => {
180180 } ) => {
181181 await page . goto ( '/about' ) ;
182182
183- const srOnlyText = page . locator ( '.education-card .sr-only' ) ;
184- const count = await srOnlyText . count ( ) ;
183+ // ExternalLink component uses aria-label instead of sr-only spans
184+ const externalLinks = page . locator (
185+ '.education-card a[aria-label*="opens in new tab"]' ,
186+ ) ;
187+ const count = await externalLinks . count ( ) ;
185188 expect ( count ) . toBeGreaterThanOrEqual ( 3 ) ;
186189
187- const firstSrText = await srOnlyText . first ( ) . textContent ( ) ;
188- expect ( firstSrText ) . toContain ( 'opens in new tab' ) ;
190+ const firstAriaLabel = await externalLinks
191+ . first ( )
192+ . getAttribute ( 'aria-label' ) ;
193+ expect ( firstAriaLabel ) . toContain ( 'opens in new tab' ) ;
189194 } ) ;
190195 } ) ;
191196
You can’t perform that action at this time.
0 commit comments