fix: add nuxt load indicator to fixture

This commit is contained in:
Peter Buglavecz 2024-11-19 16:24:38 +01:00
parent df749b9b5b
commit 0646244a30
2 changed files with 8 additions and 1 deletions

View File

@ -644,9 +644,15 @@ describe('pages', () => {
await page.waitForFunction(path => window.useNuxtApp?.()._route.fullPath === path, '/nested/xyz') await page.waitForFunction(path => window.useNuxtApp?.()._route.fullPath === path, '/nested/xyz')
await page.goBack() await page.goBack()
await page.waitForFunction(path => window.useNuxtApp?.()._route.fullPath === path, '/') await page.waitForFunction(path => window.useNuxtApp?.()._route.fullPath === path, '/')
await page.waitForSelector(LOAD_INDICATOR_SELECTOR)
let isVisible = await page.isVisible(LOAD_INDICATOR_SELECTOR)
expect(isVisible).toBe(true)
await page.waitForSelector(LOAD_INDICATOR_SELECTOR, { state: 'hidden' }) await page.waitForSelector(LOAD_INDICATOR_SELECTOR, { state: 'hidden' })
const isVisible = await page.isVisible(LOAD_INDICATOR_SELECTOR) isVisible = await page.isVisible(LOAD_INDICATOR_SELECTOR)
expect(isVisible).toBe(false) expect(isVisible).toBe(false)
await page.close() await page.close()
}) })
}) })

View File

@ -3,6 +3,7 @@
<Head> <Head>
<Title>Basic fixture</Title> <Title>Basic fixture</Title>
</Head> </Head>
<NuxtLoadingIndicator :throttle="0" />
<h1>Hello Nuxt 3!</h1> <h1>Hello Nuxt 3!</h1>
<div>RuntimeConfig | testConfig: {{ config.public.testConfig }}</div> <div>RuntimeConfig | testConfig: {{ config.public.testConfig }}</div>
<div>Composable | foo: {{ foo }}</div> <div>Composable | foo: {{ foo }}</div>