Add jest snapshot testing

This commit is contained in:
Eric Fischer
2018-06-12 16:37:39 -04:00
committed by Kshitij Sobti
parent 4b4a8632bb
commit b7d16b90f8
11 changed files with 3253 additions and 25 deletions

View File

@@ -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();
});

View File

@@ -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>
`;