Skip to content

Commit e47291d

Browse files
committed
add regression for title escaping in browser runtime
1 parent 3ba6560 commit e47291d

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,4 +484,22 @@ describe('ReactDOMFizzServerBrowser', () => {
484484

485485
expect(errors).toEqual(['uh oh', 'uh oh']);
486486
});
487+
488+
// https://github.com/facebook/react/pull/25534/files - fix transposed escape functions
489+
// @gate enableFloat
490+
it('should encode title properly', async () => {
491+
const stream = await ReactDOMFizzServer.renderToReadableStream(
492+
<html>
493+
<head>
494+
<title>foo</title>
495+
</head>
496+
<body>bar</body>
497+
</html>,
498+
);
499+
500+
const result = await readResult(stream);
501+
expect(result).toEqual(
502+
'<!DOCTYPE html><html><head><title>foo</title></title></head><body>bar</body></html>',
503+
);
504+
});
487505
});

0 commit comments

Comments
 (0)