Skip to content

Commit 6c9abd8

Browse files
committed
also assert html is correct
1 parent 8d03a46 commit 6c9abd8

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,10 @@ describe('ReactDOMServerPartialHydration', () => {
261261
'Component',
262262
]);
263263

264+
expect(container.innerHTML).toBe(
265+
'<!--$-->Hello<div>Component</div><div>Component</div><div>Component</div><div>Component</div><!--/$-->',
266+
);
267+
264268
suspend = true;
265269
client = true;
266270

@@ -274,6 +278,11 @@ describe('ReactDOMServerPartialHydration', () => {
274278
]);
275279
jest.runAllTimers();
276280

281+
// Unchanged
282+
expect(container.innerHTML).toBe(
283+
'<!--$-->Hello<div>Component</div><div>Component</div><div>Component</div><div>Component</div><!--/$-->',
284+
);
285+
277286
suspend = false;
278287
resolve();
279288
await promise;
@@ -292,6 +301,8 @@ describe('ReactDOMServerPartialHydration', () => {
292301
'Component',
293302
'Component',
294303
]);
304+
305+
// Client rendered - suspense comment nodes removed
295306
expect(container.innerHTML).toBe(
296307
'Hello<div>Component</div><div>Component</div><div>Component</div><article>Mismatch</article>',
297308
);

0 commit comments

Comments
 (0)