Add jest snapshot testing
This commit is contained in:
committed by
Kshitij Sobti
parent
4b4a8632bb
commit
b7d16b90f8
@@ -0,0 +1,9 @@
|
||||
import React from 'react';
|
||||
import Main from './Main.jsx';
|
||||
import renderer from 'react-test-renderer';
|
||||
|
||||
test('My first demo test', () => {
|
||||
const component = renderer.create(<Main></Main>);
|
||||
let tree = component.toJSON();
|
||||
expect(tree).toMatchSnapshot();
|
||||
});
|
||||
@@ -0,0 +1,22 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`My first demo test 1`] = `
|
||||
<div
|
||||
className="problem-browser"
|
||||
>
|
||||
<button
|
||||
className="btn"
|
||||
onBlur={[Function]}
|
||||
onClick={[Function]}
|
||||
onKeyDown={[Function]}
|
||||
type="button"
|
||||
>
|
||||
Select a section or problem
|
||||
</button>
|
||||
<input
|
||||
disabled={true}
|
||||
name="problem-location"
|
||||
type="text"
|
||||
/>
|
||||
</div>
|
||||
`;
|
||||
Reference in New Issue
Block a user