Updated jest for frontend

This commit is contained in:
Jori Lallo
2017-05-22 23:51:16 -07:00
parent 2a8cc80a86
commit 4c8df3231d
6 changed files with 648 additions and 466 deletions

View File

@@ -1,7 +1,5 @@
/* eslint-disable */
import React from 'react';
import { snap } from 'utils/testUtils';
import Alert from '.';
test('renders default as info', () => {

View File

@@ -0,0 +1,51 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`renders danger 1`] = `
<Flex
align="center"
className="container danger"
justify="center"
>
danger
</Flex>
`;
exports[`renders default as info 1`] = `
<Flex
align="center"
className="container info"
justify="center"
>
default
</Flex>
`;
exports[`renders info 1`] = `
<Flex
align="center"
className="container info"
justify="center"
>
info
</Flex>
`;
exports[`renders success 1`] = `
<Flex
align="center"
className="container success"
justify="center"
>
success
</Flex>
`;
exports[`renders warning 1`] = `
<Flex
align="center"
className="container warning"
justify="center"
>
warning
</Flex>
`;

View File

@@ -0,0 +1,11 @@
/* eslint-disable */
import React from 'react';
import { shallow } from 'enzyme';
import toJson from 'enzyme-to-json';
const snap = children => {
const wrapper = shallow(children);
expect(toJson(wrapper)).toMatchSnapshot();
};
global.snap = snap;

View File

@@ -1,10 +0,0 @@
/* eslint-disable */
import React from 'react';
import renderer from 'react-test-renderer';
const snap = children => {
const component = renderer.create(children);
expect(component).toMatchSnapshot();
};
export { snap };