diff --git a/packages/react-dom/src/events/plugins/__tests__/EnterLeaveEventPlugin-test.js b/packages/react-dom/src/events/plugins/__tests__/EnterLeaveEventPlugin-test.js index f6a9232e87c62..569a29a22a5b8 100644 --- a/packages/react-dom/src/events/plugins/__tests__/EnterLeaveEventPlugin-test.js +++ b/packages/react-dom/src/events/plugins/__tests__/EnterLeaveEventPlugin-test.js @@ -11,6 +11,8 @@ let React; let ReactDOM; +let ReactDOMClient; +let act; describe('EnterLeaveEventPlugin', () => { let container; @@ -20,6 +22,8 @@ describe('EnterLeaveEventPlugin', () => { React = require('react'); ReactDOM = require('react-dom'); + ReactDOMClient = require('react-dom/client'); + act = require('internal-test-utils').act; // The container has to be attached for events to fire. container = document.createElement('div'); @@ -31,7 +35,7 @@ describe('EnterLeaveEventPlugin', () => { container = null; }); - it('should set onMouseLeave relatedTarget properly in iframe', () => { + it('should set onMouseLeave relatedTarget properly in iframe', async () => { const iframe = document.createElement('iframe'); container.appendChild(iframe); const iframeDocument = iframe.contentDocument; @@ -41,30 +45,36 @@ describe('EnterLeaveEventPlugin', () => { iframeDocument.close(); const leaveEvents = []; - const node = ReactDOM.render( -