From dd36a181401b660349b7d2a52243701928cc0f63 Mon Sep 17 00:00:00 2001 From: Michael Brevard Date: Mon, 8 Apr 2024 19:58:33 +0300 Subject: [PATCH] wip: add scrolling to test for delayed hydration --- test/basic.test.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/basic.test.ts b/test/basic.test.ts index a5a42fca1..fef26e99f 100644 --- a/test/basic.test.ts +++ b/test/basic.test.ts @@ -2567,5 +2567,9 @@ describe('lazy import components', () => { expect(html).not.toContain('This shouldn\'t be visible at first!') 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) + }) + expect(await page.locator('body').getByText('This shouldn\'t be visible at first!').all()).toHaveLength(1) }) })