@reltio/components 1.4.2026 → 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/RCTree/styles.js +4 -1
- package/cjs/RCTree/styles.js +4 -1
- 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
|
@@ -45,21 +45,17 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
45
45
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
|
-
import
|
|
49
|
-
import { mount } from 'enzyme';
|
|
48
|
+
import { renderHook } from '@testing-library/react-hooks';
|
|
50
49
|
import { getDataChangeRequest, getEntitiesByUris } from '@reltio/mdm-sdk';
|
|
51
50
|
import { act } from 'react-dom/test-utils';
|
|
52
51
|
import { ErrorPopup } from '../../../ErrorPopup';
|
|
53
52
|
import { useChangeRequest } from './useChangeRequest';
|
|
54
53
|
jest.mock('@reltio/mdm-sdk', function () { return (__assign(__assign({}, jest.requireActual('@reltio/mdm-sdk')), { getDataChangeRequest: jest.fn(), getEntitiesByUris: jest.fn() })); });
|
|
55
54
|
describe('useChangeRequest tests', function () {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
var _b = useChangeRequest(dcrUri), dcr = _b.dcr, groupedObjects = _b.groupedObjects;
|
|
60
|
-
return React.createElement("div", { "data-test": { dcr: dcr, groupedObjects: groupedObjects } });
|
|
55
|
+
var setUp = function (dcrUri) {
|
|
56
|
+
var initialProps = dcrUri;
|
|
57
|
+
return renderHook(useChangeRequest, { initialProps: initialProps });
|
|
61
58
|
};
|
|
62
|
-
var getHooksValues = function (component) { return component.find('TestComponent').childAt(0).prop('data-test'); };
|
|
63
59
|
var resolveChangeRequest, resolveGetEntitiesByUris;
|
|
64
60
|
var dcr = {
|
|
65
61
|
changes: {
|
|
@@ -127,29 +123,29 @@ describe('useChangeRequest tests', function () {
|
|
|
127
123
|
jest.clearAllMocks();
|
|
128
124
|
});
|
|
129
125
|
it('should return empty parameters if dcrUri is null', function () {
|
|
130
|
-
var
|
|
126
|
+
var result = setUp(null).result;
|
|
131
127
|
expect(getDataChangeRequest).toHaveBeenCalledWith(null);
|
|
132
128
|
expect(getEntitiesByUris).not.toHaveBeenCalled();
|
|
133
|
-
expect(
|
|
129
|
+
expect(result.current).toEqual({
|
|
134
130
|
dcr: null,
|
|
135
131
|
groupedObjects: []
|
|
136
132
|
});
|
|
137
133
|
});
|
|
138
134
|
it('should return empty parameters if dcrUri is undefined', function () {
|
|
139
|
-
var
|
|
135
|
+
var result = setUp(undefined).result;
|
|
140
136
|
expect(getDataChangeRequest).toHaveBeenCalledWith(undefined);
|
|
141
137
|
expect(getEntitiesByUris).not.toHaveBeenCalled();
|
|
142
|
-
expect(
|
|
138
|
+
expect(result.current).toEqual({
|
|
143
139
|
dcr: null,
|
|
144
140
|
groupedObjects: []
|
|
145
141
|
});
|
|
146
142
|
});
|
|
147
143
|
it('should go to error message in case of getDataChangeRequest error', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
148
|
-
var
|
|
144
|
+
var result;
|
|
149
145
|
return __generator(this, function (_a) {
|
|
150
146
|
switch (_a.label) {
|
|
151
147
|
case 0:
|
|
152
|
-
|
|
148
|
+
result = setUp('').result;
|
|
153
149
|
return [4 /*yield*/, act(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
154
150
|
return __generator(this, function (_a) {
|
|
155
151
|
resolveChangeRequest(true);
|
|
@@ -158,12 +154,11 @@ describe('useChangeRequest tests', function () {
|
|
|
158
154
|
}); })];
|
|
159
155
|
case 1:
|
|
160
156
|
_a.sent();
|
|
161
|
-
wrapper.update();
|
|
162
157
|
expect(ErrorPopup.addError).toHaveBeenCalledWith({
|
|
163
158
|
title: 'Error',
|
|
164
159
|
message: 'dcrError'
|
|
165
160
|
});
|
|
166
|
-
expect(
|
|
161
|
+
expect(result.current).toEqual({
|
|
167
162
|
dcr: null,
|
|
168
163
|
groupedObjects: []
|
|
169
164
|
});
|
|
@@ -172,11 +167,11 @@ describe('useChangeRequest tests', function () {
|
|
|
172
167
|
});
|
|
173
168
|
}); });
|
|
174
169
|
it('should go to error message in case of getEntitiesByUris error', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
175
|
-
var
|
|
170
|
+
var result;
|
|
176
171
|
return __generator(this, function (_a) {
|
|
177
172
|
switch (_a.label) {
|
|
178
173
|
case 0:
|
|
179
|
-
|
|
174
|
+
result = setUp('testUri').result;
|
|
180
175
|
return [4 /*yield*/, act(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
181
176
|
return __generator(this, function (_a) {
|
|
182
177
|
resolveChangeRequest();
|
|
@@ -193,7 +188,6 @@ describe('useChangeRequest tests', function () {
|
|
|
193
188
|
}); })];
|
|
194
189
|
case 2:
|
|
195
190
|
_a.sent();
|
|
196
|
-
wrapper.update();
|
|
197
191
|
expect(getDataChangeRequest).toHaveBeenCalledWith('testUri');
|
|
198
192
|
expect(getEntitiesByUris).toHaveBeenCalledWith(['entities/10f6JMNk'], {
|
|
199
193
|
defaultMaxValues: 1,
|
|
@@ -203,7 +197,7 @@ describe('useChangeRequest tests', function () {
|
|
|
203
197
|
title: 'Error',
|
|
204
198
|
message: 'entitiesError'
|
|
205
199
|
});
|
|
206
|
-
expect(
|
|
200
|
+
expect(result.current).toEqual({
|
|
207
201
|
dcr: dcr,
|
|
208
202
|
groupedObjects: []
|
|
209
203
|
});
|
|
@@ -212,11 +206,11 @@ describe('useChangeRequest tests', function () {
|
|
|
212
206
|
});
|
|
213
207
|
}); });
|
|
214
208
|
it('should return correct parameters', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
215
|
-
var
|
|
209
|
+
var result;
|
|
216
210
|
return __generator(this, function (_a) {
|
|
217
211
|
switch (_a.label) {
|
|
218
212
|
case 0:
|
|
219
|
-
|
|
213
|
+
result = setUp('testUri').result;
|
|
220
214
|
return [4 /*yield*/, act(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
221
215
|
return __generator(this, function (_a) {
|
|
222
216
|
resolveChangeRequest();
|
|
@@ -233,14 +227,13 @@ describe('useChangeRequest tests', function () {
|
|
|
233
227
|
}); })];
|
|
234
228
|
case 2:
|
|
235
229
|
_a.sent();
|
|
236
|
-
wrapper.update();
|
|
237
230
|
expect(getDataChangeRequest).toHaveBeenCalledWith('testUri');
|
|
238
231
|
expect(getEntitiesByUris).toHaveBeenCalledWith(['entities/10f6JMNk'], {
|
|
239
232
|
defaultMaxValues: 1,
|
|
240
233
|
searchOptions: 'ovOnly'
|
|
241
234
|
});
|
|
242
235
|
expect(ErrorPopup.addError).not.toHaveBeenCalled();
|
|
243
|
-
expect(
|
|
236
|
+
expect(result.current).toEqual({
|
|
244
237
|
dcr: dcr,
|
|
245
238
|
groupedObjects: [
|
|
246
239
|
{
|
|
@@ -1,54 +1,33 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { shallow } from 'enzyme';
|
|
1
|
+
import { renderHook } from '@testing-library/react-hooks';
|
|
3
2
|
import { resetTaskToColor, useWorkflowColor } from './useWorkflowColor';
|
|
4
|
-
//eslint-disable-next-line
|
|
5
|
-
var TestComponent = function (_a) {
|
|
6
|
-
var type = _a.type;
|
|
7
|
-
var color = useWorkflowColor({ processDefinitionDisplayName: type });
|
|
8
|
-
return React.createElement("div", { "data-color": color });
|
|
9
|
-
};
|
|
10
3
|
describe('useWorkflowColor behaviour', function () {
|
|
11
4
|
beforeEach(function () {
|
|
12
5
|
resetTaskToColor();
|
|
13
6
|
});
|
|
7
|
+
var getColor = function (type) {
|
|
8
|
+
var initialProps = { processDefinitionDisplayName: type };
|
|
9
|
+
return renderHook(useWorkflowColor, { initialProps: initialProps }).result.current;
|
|
10
|
+
};
|
|
14
11
|
it('should use same colors for same types', function () {
|
|
15
|
-
|
|
16
|
-
expect(
|
|
17
|
-
|
|
18
|
-
expect(
|
|
19
|
-
component = shallow(React.createElement(TestComponent, { type: "1" }));
|
|
20
|
-
expect(component.prop('data-color')).toBe('#DC057B');
|
|
21
|
-
component = shallow(React.createElement(TestComponent, { type: "2" }));
|
|
22
|
-
expect(component.prop('data-color')).toBe('#5DC003');
|
|
12
|
+
expect(getColor('1')).toBe('#DC057B');
|
|
13
|
+
expect(getColor('2')).toBe('#5DC003');
|
|
14
|
+
expect(getColor('1')).toBe('#DC057B');
|
|
15
|
+
expect(getColor('2')).toBe('#5DC003');
|
|
23
16
|
});
|
|
24
17
|
it('should use colors from beginning if amount of types is greater than amount of colors', function () {
|
|
25
|
-
|
|
26
|
-
expect(
|
|
27
|
-
|
|
28
|
-
expect(
|
|
29
|
-
|
|
30
|
-
expect(
|
|
31
|
-
|
|
32
|
-
expect(
|
|
33
|
-
|
|
34
|
-
expect(
|
|
35
|
-
|
|
36
|
-
expect(
|
|
37
|
-
|
|
38
|
-
expect(
|
|
39
|
-
component = shallow(React.createElement(TestComponent, { type: "8" }));
|
|
40
|
-
expect(component.prop('data-color')).toBe('#BD81BE');
|
|
41
|
-
component = shallow(React.createElement(TestComponent, { type: "9" }));
|
|
42
|
-
expect(component.prop('data-color')).toBe('#5F3577');
|
|
43
|
-
component = shallow(React.createElement(TestComponent, { type: "10" }));
|
|
44
|
-
expect(component.prop('data-color')).toBe('#A68560');
|
|
45
|
-
component = shallow(React.createElement(TestComponent, { type: "11" }));
|
|
46
|
-
expect(component.prop('data-color')).toBe('#555962');
|
|
47
|
-
component = shallow(React.createElement(TestComponent, { type: "12" }));
|
|
48
|
-
expect(component.prop('data-color')).toBe('#DC057B');
|
|
49
|
-
component = shallow(React.createElement(TestComponent, { type: "13" }));
|
|
50
|
-
expect(component.prop('data-color')).toBe('#5DC003');
|
|
51
|
-
component = shallow(React.createElement(TestComponent, { type: "1" }));
|
|
52
|
-
expect(component.prop('data-color')).toBe('#DC057B');
|
|
18
|
+
expect(getColor('1')).toBe('#DC057B');
|
|
19
|
+
expect(getColor('2')).toBe('#5DC003');
|
|
20
|
+
expect(getColor('3')).toBe('#FEC92F');
|
|
21
|
+
expect(getColor('4')).toBe('#F57F27');
|
|
22
|
+
expect(getColor('5')).toBe('#B71137');
|
|
23
|
+
expect(getColor('6')).toBe('#056B97');
|
|
24
|
+
expect(getColor('7')).toBe('#4499AE');
|
|
25
|
+
expect(getColor('8')).toBe('#BD81BE');
|
|
26
|
+
expect(getColor('9')).toBe('#5F3577');
|
|
27
|
+
expect(getColor('10')).toBe('#A68560');
|
|
28
|
+
expect(getColor('11')).toBe('#555962');
|
|
29
|
+
expect(getColor('12')).toBe('#DC057B');
|
|
30
|
+
expect(getColor('13')).toBe('#5DC003');
|
|
31
|
+
expect(getColor('1')).toBe('#DC057B');
|
|
53
32
|
});
|
|
54
33
|
});
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,249 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
14
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
15
|
-
if (ar || !(i in from)) {
|
|
16
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
17
|
-
ar[i] = from[i];
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
21
|
-
};
|
|
22
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
23
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
var react_1 = __importDefault(require("react"));
|
|
27
|
-
var enzyme_1 = require("enzyme");
|
|
28
|
-
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
29
|
-
var test_utils_1 = require("react-dom/test-utils");
|
|
30
|
-
var MdmModuleContext_1 = require("../../../contexts/MdmModuleContext");
|
|
31
|
-
var EntityUriLink_1 = require("../../../EntityUriLink");
|
|
32
|
-
var DCRChangesList_1 = require("./components/DCRChangesList");
|
|
33
|
-
var ShowMoreLink_1 = require("./components/ShowMoreLink");
|
|
34
|
-
var AttributesChangesContext_1 = require("./AttributesChangesContext");
|
|
35
|
-
var AttributesChanges_1 = require("./AttributesChanges");
|
|
36
|
-
jest.mock('../../../contexts/MdmModuleContext', function () { return (__assign(__assign({}, jest.requireActual('../../../contexts/MdmModuleContext')), { useMdmMetadata: jest.fn() })); });
|
|
37
|
-
var metadata = {
|
|
38
|
-
entityTypes: [
|
|
39
|
-
{
|
|
40
|
-
uri: 'configuration/entityTypes/HCA',
|
|
41
|
-
label: 'HCA label',
|
|
42
|
-
attributes: [
|
|
43
|
-
{
|
|
44
|
-
label: 'Activation Date',
|
|
45
|
-
name: 'ActivationDate',
|
|
46
|
-
type: 'String',
|
|
47
|
-
uri: 'configuration/entityTypes/HCA/attributes/ActivationDate'
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
dependentLookupCode: 'COUNTRY_CD',
|
|
51
|
-
label: 'Country Code',
|
|
52
|
-
name: 'CountryCode',
|
|
53
|
-
type: 'String',
|
|
54
|
-
uri: 'configuration/entityTypes/HCA/attributes/CountryCode'
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
dependentLookupCode: 'HCA_TYP_CD',
|
|
58
|
-
label: 'Customer Type',
|
|
59
|
-
name: 'TypeCode',
|
|
60
|
-
type: 'String',
|
|
61
|
-
uri: 'configuration/entityTypes/HCA/attributes/TypeCode'
|
|
62
|
-
}
|
|
63
|
-
]
|
|
64
|
-
}
|
|
65
|
-
]
|
|
66
|
-
};
|
|
67
|
-
describe('AttributesChanges tests', function () {
|
|
68
|
-
var _a, _b;
|
|
69
|
-
beforeEach(function () {
|
|
70
|
-
MdmModuleContext_1.useMdmMetadata.mockReturnValue(metadata);
|
|
71
|
-
});
|
|
72
|
-
var entityUri = 'entities/1hRTSKE5';
|
|
73
|
-
var dcrUri = 'changeRequests/3aMaA3Nc';
|
|
74
|
-
var changes = (_a = {},
|
|
75
|
-
_a[entityUri] = [
|
|
76
|
-
{
|
|
77
|
-
attributePath: 'ActivationDate',
|
|
78
|
-
attributeType: 'configuration/entityTypes/HCA/attributes/ActivationDate',
|
|
79
|
-
id: '41cb3t3k',
|
|
80
|
-
newValue: { value: '12.10.2011' },
|
|
81
|
-
type: mdm_sdk_1.DCRTypes.INSERT_ATTRIBUTE
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
attributePath: 'CountryCode/3AqlrpfGa',
|
|
85
|
-
attributeType: 'configuration/entityTypes/HCA/attributes/CountryCode',
|
|
86
|
-
id: '41cb3gGy',
|
|
87
|
-
newValue: { value: 'Chile', lookupCode: 'CL', lookupRawValue: 'Chile', pin: true },
|
|
88
|
-
oldValue: { value: 'Chile', lookupCode: 'CL', lookupRawValue: 'Chile', pin: true },
|
|
89
|
-
type: mdm_sdk_1.DCRTypes.IGNORE_ATTRIBUTE
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
attributePath: 'TypeCode/45uyph6Aj',
|
|
93
|
-
attributeType: 'configuration/entityTypes/HCA/attributes/TypeCode',
|
|
94
|
-
id: '41cb3kXE',
|
|
95
|
-
newValue: { value: 'academic institution', lookupCode: 'ACIN', lookupRawValue: 'ACIN', pin: true },
|
|
96
|
-
oldValue: { value: 'academic institution', lookupCode: 'ACIN', lookupRawValue: 'ACIN', pin: true },
|
|
97
|
-
type: mdm_sdk_1.DCRTypes.DELETE_ATTRIBUTE
|
|
98
|
-
}
|
|
99
|
-
],
|
|
100
|
-
_a);
|
|
101
|
-
var entityInfo = {
|
|
102
|
-
isExist: true,
|
|
103
|
-
label: '12345 - Address Line 1 City',
|
|
104
|
-
secondaryLabel: '12345',
|
|
105
|
-
type: 'configuration/entityTypes/HCA',
|
|
106
|
-
uri: entityUri
|
|
107
|
-
};
|
|
108
|
-
var objectsInfo = (_b = {},
|
|
109
|
-
_b[entityUri] = entityInfo,
|
|
110
|
-
_b);
|
|
111
|
-
it('should render main parts with props', function () {
|
|
112
|
-
var expectedChanges = [
|
|
113
|
-
{
|
|
114
|
-
attributeType: metadata.entityTypes[0].attributes[0],
|
|
115
|
-
label: 'Activation Date',
|
|
116
|
-
level: 0,
|
|
117
|
-
newValue: {
|
|
118
|
-
value: '12.10.2011'
|
|
119
|
-
},
|
|
120
|
-
operation: 'added'
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
attributeType: metadata.entityTypes[0].attributes[1],
|
|
124
|
-
label: 'Country Code',
|
|
125
|
-
level: 0,
|
|
126
|
-
newValue: {
|
|
127
|
-
lookupCode: 'CL',
|
|
128
|
-
lookupRawValue: 'Chile',
|
|
129
|
-
pin: true,
|
|
130
|
-
value: 'Chile'
|
|
131
|
-
},
|
|
132
|
-
operation: 'ignored'
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
attributeType: metadata.entityTypes[0].attributes[2],
|
|
136
|
-
label: 'Customer Type',
|
|
137
|
-
level: 0,
|
|
138
|
-
newValue: {
|
|
139
|
-
lookupCode: 'ACIN',
|
|
140
|
-
lookupRawValue: 'ACIN',
|
|
141
|
-
pin: true,
|
|
142
|
-
value: 'academic institution'
|
|
143
|
-
},
|
|
144
|
-
operation: 'deleted'
|
|
145
|
-
}
|
|
146
|
-
];
|
|
147
|
-
var component = (0, enzyme_1.shallow)(react_1.default.createElement(AttributesChanges_1.AttributesChanges, { entityInfo: entityInfo, relationsInfo: [], changes: changes, objectsInfo: objectsInfo, dcrUri: dcrUri }));
|
|
148
|
-
var context = component.find(AttributesChangesContext_1.AttributesChangesContext.Provider);
|
|
149
|
-
expect(context).toHaveLength(1);
|
|
150
|
-
expect(context.prop('value')).toEqual(objectsInfo);
|
|
151
|
-
var entityLink = component.find(EntityUriLink_1.EntityUriLink);
|
|
152
|
-
expect(entityLink).toHaveLength(1);
|
|
153
|
-
expect(entityLink.prop('value')).toBe(entityInfo.uri);
|
|
154
|
-
expect(entityLink.text()).toBe(entityInfo.label);
|
|
155
|
-
var dcrList = component.find(DCRChangesList_1.DCRChangesList);
|
|
156
|
-
expect(dcrList).toHaveLength(1);
|
|
157
|
-
expect(dcrList.props()).toEqual({
|
|
158
|
-
changes: expectedChanges
|
|
159
|
-
});
|
|
160
|
-
expect(component.find(ShowMoreLink_1.ShowMoreLink)).toHaveLength(0);
|
|
161
|
-
});
|
|
162
|
-
it('should render ShowMoreLink if length of merged changes more than 3', function () {
|
|
163
|
-
var _a;
|
|
164
|
-
var bigChanges = (_a = {},
|
|
165
|
-
_a[entityUri] = __spreadArray(__spreadArray([], changes[entityUri], true), [
|
|
166
|
-
{
|
|
167
|
-
attributePath: 'CountryCode',
|
|
168
|
-
attributeType: 'configuration/entityTypes/HCA/attributes/CountryCode',
|
|
169
|
-
id: '41cb3c0i',
|
|
170
|
-
newValue: { value: 'Bahamas', lookupCode: 'BS', lookupRawValue: 'BS' },
|
|
171
|
-
type: mdm_sdk_1.DCRTypes.INSERT_ATTRIBUTE
|
|
172
|
-
}
|
|
173
|
-
], false),
|
|
174
|
-
_a);
|
|
175
|
-
var component = (0, enzyme_1.shallow)(react_1.default.createElement(AttributesChanges_1.AttributesChanges, { entityInfo: entityInfo, relationsInfo: [], changes: bigChanges, objectsInfo: objectsInfo, dcrUri: dcrUri }));
|
|
176
|
-
var entityLink = component.find(EntityUriLink_1.EntityUriLink);
|
|
177
|
-
expect(entityLink).toHaveLength(1);
|
|
178
|
-
expect(entityLink.prop('value')).toBe(entityInfo.uri);
|
|
179
|
-
expect(entityLink.text()).toBe(entityInfo.label);
|
|
180
|
-
var dcrList = component.find(DCRChangesList_1.DCRChangesList);
|
|
181
|
-
expect(dcrList).toHaveLength(1);
|
|
182
|
-
expect(dcrList.prop('changes').length).toBe(3);
|
|
183
|
-
var showMoreLink = component.find(ShowMoreLink_1.ShowMoreLink);
|
|
184
|
-
expect(showMoreLink).toHaveLength(1);
|
|
185
|
-
expect(showMoreLink.props()).toEqual({
|
|
186
|
-
onClick: expect.any(Function),
|
|
187
|
-
suggestionsCount: 1,
|
|
188
|
-
isExpanded: false,
|
|
189
|
-
className: 'showMoreLink'
|
|
190
|
-
});
|
|
191
|
-
(0, test_utils_1.act)(function () {
|
|
192
|
-
showMoreLink.prop('onClick')();
|
|
193
|
-
});
|
|
194
|
-
component.update();
|
|
195
|
-
expect(component.find(DCRChangesList_1.DCRChangesList).prop('changes').length).toBe(4);
|
|
196
|
-
expect(component.find(ShowMoreLink_1.ShowMoreLink).props()).toEqual({
|
|
197
|
-
onClick: expect.any(Function),
|
|
198
|
-
suggestionsCount: 1,
|
|
199
|
-
isExpanded: true,
|
|
200
|
-
className: 'showMoreLink'
|
|
201
|
-
});
|
|
202
|
-
});
|
|
203
|
-
it('should render empty DCRChangesList when changes are empty', function () {
|
|
204
|
-
var component = (0, enzyme_1.shallow)(react_1.default.createElement(AttributesChanges_1.AttributesChanges, { entityInfo: entityInfo, relationsInfo: [], changes: {}, objectsInfo: {}, dcrUri: dcrUri }));
|
|
205
|
-
var entityLink = component.find(EntityUriLink_1.EntityUriLink);
|
|
206
|
-
expect(entityLink).toHaveLength(1);
|
|
207
|
-
expect(entityLink.prop('value')).toBe(entityInfo.uri);
|
|
208
|
-
expect(entityLink.text()).toBe(entityInfo.label);
|
|
209
|
-
var dcrList = component.find(DCRChangesList_1.DCRChangesList);
|
|
210
|
-
expect(dcrList).toHaveLength(1);
|
|
211
|
-
expect(dcrList.prop('changes').length).toBe(0);
|
|
212
|
-
expect(component.find(ShowMoreLink_1.ShowMoreLink)).toHaveLength(0);
|
|
213
|
-
});
|
|
214
|
-
it('should create correct link for new entity', function () {
|
|
215
|
-
var _a;
|
|
216
|
-
var changesWithNewEntity = (_a = {},
|
|
217
|
-
_a[entityUri] = [
|
|
218
|
-
{
|
|
219
|
-
id: '3aMaA7ds',
|
|
220
|
-
type: mdm_sdk_1.DCRTypes.CREATE_ENTITY,
|
|
221
|
-
createdBy: 'alan.khugaev',
|
|
222
|
-
newValue: {
|
|
223
|
-
uri: 'entities/1WNHTsJw',
|
|
224
|
-
type: 'configuration/entityTypes/HCA',
|
|
225
|
-
attributes: {
|
|
226
|
-
CountryCode: [
|
|
227
|
-
{
|
|
228
|
-
value: 'Germany',
|
|
229
|
-
lookupCode: 'DE',
|
|
230
|
-
lookupRawValue: 'DE'
|
|
231
|
-
}
|
|
232
|
-
],
|
|
233
|
-
ActivationDate: [
|
|
234
|
-
{
|
|
235
|
-
value: '12.10.2011'
|
|
236
|
-
}
|
|
237
|
-
]
|
|
238
|
-
},
|
|
239
|
-
isFavorite: false
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
],
|
|
243
|
-
_a);
|
|
244
|
-
var component = (0, enzyme_1.shallow)(react_1.default.createElement(AttributesChanges_1.AttributesChanges, { entityInfo: entityInfo, relationsInfo: [], changes: changesWithNewEntity, objectsInfo: objectsInfo, dcrUri: dcrUri }));
|
|
245
|
-
var entityLink = component.find(EntityUriLink_1.EntityUriLink);
|
|
246
|
-
expect(entityLink.prop('value')).toBe("".concat(dcrUri, "/changes/").concat(entityUri));
|
|
247
|
-
expect(entityLink.prop('screen')).toBe('dcrReview');
|
|
248
|
-
});
|
|
249
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
var react_1 = __importDefault(require("react"));
|
|
7
|
-
var enzyme_1 = require("enzyme");
|
|
8
|
-
var ArrowRightAlt_1 = __importDefault(require("@mui/icons-material/ArrowRightAlt"));
|
|
9
|
-
var Chip_1 = __importDefault(require("@mui/material/Chip"));
|
|
10
|
-
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
11
|
-
var ChangeView_1 = require("./ChangeView");
|
|
12
|
-
describe('ChangeView tests', function () {
|
|
13
|
-
it('should render only label when other props are not set', function () {
|
|
14
|
-
var label = 'Test label';
|
|
15
|
-
var component = (0, enzyme_1.shallow)(react_1.default.createElement(ChangeView_1.ChangeView, { label: label }));
|
|
16
|
-
expect(component.text()).toBe("".concat(label, ":"));
|
|
17
|
-
expect(component.find('.difference')).toHaveLength(0);
|
|
18
|
-
expect(component.find(ArrowRightAlt_1.default)).toHaveLength(0);
|
|
19
|
-
expect(component.find(Chip_1.default)).toHaveLength(0);
|
|
20
|
-
});
|
|
21
|
-
it('should render label, one value and Chip id other value is not set', function () {
|
|
22
|
-
var label = 'Test label';
|
|
23
|
-
var newValue = 'value';
|
|
24
|
-
var operation = mdm_sdk_1.DCROperationTypes.ADDED;
|
|
25
|
-
var component = (0, enzyme_1.shallow)(react_1.default.createElement(ChangeView_1.ChangeView, { label: label, newValue: newValue, operation: operation }));
|
|
26
|
-
expect(component.text()).toBe("".concat(label, ":").concat(newValue));
|
|
27
|
-
expect(component.find(ArrowRightAlt_1.default)).toHaveLength(0);
|
|
28
|
-
var chip = component.find(Chip_1.default);
|
|
29
|
-
expect(chip).toHaveLength(1);
|
|
30
|
-
expect(chip.prop('label')).toBe('added');
|
|
31
|
-
});
|
|
32
|
-
it('should render all parts', function () {
|
|
33
|
-
var label = 'Test label';
|
|
34
|
-
var newValue = 'value1';
|
|
35
|
-
var oldValue = 'value2';
|
|
36
|
-
var operation = mdm_sdk_1.DCROperationTypes.EDITED;
|
|
37
|
-
var component = (0, enzyme_1.shallow)(react_1.default.createElement(ChangeView_1.ChangeView, { label: label, newValue: newValue, oldValue: oldValue, operation: operation }));
|
|
38
|
-
expect(component.text()).toBe("".concat(label, ":").concat(oldValue).concat(newValue));
|
|
39
|
-
expect(component.find(ArrowRightAlt_1.default)).toHaveLength(1);
|
|
40
|
-
var chip = component.find(Chip_1.default);
|
|
41
|
-
expect(chip).toHaveLength(1);
|
|
42
|
-
expect(chip.prop('label')).toBe('edited');
|
|
43
|
-
});
|
|
44
|
-
});
|
package/cjs/features/workflow/AttributesChanges/components/DCRChangesList/DCRChangesList.spec.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/cjs/features/workflow/AttributesChanges/components/DCRChangesList/DCRChangesList.spec.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
var react_1 = __importDefault(require("react"));
|
|
7
|
-
var enzyme_1 = require("enzyme");
|
|
8
|
-
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
9
|
-
var DiffRenderer_1 = require("../DiffRenderer");
|
|
10
|
-
var DCRChangesList_1 = require("./DCRChangesList");
|
|
11
|
-
describe('DCRChangesList tests', function () {
|
|
12
|
-
it('should provide changes props to DiffRenderer', function () {
|
|
13
|
-
var changes = [
|
|
14
|
-
{ level: 0, label: 'Label 1', attributeType: { type: mdm_sdk_1.DataTypes.TYPE_STRING, name: 'name1', uri: 'uri1' } },
|
|
15
|
-
{ level: 1, label: 'Label 2', attributeType: { type: mdm_sdk_1.DataTypes.TYPE_STRING, name: 'name2', uri: 'uri2' } },
|
|
16
|
-
{ level: 2, label: 'Label 3', attributeType: { type: mdm_sdk_1.DataTypes.TYPE_STRING, name: 'name3', uri: 'uri3' } }
|
|
17
|
-
];
|
|
18
|
-
var component = (0, enzyme_1.shallow)(react_1.default.createElement(DCRChangesList_1.DCRChangesList, { changes: changes }));
|
|
19
|
-
var diffs = component.find(DiffRenderer_1.DiffRenderer);
|
|
20
|
-
expect(diffs).toHaveLength(changes.length);
|
|
21
|
-
diffs.map(function (diff, index) {
|
|
22
|
-
expect(diff.props()).toEqual(changes[index]);
|
|
23
|
-
});
|
|
24
|
-
});
|
|
25
|
-
it('should render Relationships title', function () {
|
|
26
|
-
var changes = [
|
|
27
|
-
{ level: 0, label: 'Label 1', attributeType: { type: mdm_sdk_1.DataTypes.TYPE_STRING, name: 'name1', uri: 'uri1' } },
|
|
28
|
-
{ level: 1, label: 'Label 2', attributeType: { type: mdm_sdk_1.DataTypes.TYPE_STRING, name: 'name2', uri: 'uri2' } },
|
|
29
|
-
{ label: 'Relationships' }
|
|
30
|
-
];
|
|
31
|
-
var component = (0, enzyme_1.shallow)(react_1.default.createElement(DCRChangesList_1.DCRChangesList, { changes: changes }));
|
|
32
|
-
var diffs = component.find(DiffRenderer_1.DiffRenderer);
|
|
33
|
-
expect(diffs).toHaveLength(changes.length - 1);
|
|
34
|
-
var title = component.find('.title');
|
|
35
|
-
expect(title).toHaveLength(1);
|
|
36
|
-
expect(title.text()).toBe('Relationships');
|
|
37
|
-
});
|
|
38
|
-
});
|
package/cjs/features/workflow/AttributesChanges/components/DiffRenderer/DiffRenderer.spec.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|