mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-23 15:41:32 +00:00
failing test for skipped segments
This commit is contained in:
14
test/apps/basics/src/routes/skipped/[one]/[two].svelte
Normal file
14
test/apps/basics/src/routes/skipped/[one]/[two].svelte
Normal file
@@ -0,0 +1,14 @@
|
||||
<script context="module">
|
||||
export function preload({ params }) {
|
||||
return params;
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
export let one;
|
||||
export let two;
|
||||
</script>
|
||||
|
||||
<h1>{one}:{two}</h1>
|
||||
|
||||
<a href="y/1">y/1</a>
|
||||
@@ -324,4 +324,18 @@ describe('basics', function() {
|
||||
|
||||
assert.ok(html.body.indexOf('<h1>HTML</h1>') !== -1);
|
||||
});
|
||||
|
||||
it('invalidates page when a segment is skipped', async () => {
|
||||
await page.goto(`${base}/skipped/x/1`);
|
||||
await start();
|
||||
await prefetchRoutes();
|
||||
|
||||
await page.click('a[href="skipped/y/1"]');
|
||||
await wait(50);
|
||||
|
||||
assert.equal(
|
||||
await title(),
|
||||
'y:1'
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user