fix: add nuxt load indicator to fixture

This commit is contained in:
Peter Buglavecz 2024-11-19 16:29:17 +01:00
parent 0646244a30
commit 23b1af766b

View File

@ -642,8 +642,6 @@ describe('pages', () => {
const { page } = await renderPage('/')
await page.getByText('to page nuxt load indicator').click()
await page.waitForFunction(path => window.useNuxtApp?.()._route.fullPath === path, '/nested/xyz')
await page.goBack()
await page.waitForFunction(path => window.useNuxtApp?.()._route.fullPath === path, '/')
await page.waitForSelector(LOAD_INDICATOR_SELECTOR)
let isVisible = await page.isVisible(LOAD_INDICATOR_SELECTOR)
@ -653,6 +651,16 @@ describe('pages', () => {
isVisible = await page.isVisible(LOAD_INDICATOR_SELECTOR)
expect(isVisible).toBe(false)
await page.goBack()
await page.waitForSelector(LOAD_INDICATOR_SELECTOR)
isVisible = await page.isVisible(LOAD_INDICATOR_SELECTOR)
expect(isVisible).toBe(true)
await page.waitForSelector(LOAD_INDICATOR_SELECTOR, { state: 'hidden' })
isVisible = await page.isVisible(LOAD_INDICATOR_SELECTOR)
expect(isVisible).toBe(false)
await page.close()
})
})