Merge pull request #610 from cudr/navigate_fix

Navigate from /a/[id] to /b/[id] fix
This commit is contained in:
Rich Harris
2019-04-27 11:56:03 -04:00
committed by GitHub
4 changed files with 17 additions and 2 deletions

View File

@@ -0,0 +1,3 @@
<h1>A page</h1>
<a href="dirs/foo/xyz">same segment</a>

View File

@@ -0,0 +1 @@
<h1>B page</h1>

View File

@@ -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: {