Skip to content

Commit

Permalink
Remove ReactTestUtils from refs-destruction-test
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Silbermann committed Mar 9, 2024
1 parent 850fac4 commit b851dbf
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions packages/react-dom/src/__tests__/refs-destruction-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
let React;
let ReactDOM;
let ReactDOMClient;
let ReactTestUtils;
let TestComponent;
let act;
let theInnerDivRef;
Expand All @@ -25,7 +24,6 @@ describe('refs-destruction', () => {
React = require('react');
ReactDOM = require('react-dom');
ReactDOMClient = require('react-dom/client');
ReactTestUtils = require('react-dom/test-utils');
act = require('internal-test-utils').act;

class ClassComponent extends React.Component {
Expand Down Expand Up @@ -75,7 +73,7 @@ describe('refs-destruction', () => {
root.render(<TestComponent />);
});

expect(ReactTestUtils.isDOMComponent(theInnerDivRef.current)).toBe(true);
expect(theInnerDivRef.current).toBeInstanceOf(Element);
expect(theInnerClassComponentRef.current).toBeTruthy();

root.unmount();
Expand All @@ -91,7 +89,7 @@ describe('refs-destruction', () => {
root.render(<TestComponent />);
});

expect(ReactTestUtils.isDOMComponent(theInnerDivRef.current)).toBe(true);
expect(theInnerDivRef.current).toBeInstanceOf(Element);
expect(theInnerClassComponentRef.current).toBeTruthy();

await act(async () => {
Expand All @@ -109,7 +107,7 @@ describe('refs-destruction', () => {
root.render(<TestComponent />);
});

expect(ReactTestUtils.isDOMComponent(theInnerDivRef.current)).toBe(true);
expect(theInnerDivRef.current).toBeInstanceOf(Element);
expect(theInnerClassComponentRef.current).toBeTruthy();

await act(async () => {
Expand Down

0 comments on commit b851dbf

Please sign in to comment.