@reltio/components 1.4.2027 → 1.4.2028
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/features/crosswalks/CrosswalkRow/DndCrosswalkRow.test.js +0 -1
- package/cjs/features/graph/SigmaGraphContainer/SigmaGraphContainer.test.js +5 -14
- package/cjs/features/graph/SigmaGraphResizer/SigmaGraphResizer.test.js +11 -9
- package/cjs/features/graph/ZoomSlider/ZoomSlider.js +2 -2
- package/cjs/features/graph/ZoomSlider/ZoomSlider.test.js +85 -37
- package/cjs/features/history/DateRangeSelector/DateRangeSelector.specs.js +188 -117
- package/cjs/features/history/HistoryFilterButton/HistoryFilterButton.js +1 -1
- package/cjs/features/history/HistoryGraph/components/HistoryCircle/HistoryCircle.specs.js +38 -41
- package/cjs/features/history/HistoryGraph/components/HistoryLink/HistoryLink.specs.js +17 -16
- package/cjs/features/history/HistoryHeader/HistoryHeader.spec.js +21 -31
- package/cjs/features/history/HistoryPanelEmptyState/HistoryPanelEmptyState.specs.js +4 -9
- package/cjs/features/history/HistoryRow/HistoryRow.js +1 -1
- package/cjs/features/history/HistoryRow/HistoryRow.specs.js +74 -34
- package/cjs/features/history/HistoryTree/HistoryTree.js +1 -1
- package/cjs/features/history/HistoryView/HistoryView.specs.js +77 -43
- package/cjs/features/workflow/AddWorkflowButton/AddWorkflowButton.spec.js +83 -34
- package/cjs/features/workflow/AttributesChanges/AttributesChanges.js +1 -1
- package/cjs/features/workflow/AttributesChanges/components/ChangeView/ChangeView.js +1 -1
- package/cjs/features/workflow/AttributesChanges/components/ShowMoreLink/ShowMoreLink.spec.js +81 -24
- package/cjs/features/workflow/DueDateField/DueDateField.spec.js +51 -102
- package/cjs/features/workflow/PrioritySelector/PrioritySelector.spec.js +62 -133
- package/cjs/features/workflow/WorkflowTaskCard/components/DataChangeRequestTaskCard/DataChangeRequestTaskCard.spec.js +438 -124
- package/cjs/features/workflow/hooks/useChangeRequest.specs.js +17 -27
- package/cjs/features/workflow/hooks/useWorkflowColor.specs.js +23 -47
- package/features/crosswalks/CrosswalkRow/DndCrosswalkRow.test.js +0 -1
- package/features/graph/SigmaGraphContainer/SigmaGraphContainer.test.js +5 -14
- package/features/graph/SigmaGraphResizer/SigmaGraphResizer.test.js +11 -9
- package/features/graph/ZoomSlider/ZoomSlider.js +2 -2
- package/features/graph/ZoomSlider/ZoomSlider.test.js +85 -37
- package/features/history/DateRangeSelector/DateRangeSelector.specs.js +188 -117
- package/features/history/HistoryFilterButton/HistoryFilterButton.js +1 -1
- package/features/history/HistoryGraph/components/HistoryCircle/HistoryCircle.specs.js +38 -41
- package/features/history/HistoryGraph/components/HistoryLink/HistoryLink.specs.js +17 -16
- package/features/history/HistoryHeader/HistoryHeader.spec.js +21 -31
- package/features/history/HistoryPanelEmptyState/HistoryPanelEmptyState.specs.js +4 -9
- package/features/history/HistoryRow/HistoryRow.js +1 -1
- package/features/history/HistoryRow/HistoryRow.specs.js +74 -34
- package/features/history/HistoryTree/HistoryTree.js +1 -1
- package/features/history/HistoryView/HistoryView.specs.js +77 -43
- package/features/workflow/AddWorkflowButton/AddWorkflowButton.spec.js +83 -34
- package/features/workflow/AttributesChanges/AttributesChanges.js +1 -1
- package/features/workflow/AttributesChanges/components/ChangeView/ChangeView.js +1 -1
- package/features/workflow/AttributesChanges/components/ShowMoreLink/ShowMoreLink.spec.js +81 -24
- package/features/workflow/DueDateField/DueDateField.spec.js +51 -102
- package/features/workflow/PrioritySelector/PrioritySelector.spec.js +62 -133
- package/features/workflow/WorkflowTaskCard/components/DataChangeRequestTaskCard/DataChangeRequestTaskCard.spec.js +439 -125
- package/features/workflow/hooks/useChangeRequest.specs.js +17 -24
- package/features/workflow/hooks/useWorkflowColor.specs.js +23 -44
- package/package.json +1 -1
- package/cjs/features/workflow/AttributesChanges/AttributesChanges.spec.d.ts +0 -1
- package/cjs/features/workflow/AttributesChanges/AttributesChanges.spec.js +0 -249
- package/cjs/features/workflow/AttributesChanges/components/ChangeView/ChangeView.spec.d.ts +0 -1
- package/cjs/features/workflow/AttributesChanges/components/ChangeView/ChangeView.spec.js +0 -44
- package/cjs/features/workflow/AttributesChanges/components/DCRChangesList/DCRChangesList.spec.d.ts +0 -1
- package/cjs/features/workflow/AttributesChanges/components/DCRChangesList/DCRChangesList.spec.js +0 -38
- package/cjs/features/workflow/AttributesChanges/components/DiffRenderer/DiffRenderer.spec.d.ts +0 -1
- package/cjs/features/workflow/AttributesChanges/components/DiffRenderer/DiffRenderer.spec.js +0 -218
- package/features/workflow/AttributesChanges/AttributesChanges.spec.d.ts +0 -1
- package/features/workflow/AttributesChanges/AttributesChanges.spec.js +0 -244
- package/features/workflow/AttributesChanges/components/ChangeView/ChangeView.spec.d.ts +0 -1
- package/features/workflow/AttributesChanges/components/ChangeView/ChangeView.spec.js +0 -39
- package/features/workflow/AttributesChanges/components/DCRChangesList/DCRChangesList.spec.d.ts +0 -1
- package/features/workflow/AttributesChanges/components/DCRChangesList/DCRChangesList.spec.js +0 -33
- package/features/workflow/AttributesChanges/components/DiffRenderer/DiffRenderer.spec.d.ts +0 -1
- package/features/workflow/AttributesChanges/components/DiffRenderer/DiffRenderer.spec.js +0 -213
|
@@ -1,213 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
import React from 'react';
|
|
13
|
-
import { ReactWrapper, shallow, mount } from 'enzyme';
|
|
14
|
-
import { ChangeView } from '../ChangeView';
|
|
15
|
-
import { DCRTypes, DCROperationTypes } from '@reltio/mdm-sdk';
|
|
16
|
-
import { DataTypeValue } from '../../../../../DataTypeValue';
|
|
17
|
-
import { EntityUriLink } from '../../../../../EntityUriLink';
|
|
18
|
-
import { useMdmEntityUri } from '../../../../../contexts/MdmModuleContext';
|
|
19
|
-
import { AttributesChangesContext } from '../../AttributesChangesContext';
|
|
20
|
-
import { DiffRenderer } from './DiffRenderer';
|
|
21
|
-
jest.mock('../../../../../EntityUriLink', function () { return ({
|
|
22
|
-
EntityUriLink: function (_a) {
|
|
23
|
-
var children = _a.children;
|
|
24
|
-
return React.createElement("div", null, children);
|
|
25
|
-
}
|
|
26
|
-
}); });
|
|
27
|
-
jest.mock('../../../../../contexts/MdmModuleContext', function () { return (__assign(__assign({}, jest.requireActual('../../../../../contexts/MdmModuleContext')), { useMdmEntityUri: jest.fn() })); });
|
|
28
|
-
describe('DiffRenderer tests', function () {
|
|
29
|
-
beforeEach(function () {
|
|
30
|
-
useMdmEntityUri.mockReturnValue('entities/1hRTSKE5');
|
|
31
|
-
});
|
|
32
|
-
it('should render ChangeView with props for change', function () {
|
|
33
|
-
var props = {
|
|
34
|
-
level: 0,
|
|
35
|
-
label: 'Customer Type',
|
|
36
|
-
attributeType: {
|
|
37
|
-
label: 'Customer Type',
|
|
38
|
-
name: 'TypeCode',
|
|
39
|
-
type: 'String',
|
|
40
|
-
uri: 'configuration/entityTypes/HCA/attributes/TypeCode',
|
|
41
|
-
dependentLookupCode: 'HCA_TYP_CD'
|
|
42
|
-
},
|
|
43
|
-
oldValue: {
|
|
44
|
-
lookupCode: 'ACIN',
|
|
45
|
-
lookupRawValue: 'ACIN',
|
|
46
|
-
value: 'academic institution'
|
|
47
|
-
},
|
|
48
|
-
newValue: {
|
|
49
|
-
lookupCode: 'BUOR',
|
|
50
|
-
lookupRawValue: 'BUOR',
|
|
51
|
-
value: 'buying organisation'
|
|
52
|
-
},
|
|
53
|
-
operation: DCROperationTypes.EDITED
|
|
54
|
-
};
|
|
55
|
-
var component = shallow(React.createElement(DiffRenderer, __assign({}, props)));
|
|
56
|
-
var changeView = component.find(ChangeView);
|
|
57
|
-
expect(changeView).toHaveLength(1);
|
|
58
|
-
expect(new ReactWrapper(changeView.prop('label')).text()).toBe(props.label);
|
|
59
|
-
var oldValue = new ReactWrapper(changeView.prop('oldValue'));
|
|
60
|
-
expect(oldValue.find(DataTypeValue)).toHaveLength(1);
|
|
61
|
-
expect(oldValue.find(DataTypeValue).text()).toBe("".concat(props.oldValue.value, " (").concat(props.oldValue.lookupCode, ")"));
|
|
62
|
-
var newValue = new ReactWrapper(changeView.prop('newValue'));
|
|
63
|
-
expect(newValue.find(DataTypeValue)).toHaveLength(1);
|
|
64
|
-
expect(newValue.find(DataTypeValue).text()).toBe("".concat(props.newValue.value, " (").concat(props.newValue.lookupCode, ")"));
|
|
65
|
-
expect(changeView.prop('operation')).toBe(props.operation);
|
|
66
|
-
});
|
|
67
|
-
it('should render label for Nested attribute', function () {
|
|
68
|
-
var props = {
|
|
69
|
-
level: 1,
|
|
70
|
-
label: 'Additional Attributes',
|
|
71
|
-
attributeType: {
|
|
72
|
-
label: 'Additional Attributes',
|
|
73
|
-
name: 'AdditionalAttributes',
|
|
74
|
-
type: 'Nested',
|
|
75
|
-
uri: 'configuration/relationTypes/HasAddress/attributes/AdditionalAttributes'
|
|
76
|
-
},
|
|
77
|
-
attributeValue: {
|
|
78
|
-
id: 'uri$$1643529639079',
|
|
79
|
-
value: {
|
|
80
|
-
id: '58dpOzAR',
|
|
81
|
-
attributePath: 'AdditionalAttributes',
|
|
82
|
-
attributeType: 'configuration/relationTypes/HasAddress/attributes/AdditionalAttributes',
|
|
83
|
-
newValue: {
|
|
84
|
-
value: {
|
|
85
|
-
AttributeType: [{ value: 'testType' }],
|
|
86
|
-
AttributeValue: [{ value: 'testValue' }]
|
|
87
|
-
},
|
|
88
|
-
refAttributeType: 'configuration/entityTypes/HCA/attributes/Address/attributes/AdditionalAttributes',
|
|
89
|
-
refObjectURI: 'relations/138xt4Lu',
|
|
90
|
-
type: DCRTypes.INSERT_ATTRIBUTE
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
var component = shallow(React.createElement(DiffRenderer, __assign({}, props)));
|
|
96
|
-
var changeView = component.find(ChangeView);
|
|
97
|
-
expect(changeView).toHaveLength(1);
|
|
98
|
-
expect(new ReactWrapper(changeView.prop('label')).text()).toBe(props.label);
|
|
99
|
-
expect(changeView.prop('oldValue')).toBeUndefined();
|
|
100
|
-
expect(changeView.prop('newValue')).toBeUndefined();
|
|
101
|
-
expect(changeView.prop('operation')).toBeUndefined();
|
|
102
|
-
});
|
|
103
|
-
it('should render label for new Reference attribute', function () {
|
|
104
|
-
var _a;
|
|
105
|
-
var entityUri = 'entities/1dmAvgmV';
|
|
106
|
-
var props = {
|
|
107
|
-
level: 0,
|
|
108
|
-
label: 'Address',
|
|
109
|
-
attributeType: {
|
|
110
|
-
label: 'Address',
|
|
111
|
-
name: 'Address',
|
|
112
|
-
referencedEntityTypeURI: 'configuration/entityTypes/Location',
|
|
113
|
-
type: 'Reference',
|
|
114
|
-
uri: 'configuration/entityTypes/HCA/attributes/Address'
|
|
115
|
-
},
|
|
116
|
-
attributeValue: {
|
|
117
|
-
id: 'uri$$1643535595616',
|
|
118
|
-
value: {
|
|
119
|
-
id: '4jHUANlF',
|
|
120
|
-
attributePath: 'Address',
|
|
121
|
-
attributeType: 'configuration/entityTypes/HCA/attributes/Address',
|
|
122
|
-
newValue: {
|
|
123
|
-
refEntity: { objectURI: entityUri },
|
|
124
|
-
value: {
|
|
125
|
-
AddressType: [{ value: '' }]
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
};
|
|
131
|
-
var objectsInfo = (_a = {},
|
|
132
|
-
_a[entityUri] = {
|
|
133
|
-
isExist: true,
|
|
134
|
-
label: 'Santa Clara',
|
|
135
|
-
secondaryLabel: '',
|
|
136
|
-
type: 'configuration/entityTypes/Location'
|
|
137
|
-
},
|
|
138
|
-
_a['entities/1hRTSKE5'] = {
|
|
139
|
-
isExist: true,
|
|
140
|
-
label: '12345 - Address Line 1 City',
|
|
141
|
-
secondaryLabel: '12345',
|
|
142
|
-
type: 'configuration/entityTypes/HCA'
|
|
143
|
-
},
|
|
144
|
-
_a);
|
|
145
|
-
var component = mount(React.createElement(AttributesChangesContext.Provider, { value: objectsInfo },
|
|
146
|
-
React.createElement(DiffRenderer, __assign({}, props))));
|
|
147
|
-
var changeView = component.find(ChangeView);
|
|
148
|
-
expect(changeView).toHaveLength(1);
|
|
149
|
-
var label = new ReactWrapper(changeView.prop('label'));
|
|
150
|
-
expect(label.text()).toBe("".concat(props.label).concat(objectsInfo[entityUri].label));
|
|
151
|
-
expect(label.find(EntityUriLink).prop('value')).toBe(entityUri);
|
|
152
|
-
expect(changeView.prop('oldValue')).toBeUndefined();
|
|
153
|
-
expect(changeView.prop('newValue')).toBeUndefined();
|
|
154
|
-
expect(changeView.prop('operation')).toBeUndefined();
|
|
155
|
-
});
|
|
156
|
-
it('should render label for existing Reference attribute', function () {
|
|
157
|
-
var _a;
|
|
158
|
-
var entityUri = 'entities/1hRTSKE5';
|
|
159
|
-
var relationUri = 'relations/YduMTVk';
|
|
160
|
-
var props = {
|
|
161
|
-
level: 0,
|
|
162
|
-
label: 'Address',
|
|
163
|
-
attributeType: {
|
|
164
|
-
label: 'Address',
|
|
165
|
-
name: 'Address',
|
|
166
|
-
referencedEntityTypeURI: 'configuration/entityTypes/Location',
|
|
167
|
-
type: 'Reference',
|
|
168
|
-
uri: 'configuration/entityTypes/HCA/attributes/Address'
|
|
169
|
-
},
|
|
170
|
-
attributeValue: {
|
|
171
|
-
id: 'YduMTVk',
|
|
172
|
-
refObjectURI: relationUri,
|
|
173
|
-
value: {
|
|
174
|
-
Phone: [
|
|
175
|
-
{
|
|
176
|
-
id: 'uri$$1643534611142',
|
|
177
|
-
value: {
|
|
178
|
-
id: 'Apethebi',
|
|
179
|
-
newValue: { value: { Active: [{ value: 'false' }] } }
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
]
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
};
|
|
186
|
-
var objectsInfo = (_a = {},
|
|
187
|
-
_a[entityUri] = {
|
|
188
|
-
isExist: true,
|
|
189
|
-
label: '12345 - Address Line 1 City',
|
|
190
|
-
secondaryLabel: '12345',
|
|
191
|
-
type: 'configuration/entityTypes/HCA'
|
|
192
|
-
},
|
|
193
|
-
_a[relationUri] = {
|
|
194
|
-
endObjectLabel: 'Address Line 1 City Zip6',
|
|
195
|
-
endObjectUri: 'entities/brJPdnD',
|
|
196
|
-
isExist: true,
|
|
197
|
-
startObjectLabel: '12345 - Address Line 1 City',
|
|
198
|
-
startObjectUri: entityUri,
|
|
199
|
-
type: 'configuration/relationTypes/HasAddress'
|
|
200
|
-
},
|
|
201
|
-
_a);
|
|
202
|
-
var component = mount(React.createElement(AttributesChangesContext.Provider, { value: objectsInfo },
|
|
203
|
-
React.createElement(DiffRenderer, __assign({}, props))));
|
|
204
|
-
var changeView = component.find(ChangeView);
|
|
205
|
-
expect(changeView).toHaveLength(1);
|
|
206
|
-
var label = new ReactWrapper(changeView.prop('label'));
|
|
207
|
-
expect(label.text()).toBe("".concat(props.label).concat(objectsInfo[relationUri].endObjectLabel));
|
|
208
|
-
expect(label.find(EntityUriLink).prop('value')).toBe(objectsInfo[relationUri].endObjectUri);
|
|
209
|
-
expect(changeView.prop('oldValue')).toBeUndefined();
|
|
210
|
-
expect(changeView.prop('newValue')).toBeUndefined();
|
|
211
|
-
expect(changeView.prop('operation')).toBeUndefined();
|
|
212
|
-
});
|
|
213
|
-
});
|