Example:
const Component1 = () => <div>Foo</div>;
class Component2 extends React.Component {
render() {
return (
<div>Foo</div>
);
}
}
const instance = ReactTestUtils.renderIntoDocument(<Component1 />);
const div = ReactTestUtils.findRenderedDOMComponentWithTag(
instance, 'DIV'
);
expect(div).to.exist;
This works with Component2 but not with Component1.
Example:
This works with
Component2but not withComponent1.