diff --git a/test/basic.test.ts b/test/basic.test.ts index 3aa9526f5e..d4386c9086 100644 --- a/test/basic.test.ts +++ b/test/basic.test.ts @@ -1291,6 +1291,17 @@ describe('page key', () => { }) }) +describe('route provider', () => { + it('should preserve current route when navigation is suspended', async () => { + const { page } = await renderPage('/route-provider/foo') + await page.click('[href="/route-provider/bar"]') + expect(await page.getByTestId('foo').innerText()).toMatchInlineSnapshot('"foo: /route-provider/foo - /route-provider/foo"') + expect(await page.getByTestId('bar').innerText()).toMatchInlineSnapshot('"bar: /route-provider/bar - /route-provider/bar"') + + await page.close() + }) +}) + // Bug #6592 describe('layout change not load page twice', () => { const cases = { diff --git a/test/fixtures/basic/pages/route-provider/index.vue b/test/fixtures/basic/pages/route-provider/index.vue new file mode 100644 index 0000000000..34b99200b7 --- /dev/null +++ b/test/fixtures/basic/pages/route-provider/index.vue @@ -0,0 +1,11 @@ + diff --git a/test/fixtures/basic/pages/route-provider/index/bar.vue b/test/fixtures/basic/pages/route-provider/index/bar.vue new file mode 100644 index 0000000000..425b5d3428 --- /dev/null +++ b/test/fixtures/basic/pages/route-provider/index/bar.vue @@ -0,0 +1,14 @@ + + + + + diff --git a/test/fixtures/basic/pages/route-provider/index/foo.vue b/test/fixtures/basic/pages/route-provider/index/foo.vue new file mode 100644 index 0000000000..cc6f3268a7 --- /dev/null +++ b/test/fixtures/basic/pages/route-provider/index/foo.vue @@ -0,0 +1,14 @@ + + + + +