Skip to content

Commit

Permalink
fix test gating
Browse files Browse the repository at this point in the history
  • Loading branch information
salazarm committed Nov 17, 2021
1 parent 3693f5f commit d592444
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,16 +199,6 @@ describe('ReactDOMServerPartialHydration', () => {
// hydrating anyway.
suspend = true;
ReactDOM.hydrateRoot(container, <App />);
Scheduler.unstable_flushAll();
jest.runAllTimers();

// Expect the server-generated HTML to stay intact.
expect(container.textContent).toBe('HelloHello');

// Resolving the promise should continue hydration
suspend = false;
resolve();
await promise;
if (gate(flags => flags.enableClientRenderFallbackOnHydrationMismatch)) {
Scheduler.unstable_flushAll();
} else {
Expand All @@ -220,6 +210,16 @@ describe('ReactDOMServerPartialHydration', () => {
);
}
jest.runAllTimers();

// Expect the server-generated HTML to stay intact.
expect(container.textContent).toBe('HelloHello');

// Resolving the promise should continue hydration
suspend = false;
resolve();
await promise;
Scheduler.unstable_flushAll();
jest.runAllTimers();
// Hydration should not change anything.
expect(container.textContent).toBe('HelloHello');
});
Expand Down

0 comments on commit d592444

Please sign in to comment.