@@ -38,6 +38,10 @@ test('should render active status correctly', async ({ page }) => {
3838 const CONFIGS = [
3939 'route-link route-link-active' ,
4040 'route-link route-link-active' ,
41+ 'route-link route-link-active' ,
42+ 'route-link route-link-active' ,
43+ 'route-link' ,
44+ 'route-link' ,
4145 'route-link' ,
4246 'route-link' ,
4347 ]
@@ -53,6 +57,8 @@ test('should render class correctly', async ({ page }) => {
5357 const CONFIGS = [
5458 'route-link custom-class' ,
5559 'route-link route-link-active custom-class' ,
60+ 'route-link custom-class' ,
61+ 'route-link route-link-active custom-class' ,
5662 ]
5763
5864 for ( const [ index , className ] of CONFIGS . entries ( ) ) {
@@ -80,6 +86,22 @@ test('should render attributes correctly', async ({ page }) => {
8086 attrName : 'aria-label' ,
8187 attrValue : 'test' ,
8288 } ,
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+ } ,
83105 ]
84106
85107 for ( const [ index , { attrName, attrValue } ] of CONFIGS . entries ( ) ) {
@@ -99,6 +121,14 @@ test('should render slots correctly', async ({ page }) => {
99121 spansCount : 2 ,
100122 spansText : [ 'text' , 'text2' ] ,
101123 } ,
124+ {
125+ spansCount : 1 ,
126+ spansText : [ 'text' ] ,
127+ } ,
128+ {
129+ spansCount : 2 ,
130+ spansText : [ 'text' , 'text2' ] ,
131+ } ,
102132 ]
103133 for ( const [ index , { spansCount, spansText } ] of CONFIGS . entries ( ) ) {
104134 const children = await page
@@ -114,6 +144,12 @@ test('should render slots correctly', async ({ page }) => {
114144
115145test ( 'should render hash and query correctly' , async ( { page } ) => {
116146 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` ,
117153 `${ BASE } #hash` ,
118154 `${ BASE } ?query` ,
119155 `${ BASE } ?query#hash` ,
@@ -134,3 +170,20 @@ test('should render hash and query correctly', async ({ page }) => {
134170 ) . toHaveAttribute ( 'href' , href )
135171 }
136172} )
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