-
Notifications
You must be signed in to change notification settings - Fork 85
/
Copy pathmockedFeedbackColumn.tsx
157 lines (153 loc) · 4.67 KB
/
mockedFeedbackColumn.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
import { mocked } from 'jest-mock';
import { WorkflowPhase } from '../../../interfaces/workItem';
export const testTeamId = "mocked-team-uuid";
export const testBoardId = "mocked-board-uuid";
export const testWorkItemType = mocked({
_links: [],
color: '#cc293d',
description: 'Test Work Item Type Description',
fieldInstances: [],
fields: [],
icon: {
id: "mocked-column-uuid",
url: ''
},
isDisabled: true,
name: 'Test Work Item Type Name',
referenceName: 'Test Work Item Type Reference Name',
states: [],
transitions: {},
url: '',
xmlForm: '',
});
export const testColumnUuidOne = "mocked-column-uuid-one";
export const testColumnUuidTwo = "mocked-column-uuid-two";
export const testColumnTwoTitle = 'Test Feedback Column Two';
export const testUpvotes = Math.floor(Math.random() * 10);
export const testGroupedItemProps = mocked({
groupedCount: 0,
isGroupExpanded: false,
isMainItem: true,
parentItemId: '',
setIsGroupBeingDragged: jest.fn(() => { }),
toggleGroupExpand: jest.fn(() => { }),
updateGroupCardStackHeight: jest.fn(() => { }),
});
export const testFeedbackItem = mocked({
id: "mocked-feedback-item-uuid",
element: mocked({
innerText: 'Test Inner Text',
innerHtml: '<div>Test Inner HTML</div>'
}),
boardId: testBoardId,
title: 'Test Feedback Item',
description: 'Test Feedback Item Description',
columnId: testColumnUuidOne,
originalColumnId: testColumnUuidOne,
upvotes: testUpvotes,
voteCollection: { ["vote-collection-uuid"]: testUpvotes },
createdDate: new Date(),
createdByProfileImage: 'testProfileImageSource',
groupedItemProps: testGroupedItemProps,
userIdRef: "user-ref-uuid",
timerSecs: Math.floor(Math.random() * 60),
timerstate: false,
timerId: "timer-uuid",
groupTitles: ['example one', 'example two'],
isGroupedCarouselItem: false,
});
export const testColumnItem = mocked({
feedbackItem: testFeedbackItem,
actionItems: [],
newlyCreated: false,
showAddedAnimation: false,
shouldHaveFocus: false,
hideFeedbackItems: false,
});
export const testColumnIds: string[] = [testColumnUuidOne, testColumnUuidTwo];
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export const testColumnsObj: any = {};
testColumnsObj[testColumnUuidOne] = {
columnProperties:
{
id: testColumnUuidOne,
title: 'Test Feedback Column One',
iconClass: 'far fa-smile',
accentColor: '#008000',
},
columnItems:
[
{
feedbackItem: testFeedbackItem,
actionItems: []
},
]
};
testColumnsObj[testColumnUuidTwo] = {
columnProperties:
{
id: testColumnUuidTwo,
title: testColumnTwoTitle,
iconClass: 'far fa-smile',
accentColor: '#008100',
},
columnItems: []
};
export const testColumns = mocked(testColumnsObj);
export const testColumnProps = mocked({
columns: testColumns,
columnIds: testColumnIds,
columnName: testColumns[testColumnUuidOne].columnProperties.title,
columnId: testColumnUuidOne,
originalColumnId: testColumnUuidOne,
accentColor: testColumns[testColumnUuidOne].columnProperties.accentColor,
iconClass: testColumns[testColumnUuidOne].columnProperties.iconClass,
workflowPhase: WorkflowPhase.Act,
isDataLoaded: false,
columnItems: testColumns[testColumnUuidOne].columnItems,
team: {
id: "team-uuid",
identity: {
customDisplayName: 'Test Web API Identity Custom Display Name',
descriptor: {
identifier: 'Test Identifier',
identityType: 'Test Identity Type'
},
id: "team-identity-uuid",
isActive: true,
isContainer: false,
masterId: "team-identity-master-uuid",
memberIds: [],
memberOf: [],
members: [],
metaTypeId: 5,
properties: [],
providerDisplayName: 'Test Web API Identity Provider Display Name',
resourceVersion: 10,
socialDescriptor: 'Test Social Descriptor',
subjectDescriptor: 'Test Subject Descriptor',
uniqueUserId: 500,
},
name: 'Test Web API Team Name',
description: 'Test Web API Team Description',
identityUrl: '',
projectId: "project-uuid",
projectName: 'Test Azure DevOps Retrospectives Extension',
url: ''
},
boardId: testBoardId,
boardTitle: 'Test Feedback Board',
defaultActionItemIteration: testTeamId,
defaultActionItemAreaPath: testTeamId,
nonHiddenWorkItemTypes: [testWorkItemType],
allWorkItemTypes: [testWorkItemType],
isBoardAnonymous: false,
shouldFocusOnCreateFeedback: false,
hideFeedbackItems: false,
groupTitles: ['example one', 'example two'],
isFocusModalHidden: false,
onVoteCasted: jest.fn(() => { }),
addFeedbackItems: jest.fn(() => { }),
removeFeedbackItemFromColumn: jest.fn(() => { }),
refreshFeedbackItems: jest.fn(() => { }),
});