diff --git a/packages/react-client/src/__tests__/ReactFlight-test.js b/packages/react-client/src/__tests__/ReactFlight-test.js index be92bb2d9eb01..f1ddf0dcd2eaa 100644 --- a/packages/react-client/src/__tests__/ReactFlight-test.js +++ b/packages/react-client/src/__tests__/ReactFlight-test.js @@ -213,6 +213,40 @@ describe('ReactFlight', () => { expect(ReactNoop).toMatchRenderedOutput(null); }); + // @gate FIXME + it('should transport undefined object values', async () => { + function ServerComponent(props) { + return 'prop' in props + ? `\`prop\` in props as '${props.prop}'` + : '`prop` not in props'; + } + const ClientComponent = clientReference(ServerComponent); + + const model = ( + <> +
+ Server: +
+
+ Client: +
+ + ); + + const transport = ReactNoopFlightServer.render(model); + + await act(async () => { + ReactNoop.render(await ReactNoopFlightClient.read(transport)); + }); + + expect(ReactNoop).toMatchRenderedOutput( + <> +
Server: `prop` in props as 'undefined'
+
Client: `prop` in props as 'undefined'
+ , + ); + }); + it('can render an empty fragment', async () => { function Empty() { return ;