@@ -6,36 +6,31 @@ test.beforeEach(async ({ page }) => {
66} )
77
88test ( 'should render route-link correctly' , async ( { page } ) => {
9- for ( const el of await page
10- . locator ( '.e2e-theme-content #route-link a' )
11- . all ( ) ) {
9+ const locator = page . locator ( '.e2e-theme-content #route-link a' )
10+ for ( const el of await locator . all ( ) ) {
1211 await expect ( el ) . toHaveAttribute ( 'class' , / r o u t e - l i n k / )
1312 }
1413} )
1514
1615test ( 'should render external-link correctly' , async ( { page } ) => {
17- for ( const el of await page
18- . locator ( '.e2e-theme-content #external-link a' )
19- . all ( ) ) {
16+ const locator = page . locator ( '.e2e-theme-content #external-link a' )
17+ for ( const el of await locator . all ( ) ) {
2018 await expect ( el ) . toHaveAttribute ( 'class' , / e x t e r n a l - l i n k / )
2119 }
2220} )
2321
2422test ( 'should render config correctly' , async ( { page } ) => {
2523 const locator = page . locator ( '.e2e-theme-content #config a' )
2624
27- await expect ( await locator . nth ( 0 ) ) . toHaveText ( 'text1' )
28- await expect ( await locator . nth ( 0 ) ) . toHaveAttribute ( 'href' , BASE )
29- await expect ( await locator . nth ( 0 ) ) . toHaveAttribute ( 'aria-label' , 'label' )
25+ await expect ( locator . nth ( 0 ) ) . toHaveText ( 'text1' )
26+ await expect ( locator . nth ( 0 ) ) . toHaveAttribute ( 'href' , BASE )
27+ await expect ( locator . nth ( 0 ) ) . toHaveAttribute ( 'aria-label' , 'label' )
3028
31- await expect ( await locator . nth ( 1 ) ) . toHaveText ( 'text2' )
32- await expect ( await locator . nth ( 1 ) ) . toHaveAttribute (
29+ await expect ( locator . nth ( 1 ) ) . toHaveText ( 'text2' )
30+ await expect ( locator . nth ( 1 ) ) . toHaveAttribute (
3331 'href' ,
3432 'https://example.com/test/' ,
3533 )
36- await expect ( await locator . nth ( 1 ) ) . toHaveAttribute ( 'target' , '_blank' )
37- await expect ( await locator . nth ( 1 ) ) . toHaveAttribute (
38- 'rel' ,
39- 'noopener noreferrer' ,
40- )
34+ await expect ( locator . nth ( 1 ) ) . toHaveAttribute ( 'target' , '_blank' )
35+ await expect ( locator . nth ( 1 ) ) . toHaveAttribute ( 'rel' , 'noopener noreferrer' )
4136} )
0 commit comments