File tree Expand file tree Collapse file tree 9 files changed +73
-34
lines changed
.vuepress/theme/client/layouts Expand file tree Collapse file tree 9 files changed +73
-34
lines changed Original file line number Diff line number Diff line change 1
1
<template >
2
2
<div class =" e2e-theme-not-found" >404 Not Found</div >
3
+ <div class =" e2e-theme-not-found-content" ><Content /></div >
3
4
</template >
Original file line number Diff line number Diff line change 2
2
routeMeta :
3
3
foo : bar
4
4
---
5
+
6
+ ## NotFound H2
Original file line number Diff line number Diff line change 1
1
foo
2
+
3
+ ## Home H2
Original file line number Diff line number Diff line change
1
+ <!-- TODO -->
Original file line number Diff line number Diff line change
1
+ <button id="home-with-query" @click ="goHomeWithQuery">Home</button >
2
+ <button id="home-with-query-and-hash" @click ="goHomeWithQueryAndHash">Home</button >
3
+ <button id="not-found-with-hash" @click ="go404WithHash">404</button >
4
+ <button id="not-found-with-hash-and-query" @click ="go404WithHashAndQuery">404</button >
5
+
6
+ <script setup lang =" ts " >
7
+ import { useRouter } from ' vuepress/client' ;
8
+
9
+ const router = useRouter ();
10
+
11
+ const goHomeWithQuery = () => {
12
+ router .push (' /?home=true' );
13
+ }
14
+
15
+ const goHomeWithQueryAndHash = () => {
16
+ router .push (' /?home=true#home' );
17
+ }
18
+
19
+ const go404WithHash = () => {
20
+ router .push (' /404.html#404' );
21
+ }
22
+
23
+ const go404WithHashAndQuery = () => {
24
+ router .push (' /404.html#404?notFound=true' );
25
+ }
26
+ </script >
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ import { expect , test } from '@playwright/test'
2
+ import { BASE } from '../../utils/env'
3
+
4
+ test . beforeEach ( async ( { page } ) => {
5
+ await page . goto ( 'router/navigate-by-link.html' )
6
+ } )
7
+
8
+ test ( 'TODO' , async ( { page } ) => {
9
+ // TODO
10
+ await expect ( page ) . toHaveURL ( `${ BASE } router/navigate-by-link.html` )
11
+ } )
Original file line number Diff line number Diff line change
1
+ import { expect , test } from '@playwright/test'
2
+ import { BASE } from '../../utils/env'
3
+
4
+ test . beforeEach ( async ( { page } ) => {
5
+ await page . goto ( 'router/navigate-by-router.html' )
6
+ } )
7
+
8
+ test ( 'should preserve query' , async ( { page } ) => {
9
+ await page . locator ( '#home-with-query' ) . click ( )
10
+ await expect ( page ) . toHaveURL ( `${ BASE } ?home=true` )
11
+ await expect ( page . locator ( '#home-h2' ) ) . toHaveText ( 'Home H2' )
12
+ } )
13
+
14
+ test ( 'should preserve query and hash' , async ( { page } ) => {
15
+ await page . locator ( '#home-with-query-and-hash' ) . click ( )
16
+ await expect ( page ) . toHaveURL ( `${ BASE } ?home=true#home` )
17
+ await expect ( page . locator ( '#home-h2' ) ) . toHaveText ( 'Home H2' )
18
+ } )
19
+
20
+ test ( 'should preserve hash' , async ( { page } ) => {
21
+ await page . locator ( '#not-found-with-hash' ) . click ( )
22
+ await expect ( page ) . toHaveURL ( `${ BASE } 404.html#404` )
23
+ await expect ( page . locator ( '#notfound-h2' ) ) . toHaveText ( 'NotFound H2' )
24
+ } )
25
+
26
+ test ( 'should preserve hash and query' , async ( { page } ) => {
27
+ await page . locator ( '#not-found-with-hash-and-query' ) . click ( )
28
+ await expect ( page ) . toHaveURL ( `${ BASE } 404.html#404?notFound=true` )
29
+ await expect ( page . locator ( '#notfound-h2' ) ) . toHaveText ( 'NotFound H2' )
30
+ } )
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments