@@ -6,36 +6,33 @@ test.beforeEach(async ({ page }) => {
6
6
} )
7
7
8
8
test ( '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
+
11
+ for ( const el of await locator . all ( ) ) {
12
12
await expect ( el ) . toHaveAttribute ( 'class' , / r o u t e - l i n k / )
13
13
}
14
14
} )
15
15
16
16
test ( 'should render external-link correctly' , async ( { page } ) => {
17
- for ( const el of await page
18
- . locator ( '.e2e-theme-content #external-link a' )
19
- . all ( ) ) {
17
+ const locator = page . locator ( '.e2e-theme-content #external-link a' )
18
+
19
+ for ( const el of await locator . all ( ) ) {
20
20
await expect ( el ) . toHaveAttribute ( 'class' , / e x t e r n a l - l i n k / )
21
21
}
22
22
} )
23
23
24
24
test ( 'should render config correctly' , async ( { page } ) => {
25
25
const locator = page . locator ( '.e2e-theme-content #config a' )
26
26
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' )
27
+ await expect ( locator . nth ( 0 ) ) . toHaveText ( 'text1' )
28
+ await expect ( locator . nth ( 0 ) ) . toHaveAttribute ( 'href' , BASE )
29
+ await expect ( locator . nth ( 0 ) ) . toHaveAttribute ( 'aria-label' , 'label' )
30
30
31
- await expect ( await locator . nth ( 1 ) ) . toHaveText ( 'text2' )
32
- await expect ( await locator . nth ( 1 ) ) . toHaveAttribute (
31
+ await expect ( locator . nth ( 1 ) ) . toHaveText ( 'text2' )
32
+ await expect ( locator . nth ( 1 ) ) . toHaveAttribute (
33
33
'href' ,
34
34
'https://example.com/test/' ,
35
35
)
36
- await expect ( await locator . nth ( 1 ) ) . toHaveAttribute ( 'target' , '_blank' )
37
- await expect ( await locator . nth ( 1 ) ) . toHaveAttribute (
38
- 'rel' ,
39
- 'noopener noreferrer' ,
40
- )
36
+ await expect ( locator . nth ( 1 ) ) . toHaveAttribute ( 'target' , '_blank' )
37
+ await expect ( locator . nth ( 1 ) ) . toHaveAttribute ( 'rel' , 'noopener noreferrer' )
41
38
} )
0 commit comments