From a88e8b6df5a98bcaadf196eddd6473656984152a Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Fri, 2 Feb 2024 00:49:40 +0100 Subject: [PATCH] Convert SyntheticFocusEvent to createRoot (#28173) --- .../__tests__/SyntheticFocusEvent-test.js | 72 +++++++++++-------- 1 file changed, 42 insertions(+), 30 deletions(-) diff --git a/packages/react-dom/src/events/__tests__/SyntheticFocusEvent-test.js b/packages/react-dom/src/events/__tests__/SyntheticFocusEvent-test.js index 9e70ca1486439..ef889c4b60d10 100644 --- a/packages/react-dom/src/events/__tests__/SyntheticFocusEvent-test.js +++ b/packages/react-dom/src/events/__tests__/SyntheticFocusEvent-test.js @@ -9,13 +9,15 @@ describe('SyntheticFocusEvent', () => { let React; - let ReactDOM; + let ReactDOMClient; + let act; let container; beforeEach(() => { jest.resetModules(); React = require('react'); - ReactDOM = require('react-dom'); + ReactDOMClient = require('react-dom/client'); + act = require('internal-test-utils').act; container = document.createElement('div'); document.body.appendChild(container); @@ -26,44 +28,54 @@ describe('SyntheticFocusEvent', () => { container = null; }); - test('onFocus events have the focus type', () => { + test('onFocus events have the focus type', async () => { const log = []; - ReactDOM.render( -