Skip to content

Commit 08d035b

Browse files
authored
Remove Shallow Renderer Tests (#25475)
1 parent a8c16a0 commit 08d035b

File tree

5 files changed

+0
-3655
lines changed

5 files changed

+0
-3655
lines changed

packages/react-dom/src/__tests__/ReactTestUtils-test.js

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
'use strict';
1111

12-
import ReactShallowRenderer from 'react-test-renderer/shallow';
1312
import * as React from 'react';
1413
import * as ReactDOM from 'react-dom';
1514
import * as ReactDOMServer from 'react-dom/server';
@@ -383,48 +382,6 @@ describe('ReactTestUtils', () => {
383382
);
384383
});
385384

386-
it('should throw when attempting to use a React element', () => {
387-
class SomeComponent extends React.Component {
388-
render() {
389-
return <div onClick={this.props.handleClick}>hello, world.</div>;
390-
}
391-
}
392-
393-
const handler = jest.fn().mockName('spy');
394-
const shallowRenderer = ReactShallowRenderer.createRenderer();
395-
const result = shallowRenderer.render(
396-
<SomeComponent handleClick={handler} />,
397-
);
398-
399-
expect(() => ReactTestUtils.Simulate.click(result)).toThrowError(
400-
'TestUtils.Simulate expected a DOM node as the first argument but received ' +
401-
'a React element. Pass the DOM node you wish to simulate the event on instead. ' +
402-
'Note that TestUtils.Simulate will not work if you are using shallow rendering.',
403-
);
404-
expect(handler).not.toHaveBeenCalled();
405-
});
406-
407-
it('should throw when attempting to use a component instance', () => {
408-
class SomeComponent extends React.Component {
409-
render() {
410-
return <div onClick={this.props.handleClick}>hello, world.</div>;
411-
}
412-
}
413-
414-
const handler = jest.fn().mockName('spy');
415-
const container = document.createElement('div');
416-
const instance = ReactDOM.render(
417-
<SomeComponent handleClick={handler} />,
418-
container,
419-
);
420-
421-
expect(() => ReactTestUtils.Simulate.click(instance)).toThrowError(
422-
'TestUtils.Simulate expected a DOM node as the first argument but received ' +
423-
'a component instance. Pass the DOM node you wish to simulate the event on instead.',
424-
);
425-
expect(handler).not.toHaveBeenCalled();
426-
});
427-
428385
it('should not warn when used with extra properties', () => {
429386
const CLIENT_X = 100;
430387

0 commit comments

Comments
 (0)