From 87c52fd3734f393c18fce47657d9851eb8ad662f Mon Sep 17 00:00:00 2001 From: eps1lon Date: Wed, 8 Mar 2023 21:44:36 +0100 Subject: [PATCH] Regression test for empty fragments This was also throwing before we added support for rendering undefined. --- .../src/__tests__/ReactFlight-test.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/packages/react-client/src/__tests__/ReactFlight-test.js b/packages/react-client/src/__tests__/ReactFlight-test.js index 060e3bcf6f9f1..e90ee143ca081 100644 --- a/packages/react-client/src/__tests__/ReactFlight-test.js +++ b/packages/react-client/src/__tests__/ReactFlight-test.js @@ -213,6 +213,22 @@ describe('ReactFlight', () => { expect(ReactNoop).toMatchRenderedOutput(null); }); + it('can render an empty fragment', async () => { + function Empty() { + return ; + } + + const model = ; + + const transport = ReactNoopFlightServer.render(model); + + await act(async () => { + ReactNoop.render(await ReactNoopFlightClient.read(transport)); + }); + + expect(ReactNoop).toMatchRenderedOutput(null); + }); + it('can render a lazy component as a shared component on the server', async () => { function SharedComponent({text}) { return (