From 45e49c5beb96ecf2f07462846dd7204910637dd8 Mon Sep 17 00:00:00 2001 From: julien huang Date: Tue, 9 Apr 2024 23:10:31 +0200 Subject: [PATCH] test: wait for network idle --- test/basic.test.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/basic.test.ts b/test/basic.test.ts index 5de13d028b..a3597b8dbc 100644 --- a/test/basic.test.ts +++ b/test/basic.test.ts @@ -2544,7 +2544,7 @@ describe('import components', () => { }) }) -describe('lazy import components', () => { +describe.only('lazy import components', () => { let html = '' it.sequential('fetch lazy-import-components page', async () => { @@ -2568,6 +2568,7 @@ describe('lazy import components', () => { const { page } = await renderPage('/lazy-import-components') expect(await page.locator('body').getByText('This shouldn\'t be visible at first!').all()).toHaveLength(0) await page.evaluate(() => window.scrollTo(0, document.body.scrollHeight)) + await page.waitForLoadState('networkidle') expect(await page.locator('body').getByText('This shouldn\'t be visible at first!').all()).toHaveLength(1) }) })