Skip to content

Commit b851dbf

Browse files
author
Sebastian Silbermann
committed
Remove ReactTestUtils from refs-destruction-test
1 parent 850fac4 commit b851dbf

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

packages/react-dom/src/__tests__/refs-destruction-test.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
let React;
1313
let ReactDOM;
1414
let ReactDOMClient;
15-
let ReactTestUtils;
1615
let TestComponent;
1716
let act;
1817
let theInnerDivRef;
@@ -25,7 +24,6 @@ describe('refs-destruction', () => {
2524
React = require('react');
2625
ReactDOM = require('react-dom');
2726
ReactDOMClient = require('react-dom/client');
28-
ReactTestUtils = require('react-dom/test-utils');
2927
act = require('internal-test-utils').act;
3028

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

78-
expect(ReactTestUtils.isDOMComponent(theInnerDivRef.current)).toBe(true);
76+
expect(theInnerDivRef.current).toBeInstanceOf(Element);
7977
expect(theInnerClassComponentRef.current).toBeTruthy();
8078

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

94-
expect(ReactTestUtils.isDOMComponent(theInnerDivRef.current)).toBe(true);
92+
expect(theInnerDivRef.current).toBeInstanceOf(Element);
9593
expect(theInnerClassComponentRef.current).toBeTruthy();
9694

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

112-
expect(ReactTestUtils.isDOMComponent(theInnerDivRef.current)).toBe(true);
110+
expect(theInnerDivRef.current).toBeInstanceOf(Element);
113111
expect(theInnerClassComponentRef.current).toBeTruthy();
114112

115113
await act(async () => {

0 commit comments

Comments
 (0)