From 982392e16e231371b3113347156036342fae1bec Mon Sep 17 00:00:00 2001 From: Jiachi Liu Date: Mon, 14 Oct 2024 17:04:31 +0200 Subject: [PATCH] test: fix flaky tests for hydration error with 18.3 (#71260) --- test/development/acceptance/hydration-error.test.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/development/acceptance/hydration-error.test.ts b/test/development/acceptance/hydration-error.test.ts index 6046e2ea8e872..b0136b03af154 100644 --- a/test/development/acceptance/hydration-error.test.ts +++ b/test/development/acceptance/hydration-error.test.ts @@ -197,7 +197,12 @@ describe('Error overlay for hydration errors in Pages router', () => { ) await session.assertHasRedbox() - expect(await getRedboxTotalErrorCount(browser)).toBe(isReact18 ? 3 : 1) + const totalAmount = await getRedboxTotalErrorCount(browser) + if (isReact18) { + expect(totalAmount).toBeGreaterThanOrEqual(2) + } else { + expect(totalAmount).toBe(1) + } const pseudoHtml = await session.getRedboxComponentStack() if (isTurbopack) {