mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-14 03:54:46 +00:00
handle deep links
This commit is contained in:
@@ -166,7 +166,7 @@ function run(env) {
|
||||
});
|
||||
|
||||
it('navigates to a new page without reloading', async () => {
|
||||
await nightmare.goto(base);
|
||||
await nightmare.goto(base).wait(() => window.READY).wait(100);
|
||||
|
||||
const requests = await capture(async () => {
|
||||
await nightmare.click('a[href="/about"]');
|
||||
@@ -198,6 +198,16 @@ function run(env) {
|
||||
'What is Sapper?'
|
||||
);
|
||||
});
|
||||
|
||||
it('scrolls to active deeplink', async () => {
|
||||
const scrollY = await nightmare
|
||||
.goto(`${base}/blog/a-very-long-post#four`)
|
||||
.wait(() => window.READY)
|
||||
.wait(100)
|
||||
.evaluate(() => window.scrollY);
|
||||
|
||||
assert.ok(scrollY > 0, scrollY);
|
||||
});
|
||||
});
|
||||
|
||||
describe('headers', () => {
|
||||
|
||||
Reference in New Issue
Block a user