-
Notifications
You must be signed in to change notification settings - Fork 85
/
Copy pathactionItem.test.tsx
54 lines (50 loc) · 1.5 KB
/
actionItem.test.tsx
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
44
45
46
47
48
49
50
51
52
53
54
import * as React from "react";
import { shallow } from 'enzyme';
import toJson from "enzyme-to-json";
import ActionItem, { ActionItemProps } from "../actionItem";
const mockOnUpdateActionItem = jest.fn(() => {});
const defaultTestProps: ActionItemProps = {
feedbackItemId: "101",
boardId: "Test Board Id",
nonHiddenWorkItemTypes: [],
allWorkItemTypes: [
{
color: "red",
description: "Test description",
icon: { id: "1", url: "testUrl" },
isDisabled: false,
name: "Test Work Item Type",
referenceName: "Test Reference Name",
fieldInstances: [],
fields: [],
states: [],
transitions: {},
xmlForm: "Test xmlForm",
_links: {},
url: "Test url"
}
],
onUpdateActionItem: mockOnUpdateActionItem,
actionItem: {
_links: {},
url: "Test url",
id: 1,
commentVersionRef: { commentId: 1, version: 1, url: "Test url", createdInRevision: 1, isDeleted: false, text: "Test text" },
relations: [],
rev: 1,
fields: {
"System.Title": "Test Title",
"System.WorkItemType": "Test Work Item Type",
},
},
areActionIconsHidden: false,
shouldFocus: false
};
describe("Action Item component", () => {
it("renders correctly when there are no action items.", () => {
const wrapper = shallow(<ActionItem {...defaultTestProps} /> as any);
const component = wrapper.children().dive();
expect(toJson(component)).toMatchSnapshot();
});
it("renders correctly when action items exist", () => {});
});