From 0646244a30e21c3a31007487ae68b5a5fcb5f19f Mon Sep 17 00:00:00 2001 From: Peter Buglavecz Date: Tue, 19 Nov 2024 16:24:38 +0100 Subject: [PATCH] fix: add nuxt load indicator to fixture --- test/basic.test.ts | 8 +++++++- test/fixtures/basic/pages/index.vue | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/test/basic.test.ts b/test/basic.test.ts index f16c793e9f..7531e70d26 100644 --- a/test/basic.test.ts +++ b/test/basic.test.ts @@ -644,9 +644,15 @@ describe('pages', () => { 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) + expect(isVisible).toBe(true) + 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) + await page.close() }) }) diff --git a/test/fixtures/basic/pages/index.vue b/test/fixtures/basic/pages/index.vue index ebc61019c1..45edab2b72 100644 --- a/test/fixtures/basic/pages/index.vue +++ b/test/fixtures/basic/pages/index.vue @@ -3,6 +3,7 @@ Basic fixture +

Hello Nuxt 3!

RuntimeConfig | testConfig: {{ config.public.testConfig }}
Composable | foo: {{ foo }}