loading: false e2e test fix (#3635)

*  hotfix

* Fixed manual loading test

* Disable waitFor() test due to random failure in appveyor
This commit is contained in:
Jonas Galvez 2018-08-06 15:42:26 -03:00 committed by Sébastien Chopin
parent e740f51efa
commit de5b36a574
2 changed files with 9 additions and 11 deletions

View File

@ -33,10 +33,12 @@ describe('basic browser', () => {
expect(loading.show).toBe(true) expect(loading.show).toBe(true)
await hook await hook
expect(loading.show).toBe(true) expect(loading.show).toBe(true)
await page.waitForFunction(`document.querySelector('p').innerText === 'true'`) await page.waitForFunction(
expect(await page.$text('p')).toBe('true') `$nuxt.$loading.$data.show === false`
loading = await page.nuxt.loadingData() )
expect(loading.show).toBe(true) await page.waitForFunction(
`document.querySelector('p').innerText === 'true'`
)
}) })
test('/stateless', async () => { test('/stateless', async () => {

View File

@ -17,14 +17,10 @@ export default {
}) })
}, },
mounted() { mounted() {
this.$nuxt.$loading.finish()
setTimeout(() => { setTimeout(() => {
this.$nuxt.$loading.finish() this.$nuxt.$loading.start()
setTimeout(() => { this.loaded = true
// Re-enable loader as we move on
// to normal pages in the test
this.$nuxt.$loading.start()
this.loaded = true
}, 1500)
}, 1500) }, 1500)
} }
} }