Skip to content

Commit

Permalink
Figured out how to write a test that should work OK
Browse files Browse the repository at this point in the history
  • Loading branch information
sophiebits committed Feb 24, 2023
1 parent a3c6553 commit ba8b1d2
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/react-dom/src/__tests__/ReactDOMFizzServerNode-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -635,4 +635,17 @@ describe('ReactDOMFizzServerNode', () => {
expect(rendered).toBe(false);
expect(isComplete).toBe(true);
});

it('should encode multibyte characters correctly without nulls (#24985)', () => {
const {writable, output} = getTestWritable();
const {pipe} = ReactDOMFizzServer.renderToPipeableStream(
<div>{Array(700).fill('ののの')}</div>,
);
pipe(writable);
jest.runAllTimers();
expect(output.result.indexOf('\u0000')).toBe(-1);
expect(output.result).toEqual(
'<div>' + Array(700).fill('ののの').join('<!-- -->') + '</div>',
);
});
});

0 comments on commit ba8b1d2

Please sign in to comment.