From 1fbe165da57629285900d5e10758f53e831fb5ed Mon Sep 17 00:00:00 2001 From: Michael Brevard Date: Sun, 16 Jun 2024 11:11:09 +0300 Subject: [PATCH] chore: begin response logging before click --- test/basic.test.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/basic.test.ts b/test/basic.test.ts index 4584b7034a..241f77cd4f 100644 --- a/test/basic.test.ts +++ b/test/basic.test.ts @@ -2693,10 +2693,11 @@ describe('lazy import components', () => { it('respects custom delayed hydration triggers', async () => { const { page } = await renderPage('/lazy-import-components') await page.waitForLoadState('networkidle') - await page.locator('#lazyevent2').click() - await page.waitForResponse(response => + const resp = page.waitForResponse(response => response.status() === 200 && response.text().then(text => text.includes('This shouldn\'t be visible at first with events!')), ) + await page.locator('#lazyevent2').click() + await resp expect(await page.locator('body').getByText('This should be visible at first with events!').all()).toHaveLength(1) expect(await page.locator('body').getByText('This shouldn\'t be visible at first with events!').all()).toHaveLength(1) })