Skip to content

Commit 26c28ed

Browse files
committed
chore: updates
1 parent 6c43ceb commit 26c28ed

File tree

9 files changed

+73
-34
lines changed

9 files changed

+73
-34
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
<template>
22
<div class="e2e-theme-not-found">404 Not Found</div>
3+
<div class="e2e-theme-not-found-content"><Content /></div>
34
</template>

e2e/docs/404.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@
22
routeMeta:
33
foo: bar
44
---
5+
6+
## NotFound H2

e2e/docs/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
foo
2+
3+
## Home H2

e2e/docs/router/navigate-by-link.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<!-- TODO -->

e2e/docs/router/navigate-by-router.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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>

e2e/docs/router/navigation.md

Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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+
})
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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+
})

e2e/tests/router/navigation.spec.ts

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)