Skip to content

Commit

Permalink
[tests] assertLog before act in ReactDOMServerSelectiveHydration (fac…
Browse files Browse the repository at this point in the history
…ebook#28759)

Fixes tests blocking facebook#28737
  • Loading branch information
rickhanlonii authored and AndyPengc12 committed Apr 15, 2024
1 parent d552b27 commit 50b41eb
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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([]);
});
});

Expand Down

0 comments on commit 50b41eb

Please sign in to comment.