From 206934f0270d248b9eec186e2f70b0c7a4f99e1d Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Mon, 22 Jan 2024 09:21:40 +0100 Subject: [PATCH] Convert ReactDOMOption to createRoot (#28002) --- .../src/__tests__/ReactDOMOption-test.js | 57 ++++++++++++++----- scripts/jest/matchers/toWarnDev.js | 3 +- 2 files changed, 45 insertions(+), 15 deletions(-) diff --git a/packages/react-dom/src/__tests__/ReactDOMOption-test.js b/packages/react-dom/src/__tests__/ReactDOMOption-test.js index b8dc69b3f6b7d..c0597c36b20d1 100644 --- a/packages/react-dom/src/__tests__/ReactDOMOption-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMOption-test.js @@ -11,16 +11,18 @@ describe('ReactDOMOption', () => { let React; - let ReactDOM; + let ReactDOMClient; let ReactDOMServer; let ReactTestUtils; + let act; beforeEach(() => { jest.resetModules(); React = require('react'); - ReactDOM = require('react-dom'); + ReactDOMClient = require('react-dom/client'); ReactDOMServer = require('react-dom/server'); ReactTestUtils = require('react-dom/test-utils'); + act = require('internal-test-utils').act; }); it('should flatten children to a string', () => { @@ -182,19 +184,28 @@ describe('ReactDOMOption', () => { expect(node.innerHTML).toBe('foobar'); }); - it('should set attribute for empty value', () => { + it('should set attribute for empty value', async () => { const container = document.createElement('div'); - const option = ReactDOM.render(