Skip to content

Commit d592444

Browse files
committed
fix test gating
1 parent 3693f5f commit d592444

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

packages/react-dom/src/__tests__/ReactDOMServerPartialHydration-test.internal.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -199,16 +199,6 @@ describe('ReactDOMServerPartialHydration', () => {
199199
// hydrating anyway.
200200
suspend = true;
201201
ReactDOM.hydrateRoot(container, <App />);
202-
Scheduler.unstable_flushAll();
203-
jest.runAllTimers();
204-
205-
// Expect the server-generated HTML to stay intact.
206-
expect(container.textContent).toBe('HelloHello');
207-
208-
// Resolving the promise should continue hydration
209-
suspend = false;
210-
resolve();
211-
await promise;
212202
if (gate(flags => flags.enableClientRenderFallbackOnHydrationMismatch)) {
213203
Scheduler.unstable_flushAll();
214204
} else {
@@ -220,6 +210,16 @@ describe('ReactDOMServerPartialHydration', () => {
220210
);
221211
}
222212
jest.runAllTimers();
213+
214+
// Expect the server-generated HTML to stay intact.
215+
expect(container.textContent).toBe('HelloHello');
216+
217+
// Resolving the promise should continue hydration
218+
suspend = false;
219+
resolve();
220+
await promise;
221+
Scheduler.unstable_flushAll();
222+
jest.runAllTimers();
223223
// Hydration should not change anything.
224224
expect(container.textContent).toBe('HelloHello');
225225
});

0 commit comments

Comments
 (0)