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)
await hook
expect(loading.show).toBe(true)
await page.waitForFunction(`document.querySelector('p').innerText === 'true'`)
expect(await page.$text('p')).toBe('true')
loading = await page.nuxt.loadingData()
expect(loading.show).toBe(true)
await page.waitForFunction(
`$nuxt.$loading.$data.show === false`
)
await page.waitForFunction(
`document.querySelector('p').innerText === 'true'`
)
})
test('/stateless', async () => {

View File

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