forked from BloomTech-Labs/deprecated-30-story-squad-fe-a
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRenderDrawing.test.js
43 lines (38 loc) · 1.29 KB
/
RenderDrawing.test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import React from 'react';
import { configure, shallow } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
import { cleanup } from '@testing-library/react';
import { Button } from 'antd';
import { RenderDrawingSub } from '../components/pages/DrawingSub/RenderDrawingSub';
import InstructionsModal from '../components/common/InstructionsModal';
import Header from '../components/common/Header';
configure({ adapter: new Adapter() });
afterEach(() => {
cleanup();
});
jest.mock('react-router-dom', () => ({
useHistory: () => ({
push: jest.fn(),
}),
}));
describe('<RenderDrawingSub />', () => {
let wrapper;
it('Should render <SubmissionModal />', () => {
wrapper = shallow(
<RenderDrawingSub instructions={() => {}} tasks={{ story: {} }} />
);
wrapper.setProps({ instructions: { inst: '' } });
expect(wrapper.find(InstructionsModal)).toHaveLength(1);
});
it('Should render <Header />', () => {
wrapper = shallow(
<RenderDrawingSub title={() => {}} tasks={{ story: {} }} />
);
wrapper.setProps({ title: { title: '' } });
expect(wrapper.find(Header)).toHaveLength(1);
});
it('should render a Button in the antD form', () => {
wrapper = shallow(<RenderDrawingSub tasks={{ story: {} }} />);
expect(wrapper.find(Button));
});
});