[tests] assertLog before act in ReactDOMServerSelectiveHydration (#28759)

Fixes tests blocking https://github.com/facebook/react/pull/28737
This commit is contained in:
Ricky
2024-04-10 10:34:02 -04:00
committed by GitHub
parent e36ee763fa
commit 88df5242d6
@@ -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([]);
});
});