From 92e7ae95ccbdfcb96fdb531728f993ba9be85972 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Mon, 26 Feb 2024 20:56:00 +0100 Subject: [PATCH] Convert ReactDOMServerIntegrationLegacyContext to createRoot --- ...rIntegrationLegacyContextDisabled-test.internal.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationLegacyContextDisabled-test.internal.js b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationLegacyContextDisabled-test.internal.js index f7ea2ec7415eb..d6abf530fbb40 100644 --- a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationLegacyContextDisabled-test.internal.js +++ b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationLegacyContextDisabled-test.internal.js @@ -13,7 +13,7 @@ const ReactDOMServerIntegrationUtils = require('./utils/ReactDOMServerIntegrationTestUtils'); let React; -let ReactDOM; +let ReactDOMClient; let ReactFeatureFlags; let ReactDOMServer; @@ -21,7 +21,7 @@ function initModules() { // Reset warning cache. jest.resetModules(); React = require('react'); - ReactDOM = require('react-dom'); + ReactDOMClient = require('react-dom/client'); ReactDOMServer = require('react-dom/server'); ReactFeatureFlags = require('shared/ReactFeatureFlags'); @@ -29,12 +29,13 @@ function initModules() { // Make them available to the helpers. return { - ReactDOM, + ReactDOMClient, ReactDOMServer, }; } -const {resetModules, itRenders} = ReactDOMServerIntegrationUtils(initModules); +const {resetModules, itRenders, clientRenderOnBadMarkup} = + ReactDOMServerIntegrationUtils(initModules); function formatValue(val) { if (val === null) { @@ -104,7 +105,7 @@ describe('ReactDOMServerIntegrationLegacyContextDisabled', () => { , - 3, + render === clientRenderOnBadMarkup ? 6 : 3, ); expect(e.textContent).toBe('{}undefinedundefined'); expect(lifecycleContextLog).toEqual([]);