@@ -38,6 +38,10 @@ test('should render active status correctly', async ({ page }) => {
38
38
const CONFIGS = [
39
39
'route-link route-link-active' ,
40
40
'route-link route-link-active' ,
41
+ 'route-link route-link-active' ,
42
+ 'route-link route-link-active' ,
43
+ 'route-link' ,
44
+ 'route-link' ,
41
45
'route-link' ,
42
46
'route-link' ,
43
47
]
@@ -53,6 +57,8 @@ test('should render class correctly', async ({ page }) => {
53
57
const CONFIGS = [
54
58
'route-link custom-class' ,
55
59
'route-link route-link-active custom-class' ,
60
+ 'route-link custom-class' ,
61
+ 'route-link route-link-active custom-class' ,
56
62
]
57
63
58
64
for ( const [ index , className ] of CONFIGS . entries ( ) ) {
@@ -80,6 +86,22 @@ test('should render attributes correctly', async ({ page }) => {
80
86
attrName : 'aria-label' ,
81
87
attrValue : 'test' ,
82
88
} ,
89
+ {
90
+ attrName : 'title' ,
91
+ attrValue : 'Title' ,
92
+ } ,
93
+ {
94
+ attrName : 'target' ,
95
+ attrValue : '_blank' ,
96
+ } ,
97
+ {
98
+ attrName : 'rel' ,
99
+ attrValue : 'noopener' ,
100
+ } ,
101
+ {
102
+ attrName : 'aria-label' ,
103
+ attrValue : 'test' ,
104
+ } ,
83
105
]
84
106
85
107
for ( const [ index , { attrName, attrValue } ] of CONFIGS . entries ( ) ) {
@@ -99,6 +121,14 @@ test('should render slots correctly', async ({ page }) => {
99
121
spansCount : 2 ,
100
122
spansText : [ 'text' , 'text2' ] ,
101
123
} ,
124
+ {
125
+ spansCount : 1 ,
126
+ spansText : [ 'text' ] ,
127
+ } ,
128
+ {
129
+ spansCount : 2 ,
130
+ spansText : [ 'text' , 'text2' ] ,
131
+ } ,
102
132
]
103
133
for ( const [ index , { spansCount, spansText } ] of CONFIGS . entries ( ) ) {
104
134
const children = await page
@@ -114,6 +144,12 @@ test('should render slots correctly', async ({ page }) => {
114
144
115
145
test ( 'should render hash and query correctly' , async ( { page } ) => {
116
146
const CONFIGS = [
147
+ `${ BASE } #hash` ,
148
+ `${ BASE } ?query` ,
149
+ `${ BASE } ?query#hash` ,
150
+ `${ BASE } ?query=1#hash` ,
151
+ `${ BASE } ?query=1&query=2#hash` ,
152
+ `${ BASE } #hash?query=1&query=2` ,
117
153
`${ BASE } #hash` ,
118
154
`${ BASE } ?query` ,
119
155
`${ BASE } ?query#hash` ,
@@ -134,3 +170,20 @@ test('should render hash and query correctly', async ({ page }) => {
134
170
) . toHaveAttribute ( 'href' , href )
135
171
}
136
172
} )
173
+
174
+ test ( 'should render relative links correctly' , async ( { page } ) => {
175
+ const CONFIGS = [
176
+ BASE ,
177
+ `${ BASE } 404.html` ,
178
+ `${ BASE } components/not-exist.html` ,
179
+ BASE ,
180
+ `${ BASE } 404.html` ,
181
+ `${ BASE } components/not-exist.html` ,
182
+ ]
183
+
184
+ for ( const [ index , href ] of CONFIGS . entries ( ) ) {
185
+ await expect (
186
+ page . locator ( '.e2e-theme-content #relative + ul > li a' ) . nth ( index ) ,
187
+ ) . toHaveAttribute ( 'href' , href )
188
+ }
189
+ } )
0 commit comments