From 88df5242d6f8e319d7903f6fa984e3a02cd44b34 Mon Sep 17 00:00:00 2001 From: Ricky Date: Wed, 10 Apr 2024 10:34:02 -0400 Subject: [PATCH] [tests] assertLog before act in ReactDOMServerSelectiveHydration (#28759) Fixes tests blocking https://github.com/facebook/react/pull/28737 --- .../ReactDOMServerSelectiveHydration-test.internal.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/react-dom/src/__tests__/ReactDOMServerSelectiveHydration-test.internal.js b/packages/react-dom/src/__tests__/ReactDOMServerSelectiveHydration-test.internal.js index 82de143683b67..6a5aff96b3c1f 100644 --- a/packages/react-dom/src/__tests__/ReactDOMServerSelectiveHydration-test.internal.js +++ b/packages/react-dom/src/__tests__/ReactDOMServerSelectiveHydration-test.internal.js @@ -1114,14 +1114,16 @@ describe('ReactDOMServerSelectiveHydration', () => { // Outer was hydrated earlier OuterTestUtils.assertLog([]); + // First Inner Mouse Enter fires then Outer Mouse Enter + assertLog(['Inner Mouse Enter', 'Outer Mouse Enter']); + await act(() => { Scheduler.unstable_flushAllWithoutAsserting(); OuterScheduler.unstable_flushAllWithoutAsserting(); InnerScheduler.unstable_flushAllWithoutAsserting(); }); - // First Inner Mouse Enter fires then Outer Mouse Enter - assertLog(['Inner Mouse Enter', 'Outer Mouse Enter']); + assertLog([]); }); });