Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('should return a snapshot with className prop', () => {
const TestComponent = () => <div>Test</div>;
const snapshot = TestUtils.renderToSnapshot();
if (usingJest) {
expect(snapshot).toMatchSnapshot();
} else {
expect(snapshot.props.className).toBe('test');
}
});
it('Should render fragment from component root', () => {
class Comp extends Component {
render() {
return <>{this.props.children};
}
}
expect(
renderToSnapshot(
<div>1</div>
)
).toMatchSnapshot();
});