Skip to content

Commit

Permalink
also assert html is correct
Browse files Browse the repository at this point in the history
  • Loading branch information
salazarm committed Oct 26, 2021
1 parent 8d03a46 commit 6c9abd8
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,10 @@ describe('ReactDOMServerPartialHydration', () => {
'Component',
]);

expect(container.innerHTML).toBe(
'<!--$-->Hello<div>Component</div><div>Component</div><div>Component</div><div>Component</div><!--/$-->',
);

suspend = true;
client = true;

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

// Unchanged
expect(container.innerHTML).toBe(
'<!--$-->Hello<div>Component</div><div>Component</div><div>Component</div><div>Component</div><!--/$-->',
);

suspend = false;
resolve();
await promise;
Expand All @@ -292,6 +301,8 @@ describe('ReactDOMServerPartialHydration', () => {
'Component',
'Component',
]);

// Client rendered - suspense comment nodes removed
expect(container.innerHTML).toBe(
'Hello<div>Component</div><div>Component</div><div>Component</div><article>Mismatch</article>',
);
Expand Down

0 comments on commit 6c9abd8

Please sign in to comment.