From 3d77e267d80da1f1fd5bad475032628e199ca31e Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Sat, 16 Mar 2024 13:38:29 -0700 Subject: [PATCH] test: use locator assertion for body text --- test/basic.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/basic.test.ts b/test/basic.test.ts index 9805d5fed6..d375a9c130 100644 --- a/test/basic.test.ts +++ b/test/basic.test.ts @@ -411,6 +411,7 @@ describe('pages', () => { it('/wrapper-expose/page', async () => { const { page, pageErrors, consoleLogs } = await renderPage('/wrapper-expose/page') + await page.waitForLoadState('networkidle') await page.locator('#log-foo').click() expect(consoleLogs.at(-1)?.text).toBe('bar') // change page @@ -2497,9 +2498,8 @@ describe('teleports', () => { describe('Node.js compatibility for client-side', () => { it('should work', async () => { const { page } = await renderPage('/node-compat') - const html = await page.innerHTML('body') - expect(html).toContain('Nuxt is Awesome!') - expect(html).toContain('CWD: [available]') + await page.locator('body').getByText('Nuxt is Awesome!').waitFor() + expect(await page.innerHTML('body')).toContain('CWD: [available]') await page.close() }) })