mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-12 03:05:12 +00:00
Merge pull request #610 from cudr/navigate_fix
Navigate from /a/[id] to /b/[id] fix
This commit is contained in:
3
test/apps/basics/src/routes/dirs/bar/[a].svelte
Normal file
3
test/apps/basics/src/routes/dirs/bar/[a].svelte
Normal file
@@ -0,0 +1,3 @@
|
||||
<h1>A page</h1>
|
||||
|
||||
<a href="dirs/foo/xyz">same segment</a>
|
||||
1
test/apps/basics/src/routes/dirs/foo/[b].svelte
Normal file
1
test/apps/basics/src/routes/dirs/foo/[b].svelte
Normal file
@@ -0,0 +1 @@
|
||||
<h1>B page</h1>
|
||||
@@ -282,6 +282,17 @@ describe('basics', function() {
|
||||
assert.equal(await title(), 'bar');
|
||||
});
|
||||
|
||||
it('navigates between dynamic routes with same segments', async () => {
|
||||
await page.goto(`${base}/dirs/bar/xyz`);
|
||||
await start();
|
||||
|
||||
assert.equal(await title(), 'A page');
|
||||
|
||||
await page.click('[href="dirs/foo/xyz"]');
|
||||
await wait(50);
|
||||
assert.equal(await title(), 'B page');
|
||||
});
|
||||
|
||||
it('runs server route handlers before page handlers, if they match', async () => {
|
||||
const json = await get(`${base}/middleware`, {
|
||||
headers: {
|
||||
|
||||
Reference in New Issue
Block a user