Skip to content

Commit be1cefa

Browse files
committed
Make test better
it not has an intentional client mismatch that would error if there wasn't supression brought about by the earlier error. when it client rendres it has the updated value not found in the server response but we do not see a hydration warning because it was superseded by the thrown error in that render
1 parent 3fd1eb6 commit be1cefa

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

packages/react-dom/src/__tests__/ReactDOMFizzServer-test.js

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3037,9 +3037,9 @@ describe('ReactDOMFizzServer', () => {
30373037
<ThrowUntilOnClient>
30383038
<h1>one</h1>
30393039
</ThrowUntilOnClient>
3040-
<StopThrowingOnClient />
30413040
<h2>two</h2>
3042-
<h3>three</h3>
3041+
<h3>{isClient ? 'five' : 'three'}</h3>
3042+
<StopThrowingOnClient />
30433043
</Suspense>
30443044
</div>
30453045
);
@@ -3067,20 +3067,18 @@ describe('ReactDOMFizzServer', () => {
30673067
);
30683068
},
30693069
});
3070-
await act(async () => {
3071-
expect(Scheduler).toFlushAndYieldThrough([
3072-
'Logged recoverable error: uh oh',
3073-
'Logged recoverable error: Hydration failed because the initial UI does not match what was rendered on the server.',
3074-
'Logged recoverable error: Hydration failed because the initial UI does not match what was rendered on the server.',
3075-
'Logged recoverable error: There was an error while hydrating this Suspense boundary. Switched to client rendering.',
3076-
]);
3077-
});
3070+
expect(Scheduler).toFlushAndYield([
3071+
'Logged recoverable error: uh oh',
3072+
'Logged recoverable error: Hydration failed because the initial UI does not match what was rendered on the server.',
3073+
'Logged recoverable error: Hydration failed because the initial UI does not match what was rendered on the server.',
3074+
'Logged recoverable error: There was an error while hydrating this Suspense boundary. Switched to client rendering.',
3075+
]);
30783076

30793077
expect(getVisibleChildren(container)).toEqual(
30803078
<div>
30813079
<h1>one</h1>
30823080
<h2>two</h2>
3083-
<h3>three</h3>
3081+
<h3>five</h3>
30843082
</div>,
30853083
);
30863084

0 commit comments

Comments
 (0)