mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-13 19:45:26 +00:00
return a promise from init - fixes #99
This commit is contained in:
@@ -183,7 +183,7 @@ function run(env) {
|
||||
});
|
||||
|
||||
it('navigates to a new page without reloading', () => {
|
||||
return nightmare.goto(base).init().wait(200)
|
||||
return nightmare.goto(base).init().wait(100)
|
||||
.then(() => {
|
||||
return capture(() => nightmare.click('a[href="/about"]'));
|
||||
})
|
||||
@@ -204,7 +204,6 @@ function run(env) {
|
||||
return nightmare
|
||||
.goto(`${base}/about`)
|
||||
.init()
|
||||
.wait(100)
|
||||
.click('.goto')
|
||||
.wait(() => window.location.pathname === '/blog/what-is-sapper')
|
||||
.wait(100)
|
||||
@@ -218,7 +217,6 @@ function run(env) {
|
||||
return nightmare
|
||||
.goto(`${base}/about`)
|
||||
.init()
|
||||
.wait(100)
|
||||
.then(() => {
|
||||
return capture(() => {
|
||||
return nightmare
|
||||
@@ -235,7 +233,6 @@ function run(env) {
|
||||
return nightmare
|
||||
.goto(`${base}/blog/a-very-long-post#four`)
|
||||
.init()
|
||||
.wait(100)
|
||||
.evaluate(() => window.scrollY)
|
||||
.then(scrollY => {
|
||||
assert.ok(scrollY > 0, scrollY);
|
||||
@@ -246,7 +243,6 @@ function run(env) {
|
||||
return nightmare
|
||||
.goto(`${base}/blog`)
|
||||
.init()
|
||||
.wait(200)
|
||||
.then(() => {
|
||||
return capture(() => {
|
||||
return nightmare
|
||||
@@ -310,7 +306,7 @@ function run(env) {
|
||||
it('calls a delete handler', () => {
|
||||
return nightmare
|
||||
.goto(`${base}/delete-test`)
|
||||
.init().wait(100)
|
||||
.init()
|
||||
.click('.del')
|
||||
.wait(() => window.deleted)
|
||||
.evaluate(() => window.deleted.id)
|
||||
@@ -325,7 +321,7 @@ function run(env) {
|
||||
.evaluate(() => {
|
||||
window.el = document.querySelector('.hydrate-test');
|
||||
})
|
||||
.init().wait(100)
|
||||
.init()
|
||||
.evaluate(() => {
|
||||
return document.querySelector('.hydrate-test') === window.el;
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user