2017-09-07 12:25:54 +03:00
|
|
|
/**
|
|
|
|
* @jest-environment jsdom
|
|
|
|
*/
|
|
|
|
|
|
|
|
import React from 'react';
|
|
|
|
import ShallowRenderer from 'react-test-renderer/shallow';
|
|
|
|
import 'jest-styled-components';
|
|
|
|
import { Store } from '../../mocks';
|
|
|
|
import { reduxForm } from 'redux-form';
|
|
|
|
|
|
|
|
import { Manifest } from '@components/manifest';
|
|
|
|
|
|
|
|
const ManifestTestForm = reduxForm({ form: 'ManifestTestForm' })(Manifest);
|
|
|
|
|
|
|
|
it('renders <Manifest /> without throwing', () => {
|
|
|
|
const renderer = new ShallowRenderer();
|
|
|
|
renderer.render(
|
|
|
|
<Store>
|
|
|
|
<ManifestTestForm
|
|
|
|
defaultValue="test"
|
|
|
|
handleSubmit={() => {}}
|
|
|
|
onCancel={() => {}}
|
|
|
|
dirty
|
|
|
|
loading
|
|
|
|
/>
|
|
|
|
</Store>
|
|
|
|
);
|
|
|
|
const tree = renderer.getRenderOutput();
|
|
|
|
expect(tree).toMatchSnapshot();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('renders <Manifest /> without throwing', () => {
|
|
|
|
const renderer = new ShallowRenderer();
|
|
|
|
renderer.render(
|
2017-09-07 18:29:41 +03:00
|
|
|
<Store>
|
|
|
|
<ManifestTestForm
|
|
|
|
defaultValue="test"
|
|
|
|
handleSubmit={() => {}}
|
|
|
|
onCancel={() => {}}
|
|
|
|
loading
|
|
|
|
/>
|
|
|
|
</Store>
|
|
|
|
);
|
2017-09-07 12:25:54 +03:00
|
|
|
const tree = renderer.getRenderOutput();
|
|
|
|
expect(tree).toMatchSnapshot();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('renders <Manifest /> without throwing', () => {
|
|
|
|
const renderer = new ShallowRenderer();
|
|
|
|
renderer.render(
|
2017-09-07 18:29:41 +03:00
|
|
|
<Store>
|
|
|
|
<ManifestTestForm
|
|
|
|
defaultValue="test"
|
|
|
|
handleSubmit={() => {}}
|
|
|
|
onCancel={() => {}}
|
|
|
|
/>
|
|
|
|
</Store>
|
|
|
|
);
|
2017-09-07 12:25:54 +03:00
|
|
|
const tree = renderer.getRenderOutput();
|
|
|
|
expect(tree).toMatchSnapshot();
|
|
|
|
});
|