@@ -6,36 +6,33 @@ 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+
11+ for ( const el of await locator . all ( ) ) {
1212 await expect ( el ) . toHaveAttribute ( 'class' , / r o u t e - l i n k / )
1313 }
1414} )
1515
1616test ( '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 ( ) ) {
2020 await expect ( el ) . toHaveAttribute ( 'class' , / e x t e r n a l - l i n k / )
2121 }
2222} )
2323
2424test ( 'should render config correctly' , async ( { page } ) => {
2525 const locator = page . locator ( '.e2e-theme-content #config a' )
2626
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' )
3030
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 (
3333 'href' ,
3434 'https://example.com/test/' ,
3535 )
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' )
4138} )
0 commit comments