Skip to content

Commit ba8b1d2

Browse files
committed
Figured out how to write a test that should work OK
1 parent a3c6553 commit ba8b1d2

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -635,4 +635,17 @@ describe('ReactDOMFizzServerNode', () => {
635635
expect(rendered).toBe(false);
636636
expect(isComplete).toBe(true);
637637
});
638+
639+
it('should encode multibyte characters correctly without nulls (#24985)', () => {
640+
const {writable, output} = getTestWritable();
641+
const {pipe} = ReactDOMFizzServer.renderToPipeableStream(
642+
<div>{Array(700).fill('ののの')}</div>,
643+
);
644+
pipe(writable);
645+
jest.runAllTimers();
646+
expect(output.result.indexOf('\u0000')).toBe(-1);
647+
expect(output.result).toEqual(
648+
'<div>' + Array(700).fill('ののの').join('<!-- -->') + '</div>',
649+
);
650+
});
638651
});

0 commit comments

Comments
 (0)