@reltio/components 1.4.1997 → 1.4.1998
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/activity-log/ActivitiesFactory/ActivitiesFactory.d.ts +1 -1
- package/cjs/features/activity-log/ActivitiesFactory/ActivitiesFactory.js +1 -1
- package/cjs/features/activity-log/ActivitiesFactory/ActivitiesFactory.test.js +267 -0
- package/cjs/features/activity-log/ActivitiesFactory/components/CommentActivity/CommentActivity.d.ts +1 -2
- package/cjs/features/activity-log/ActivitiesFactory/components/CommentActivity/CommentActivity.js +1 -1
- package/cjs/features/activity-log/ActivitiesFactory/components/CommentActivity/CommentActivity.test.js +5 -23
- package/cjs/features/activity-log/ActivitiesFactory/components/GroupActivity/GroupActivity.js +2 -2
- package/cjs/features/activity-log/ActivitiesFactory/components/GroupActivity/GroupActivity.test.js +3 -23
- package/cjs/features/activity-log/ActivitiesFactory/components/MergeActivity/MergeActivity.js +2 -2
- package/cjs/features/activity-log/ActivitiesFactory/components/MergeActivity/MergeActivity.test.js +81 -102
- package/cjs/features/activity-log/ActivitiesFactory/components/ObjectLabel/ObjectLabel.d.ts +2 -2
- package/cjs/features/activity-log/ActivitiesFactory/components/ObjectLabel/ObjectLabel.js +24 -2
- package/cjs/features/activity-log/ActivitiesFactory/components/PotentialMatchActivity/PotentialMatchActivity.js +1 -1
- package/cjs/features/activity-log/ActivitiesFactory/components/PotentialMatchActivity/PotentialMatchActivity.test.js +69 -48
- package/cjs/features/activity-log/ActivitiesFactory/components/ProfileActivity/ProfileActivity.js +2 -2
- package/cjs/features/activity-log/ActivitiesFactory/components/ProfileActivity/ProfileActivity.test.js +123 -107
- package/cjs/features/activity-log/ActivitiesFactory/components/RelationActivity/RelationActivity.js +2 -2
- package/cjs/features/activity-log/ActivitiesFactory/components/RelationActivity/RelationActivity.test.js +128 -115
- package/cjs/features/activity-log/ActivitiesFactory/components/SearchActivity/SearchActivity.js +1 -1
- package/cjs/features/activity-log/ActivitiesFactory/components/SearchActivity/SearchActivity.test.js +160 -183
- package/cjs/features/activity-log/ActivitiesFactory/components/SimpleActivity/SimpleActivity.js +2 -2
- package/cjs/features/activity-log/ActivitiesFactory/components/SimpleActivity/SimpleActivity.test.js +44 -28
- package/cjs/features/activity-log/ActivitiesFactory/components/SynchronizationIssuesActivity/SynchronizationIssuesActivity.js +4 -5
- package/cjs/features/activity-log/ActivitiesFactory/components/SynchronizationIssuesActivity/SynchronizationIssuesActivity.test.js +54 -47
- package/cjs/features/activity-log/ActivityLog/ActivityLog.test.js +83 -22
- package/cjs/features/activity-log/ActivityLog/components/GroupItem/GroupItem.js +1 -1
- package/cjs/features/activity-log/ActivityLogFilter/ActivityLogFilter.test.js +784 -0
- package/cjs/features/activity-log/ActivityTitle/ActivityTitle.d.ts +2 -3
- package/cjs/features/activity-log/ActivityTitle/ActivityTitle.js +24 -2
- package/cjs/features/activity-log/CollapsibleActivityRecords/CollapsibleActivityRecords.test.js +102 -79
- package/cjs/features/activity-log/EntityObject/EntityObject.test.js +35 -26
- package/cjs/features/activity-log/Field/Field.d.ts +2 -3
- package/cjs/features/activity-log/Field/Field.js +24 -2
- package/cjs/features/activity-log/PotentialMatchRecord/PotentialMatchRecord.test.js +160 -34
- package/cjs/features/activity-log/PotentialMatchRecord/components/PotentialMatchField/PotentialMatchField.js +1 -1
- package/cjs/features/activity-log/RecordUpdates/RecordUpdates.test.js +207 -0
- package/cjs/features/activity-log/RecordUpdates/components/DeltaField/DeltaField.js +1 -1
- package/cjs/features/activity-log/RelationObject/RelationObject.test.js +46 -29
- package/cjs/features/activity-log/RelationRecord/RelationRecord.test.js +88 -68
- package/esm/features/activity-log/ActivitiesFactory/ActivitiesFactory.d.ts +1 -1
- package/esm/features/activity-log/ActivitiesFactory/ActivitiesFactory.js +1 -1
- package/esm/features/activity-log/ActivitiesFactory/ActivitiesFactory.test.js +262 -0
- package/esm/features/activity-log/ActivitiesFactory/components/CommentActivity/CommentActivity.d.ts +1 -2
- package/esm/features/activity-log/ActivitiesFactory/components/CommentActivity/CommentActivity.js +1 -1
- package/esm/features/activity-log/ActivitiesFactory/components/CommentActivity/CommentActivity.test.js +5 -23
- package/esm/features/activity-log/ActivitiesFactory/components/GroupActivity/GroupActivity.js +2 -2
- package/esm/features/activity-log/ActivitiesFactory/components/GroupActivity/GroupActivity.test.js +3 -23
- package/esm/features/activity-log/ActivitiesFactory/components/MergeActivity/MergeActivity.js +2 -2
- package/esm/features/activity-log/ActivitiesFactory/components/MergeActivity/MergeActivity.test.js +81 -102
- package/esm/features/activity-log/ActivitiesFactory/components/ObjectLabel/ObjectLabel.d.ts +2 -2
- package/esm/features/activity-log/ActivitiesFactory/components/ObjectLabel/ObjectLabel.js +24 -2
- package/esm/features/activity-log/ActivitiesFactory/components/PotentialMatchActivity/PotentialMatchActivity.js +1 -1
- package/esm/features/activity-log/ActivitiesFactory/components/PotentialMatchActivity/PotentialMatchActivity.test.js +69 -48
- package/esm/features/activity-log/ActivitiesFactory/components/ProfileActivity/ProfileActivity.js +2 -2
- package/esm/features/activity-log/ActivitiesFactory/components/ProfileActivity/ProfileActivity.test.js +123 -107
- package/esm/features/activity-log/ActivitiesFactory/components/RelationActivity/RelationActivity.js +2 -2
- package/esm/features/activity-log/ActivitiesFactory/components/RelationActivity/RelationActivity.test.js +128 -115
- package/esm/features/activity-log/ActivitiesFactory/components/SearchActivity/SearchActivity.js +1 -1
- package/esm/features/activity-log/ActivitiesFactory/components/SearchActivity/SearchActivity.test.js +160 -183
- package/esm/features/activity-log/ActivitiesFactory/components/SimpleActivity/SimpleActivity.js +2 -2
- package/esm/features/activity-log/ActivitiesFactory/components/SimpleActivity/SimpleActivity.test.js +44 -28
- package/esm/features/activity-log/ActivitiesFactory/components/SynchronizationIssuesActivity/SynchronizationIssuesActivity.js +4 -5
- package/esm/features/activity-log/ActivitiesFactory/components/SynchronizationIssuesActivity/SynchronizationIssuesActivity.test.js +54 -47
- package/esm/features/activity-log/ActivityLog/ActivityLog.test.js +83 -22
- package/esm/features/activity-log/ActivityLog/components/GroupItem/GroupItem.js +1 -1
- package/esm/features/activity-log/ActivityLogFilter/ActivityLogFilter.test.js +779 -0
- package/esm/features/activity-log/ActivityTitle/ActivityTitle.d.ts +2 -3
- package/esm/features/activity-log/ActivityTitle/ActivityTitle.js +24 -2
- package/esm/features/activity-log/CollapsibleActivityRecords/CollapsibleActivityRecords.test.js +104 -58
- package/esm/features/activity-log/EntityObject/EntityObject.test.js +35 -26
- package/esm/features/activity-log/Field/Field.d.ts +2 -3
- package/esm/features/activity-log/Field/Field.js +24 -2
- package/esm/features/activity-log/PotentialMatchRecord/PotentialMatchRecord.test.js +160 -34
- package/esm/features/activity-log/PotentialMatchRecord/components/PotentialMatchField/PotentialMatchField.js +1 -1
- package/esm/features/activity-log/RecordUpdates/RecordUpdates.test.js +202 -0
- package/esm/features/activity-log/RecordUpdates/components/DeltaField/DeltaField.js +1 -1
- package/esm/features/activity-log/RelationObject/RelationObject.test.js +46 -29
- package/esm/features/activity-log/RelationRecord/RelationRecord.test.js +88 -68
- package/package.json +1 -1
- package/cjs/features/activity-log/ActivityExportButton/ActivityExportButton.specs.js +0 -142
- package/cjs/features/activity-log/ActivityFilterButton/ActivityFilterButton.specs.js +0 -131
- package/cjs/features/activity-log/ActivityFilterEditor/ActivityFilterEditor.specs.js +0 -252
- package/cjs/features/activity-log/ActivityFilterEditor/components/ActivitySelector/ActivitySelector.specs.js +0 -158
- package/cjs/features/activity-log/ActivityFilterEditor/components/EntityChangedSelectors/EntityChangedSelectors.specs.js +0 -135
- package/cjs/features/activity-log/ActivityFilterEditor/components/EntityTypesSelector/EntityTypesSelector.specs.js +0 -65
- package/cjs/features/activity-log/ActivityFilterEditor/components/SourceSelector/SourceSelector.specs.d.ts +0 -1
- package/cjs/features/activity-log/ActivityFilterEditor/components/SourceSelector/SourceSelector.specs.js +0 -119
- package/cjs/features/activity-log/ActivityFilterEditor/editor.test-data.d.ts +0 -25
- package/cjs/features/activity-log/ActivityFilterEditor/editor.test-data.js +0 -75
- package/cjs/features/activity-log/ActivityLog/components/ActivityItem/ActivityItem.test.d.ts +0 -1
- package/cjs/features/activity-log/ActivityLog/components/ActivityItem/ActivityItem.test.js +0 -140
- package/cjs/features/activity-log/ActivityLog/components/GroupItem/GroupItem.test.d.ts +0 -1
- package/cjs/features/activity-log/ActivityLog/components/GroupItem/GroupItem.test.js +0 -41
- package/cjs/features/activity-log/ActivityLogFilter/ActivityLogFilter.specs.d.ts +0 -1
- package/cjs/features/activity-log/ActivityLogFilter/ActivityLogFilter.specs.js +0 -87
- package/cjs/features/activity-log/ActivityTitle/ActivityTitle.test.d.ts +0 -1
- package/cjs/features/activity-log/ActivityTitle/ActivityTitle.test.js +0 -19
- package/cjs/features/activity-log/PotentialMatchRecord/components/PotentialMatchField/PotentialMatchField.test.d.ts +0 -1
- package/cjs/features/activity-log/PotentialMatchRecord/components/PotentialMatchField/PotentialMatchField.test.js +0 -179
- package/cjs/features/activity-log/RecordUpdates/RecordUpdates.specs.d.ts +0 -1
- package/cjs/features/activity-log/RecordUpdates/RecordUpdates.specs.js +0 -150
- package/cjs/features/activity-log/RecordUpdates/components/DeltaField/DeltaField.test.d.ts +0 -1
- package/cjs/features/activity-log/RecordUpdates/components/DeltaField/DeltaField.test.js +0 -124
- package/esm/features/activity-log/ActivityExportButton/ActivityExportButton.specs.d.ts +0 -1
- package/esm/features/activity-log/ActivityExportButton/ActivityExportButton.specs.js +0 -137
- package/esm/features/activity-log/ActivityFilterButton/ActivityFilterButton.specs.d.ts +0 -1
- package/esm/features/activity-log/ActivityFilterButton/ActivityFilterButton.specs.js +0 -126
- package/esm/features/activity-log/ActivityFilterEditor/ActivityFilterEditor.specs.d.ts +0 -1
- package/esm/features/activity-log/ActivityFilterEditor/ActivityFilterEditor.specs.js +0 -247
- package/esm/features/activity-log/ActivityFilterEditor/components/ActivitySelector/ActivitySelector.specs.d.ts +0 -1
- package/esm/features/activity-log/ActivityFilterEditor/components/ActivitySelector/ActivitySelector.specs.js +0 -153
- package/esm/features/activity-log/ActivityFilterEditor/components/EntityChangedSelectors/EntityChangedSelectors.specs.d.ts +0 -1
- package/esm/features/activity-log/ActivityFilterEditor/components/EntityChangedSelectors/EntityChangedSelectors.specs.js +0 -130
- package/esm/features/activity-log/ActivityFilterEditor/components/EntityTypesSelector/EntityTypesSelector.specs.d.ts +0 -1
- package/esm/features/activity-log/ActivityFilterEditor/components/EntityTypesSelector/EntityTypesSelector.specs.js +0 -60
- package/esm/features/activity-log/ActivityFilterEditor/components/SourceSelector/SourceSelector.specs.d.ts +0 -1
- package/esm/features/activity-log/ActivityFilterEditor/components/SourceSelector/SourceSelector.specs.js +0 -114
- package/esm/features/activity-log/ActivityFilterEditor/editor.test-data.d.ts +0 -25
- package/esm/features/activity-log/ActivityFilterEditor/editor.test-data.js +0 -72
- package/esm/features/activity-log/ActivityLog/components/ActivityItem/ActivityItem.test.d.ts +0 -1
- package/esm/features/activity-log/ActivityLog/components/ActivityItem/ActivityItem.test.js +0 -135
- package/esm/features/activity-log/ActivityLog/components/GroupItem/GroupItem.test.d.ts +0 -1
- package/esm/features/activity-log/ActivityLog/components/GroupItem/GroupItem.test.js +0 -36
- package/esm/features/activity-log/ActivityLogFilter/ActivityLogFilter.specs.d.ts +0 -1
- package/esm/features/activity-log/ActivityLogFilter/ActivityLogFilter.specs.js +0 -82
- package/esm/features/activity-log/ActivityTitle/ActivityTitle.test.d.ts +0 -1
- package/esm/features/activity-log/ActivityTitle/ActivityTitle.test.js +0 -14
- package/esm/features/activity-log/PotentialMatchRecord/components/PotentialMatchField/PotentialMatchField.test.d.ts +0 -1
- package/esm/features/activity-log/PotentialMatchRecord/components/PotentialMatchField/PotentialMatchField.test.js +0 -151
- package/esm/features/activity-log/RecordUpdates/RecordUpdates.specs.d.ts +0 -1
- package/esm/features/activity-log/RecordUpdates/RecordUpdates.specs.js +0 -122
- package/esm/features/activity-log/RecordUpdates/components/DeltaField/DeltaField.test.d.ts +0 -1
- package/esm/features/activity-log/RecordUpdates/components/DeltaField/DeltaField.test.js +0 -119
- /package/cjs/features/activity-log/{ActivityExportButton/ActivityExportButton.specs.d.ts → ActivitiesFactory/ActivitiesFactory.test.d.ts} +0 -0
- /package/cjs/features/activity-log/{ActivityFilterButton/ActivityFilterButton.specs.d.ts → ActivityLogFilter/ActivityLogFilter.test.d.ts} +0 -0
- /package/cjs/features/activity-log/{ActivityFilterEditor/ActivityFilterEditor.specs.d.ts → RecordUpdates/RecordUpdates.test.d.ts} +0 -0
- /package/{cjs/features/activity-log/ActivityFilterEditor/components/ActivitySelector/ActivitySelector.specs.d.ts → esm/features/activity-log/ActivitiesFactory/ActivitiesFactory.test.d.ts} +0 -0
- /package/{cjs/features/activity-log/ActivityFilterEditor/components/EntityChangedSelectors/EntityChangedSelectors.specs.d.ts → esm/features/activity-log/ActivityLogFilter/ActivityLogFilter.test.d.ts} +0 -0
- /package/{cjs/features/activity-log/ActivityFilterEditor/components/EntityTypesSelector/EntityTypesSelector.specs.d.ts → esm/features/activity-log/RecordUpdates/RecordUpdates.test.d.ts} +0 -0
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { ActivityData, ActivityTypes } from '../types';
|
|
3
3
|
type FactoryProps = {
|
|
4
4
|
type: ActivityTypes;
|
|
5
|
-
data
|
|
5
|
+
data?: ActivityData;
|
|
6
6
|
};
|
|
7
7
|
export declare class ActivitiesFactory {
|
|
8
8
|
static getComponent: ({ type, data }: FactoryProps) => React.JSX.Element;
|
|
@@ -37,7 +37,7 @@ var ActivitiesFactory = /** @class */ (function () {
|
|
|
37
37
|
case types_1.ActivityTypes.COMMENT_ADDED:
|
|
38
38
|
case types_1.ActivityTypes.COMMENT_DELETED:
|
|
39
39
|
case types_1.ActivityTypes.COMMENT_UPDATED:
|
|
40
|
-
return react_1.default.createElement(CommentActivity_1.CommentActivity, {
|
|
40
|
+
return react_1.default.createElement(CommentActivity_1.CommentActivity, { type: type });
|
|
41
41
|
case types_1.ActivityTypes.ENTITIES_MERGED_MANUALLY:
|
|
42
42
|
case types_1.ActivityTypes.ENTITIES_MERGED:
|
|
43
43
|
case types_1.ActivityTypes.ENTITIES_MERGED_ON_THE_FLY:
|
|
@@ -0,0 +1,267 @@
|
|
|
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 react_2 = require("@testing-library/react");
|
|
8
|
+
var MdmModuleContext_1 = require("../../../contexts/MdmModuleContext");
|
|
9
|
+
var CollapsibleItemsContext_1 = require("../contexts/CollapsibleItemsContext");
|
|
10
|
+
var types_1 = require("../types");
|
|
11
|
+
var ActivitiesFactory_1 = require("./ActivitiesFactory");
|
|
12
|
+
var defaultMdmValues = {
|
|
13
|
+
metadata: {
|
|
14
|
+
entityTypes: [],
|
|
15
|
+
groupTypes: []
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
var setUp = function (_a) {
|
|
19
|
+
var props = _a.props, _b = _a.mdmValues, mdmValues = _b === void 0 ? defaultMdmValues : _b;
|
|
20
|
+
var Providers = function (_a) {
|
|
21
|
+
var children = _a.children;
|
|
22
|
+
return (react_1.default.createElement(MdmModuleContext_1.MdmModuleProvider, { values: mdmValues },
|
|
23
|
+
react_1.default.createElement(CollapsibleItemsContext_1.CollapsibleItemsProvider, null, children)));
|
|
24
|
+
};
|
|
25
|
+
return (0, react_2.render)(ActivitiesFactory_1.ActivitiesFactory.getComponent(props), { wrapper: Providers });
|
|
26
|
+
};
|
|
27
|
+
describe('Activities factory tests', function () {
|
|
28
|
+
describe('comment activity', function () {
|
|
29
|
+
it('should render comment activity for COMMENT_ADDED activity type', function () {
|
|
30
|
+
var props = { type: types_1.ActivityTypes.COMMENT_ADDED };
|
|
31
|
+
setUp({ props: props });
|
|
32
|
+
react_2.screen.getByTestId('comment-activity');
|
|
33
|
+
});
|
|
34
|
+
it('should render comment activity for COMMENT_DELETED activity type', function () {
|
|
35
|
+
var props = { type: types_1.ActivityTypes.COMMENT_DELETED };
|
|
36
|
+
setUp({ props: props });
|
|
37
|
+
react_2.screen.getByTestId('comment-activity');
|
|
38
|
+
});
|
|
39
|
+
it('should render comment activity for COMMENT_UPDATED activity type', function () {
|
|
40
|
+
var props = { type: types_1.ActivityTypes.COMMENT_UPDATED };
|
|
41
|
+
setUp({ props: props });
|
|
42
|
+
react_2.screen.getByTestId('comment-activity');
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
describe('merge activity', function () {
|
|
46
|
+
var defaultData = {
|
|
47
|
+
uri: 'activities/156a1eda-4c2c-46e3-8550-118c500fb453',
|
|
48
|
+
user: 'marat.ahmetzyanov',
|
|
49
|
+
timestamp: 1620711408828,
|
|
50
|
+
items: [],
|
|
51
|
+
itemsTotal: 0
|
|
52
|
+
};
|
|
53
|
+
it('should render merge activity for ENTITIES_MERGED_MANUALLY activity type', function () {
|
|
54
|
+
var props = { data: defaultData, type: types_1.ActivityTypes.ENTITIES_MERGED_MANUALLY };
|
|
55
|
+
setUp({ props: props });
|
|
56
|
+
react_2.screen.getByTestId('merge-activity');
|
|
57
|
+
});
|
|
58
|
+
it('should render merge activity for ENTITIES_MERGED activity type', function () {
|
|
59
|
+
var props = { data: defaultData, type: types_1.ActivityTypes.ENTITIES_MERGED };
|
|
60
|
+
setUp({ props: props });
|
|
61
|
+
react_2.screen.getByTestId('merge-activity');
|
|
62
|
+
});
|
|
63
|
+
it('should render merge activity for ENTITIES_MERGED_ON_THE_FLY activity type', function () {
|
|
64
|
+
var props = { data: defaultData, type: types_1.ActivityTypes.ENTITIES_MERGED_ON_THE_FLY };
|
|
65
|
+
setUp({ props: props });
|
|
66
|
+
react_2.screen.getByTestId('merge-activity');
|
|
67
|
+
});
|
|
68
|
+
it('should render merge activity for ENTITIES_SPLITTED activity type', function () {
|
|
69
|
+
var props = { data: defaultData, type: types_1.ActivityTypes.ENTITIES_SPLITTED };
|
|
70
|
+
setUp({ props: props });
|
|
71
|
+
react_2.screen.getByTestId('merge-activity');
|
|
72
|
+
});
|
|
73
|
+
it('should render merge activity for ENTITY_LOST_MERGE activity type', function () {
|
|
74
|
+
var props = { data: defaultData, type: types_1.ActivityTypes.ENTITY_LOST_MERGE };
|
|
75
|
+
setUp({ props: props });
|
|
76
|
+
react_2.screen.getByTestId('merge-activity');
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
describe('potential match activity', function () {
|
|
80
|
+
var defaultData = {
|
|
81
|
+
uri: 'activities/156a1eda-4c2c-46e3-8550-118c500fb453',
|
|
82
|
+
user: 'marat.ahmetzyanov',
|
|
83
|
+
timestamp: 1620711408828,
|
|
84
|
+
items: [],
|
|
85
|
+
itemsTotal: 0
|
|
86
|
+
};
|
|
87
|
+
it('should render potential match activity for POTENTIAL_MATCHES_FOUND activity type', function () {
|
|
88
|
+
var props = { data: defaultData, type: types_1.ActivityTypes.POTENTIAL_MATCHES_FOUND };
|
|
89
|
+
setUp({ props: props });
|
|
90
|
+
react_2.screen.getByTestId('potential-match-activity');
|
|
91
|
+
});
|
|
92
|
+
it('should render potential match activity for POTENTIAL_MATCHES_REMOVED activity type', function () {
|
|
93
|
+
var props = { data: defaultData, type: types_1.ActivityTypes.POTENTIAL_MATCHES_REMOVED };
|
|
94
|
+
setUp({ props: props });
|
|
95
|
+
react_2.screen.getByTestId('potential-match-activity');
|
|
96
|
+
});
|
|
97
|
+
it('should render potential match activity for NOT_MATCHES_SET activity type', function () {
|
|
98
|
+
var props = { data: defaultData, type: types_1.ActivityTypes.NOT_MATCHES_SET };
|
|
99
|
+
setUp({ props: props });
|
|
100
|
+
react_2.screen.getByTestId('potential-match-activity');
|
|
101
|
+
});
|
|
102
|
+
it('should render potential match activity for NOT_MATCHES_RESET activity type', function () {
|
|
103
|
+
var props = { data: defaultData, type: types_1.ActivityTypes.NOT_MATCHES_RESET };
|
|
104
|
+
setUp({ props: props });
|
|
105
|
+
react_2.screen.getByTestId('potential-match-activity');
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
describe('profile activity', function () {
|
|
109
|
+
var defaultData = {
|
|
110
|
+
uri: 'activities/156a1eda-4c2c-46e3-8550-118c500fb453',
|
|
111
|
+
user: 'marat.ahmetzyanov',
|
|
112
|
+
timestamp: 1620711408828,
|
|
113
|
+
items: [],
|
|
114
|
+
itemsTotal: 0
|
|
115
|
+
};
|
|
116
|
+
it('should render profile activity for ENTITY_CHANGED activity type', function () {
|
|
117
|
+
var props = { data: defaultData, type: types_1.ActivityTypes.ENTITY_CHANGED };
|
|
118
|
+
setUp({ props: props });
|
|
119
|
+
react_2.screen.getByTestId('profile-activity');
|
|
120
|
+
});
|
|
121
|
+
it('should render profile activity for ENTITY_CREATED activity type', function () {
|
|
122
|
+
var props = { data: defaultData, type: types_1.ActivityTypes.ENTITY_CREATED };
|
|
123
|
+
setUp({ props: props });
|
|
124
|
+
react_2.screen.getByTestId('profile-activity');
|
|
125
|
+
});
|
|
126
|
+
it('should render profile activity for ENTITY_REMOVED activity type', function () {
|
|
127
|
+
var props = { data: defaultData, type: types_1.ActivityTypes.ENTITY_REMOVED };
|
|
128
|
+
setUp({ props: props });
|
|
129
|
+
react_2.screen.getByTestId('profile-activity');
|
|
130
|
+
});
|
|
131
|
+
it('should render profile activity for ANALYTICS_ATTRIBUTES_CHANGED activity type', function () {
|
|
132
|
+
var props = { data: defaultData, type: types_1.ActivityTypes.ANALYTICS_ATTRIBUTES_CHANGED };
|
|
133
|
+
setUp({ props: props });
|
|
134
|
+
react_2.screen.getByTestId('profile-activity');
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
describe('relation activity', function () {
|
|
138
|
+
var defaultData = {
|
|
139
|
+
uri: 'activities/156a1eda-4c2c-46e3-8550-118c500fb453',
|
|
140
|
+
user: 'marat.ahmetzyanov',
|
|
141
|
+
timestamp: 1620711408828,
|
|
142
|
+
items: [],
|
|
143
|
+
itemsTotal: 0
|
|
144
|
+
};
|
|
145
|
+
it('should render relation activity for RELATIONSHIP_CHANGED activity type', function () {
|
|
146
|
+
var props = { data: defaultData, type: types_1.ActivityTypes.RELATIONSHIP_CHANGED };
|
|
147
|
+
setUp({ props: props });
|
|
148
|
+
react_2.screen.getByTestId('relation-activity');
|
|
149
|
+
});
|
|
150
|
+
it('should render relation activity for RELATIONSHIP_CREATED activity type', function () {
|
|
151
|
+
var props = { data: defaultData, type: types_1.ActivityTypes.RELATIONSHIP_CREATED };
|
|
152
|
+
setUp({ props: props });
|
|
153
|
+
react_2.screen.getByTestId('relation-activity');
|
|
154
|
+
});
|
|
155
|
+
it('should render relation activity for RELATIONSHIP_REMOVED activity type', function () {
|
|
156
|
+
var props = { data: defaultData, type: types_1.ActivityTypes.RELATIONSHIP_REMOVED };
|
|
157
|
+
setUp({ props: props });
|
|
158
|
+
react_2.screen.getByTestId('relation-activity');
|
|
159
|
+
});
|
|
160
|
+
});
|
|
161
|
+
describe('search activity', function () {
|
|
162
|
+
it('should render search activity for USER_SEARCH activity type', function () {
|
|
163
|
+
var props = {
|
|
164
|
+
data: {
|
|
165
|
+
uri: 'activities/504c-9876-79bc2a96',
|
|
166
|
+
user: 'polina.arsenteva',
|
|
167
|
+
label: 'USER_SEARCH',
|
|
168
|
+
description: '{"activity":{"query":null,"uiState":{"view":{"searchResultsMode":"table","entityTypeTab":null,"previewPanelMode":null},"facets":{},"advanced":[],"searchOptions":{"searchByOv":true,"ovOnly":true},"keyword":null,"map":null,"version":"2.0"}},"version":"2.0"}',
|
|
169
|
+
timestamp: 1626952820539
|
|
170
|
+
},
|
|
171
|
+
type: types_1.ActivityTypes.USER_SEARCH
|
|
172
|
+
};
|
|
173
|
+
setUp({ props: props });
|
|
174
|
+
react_2.screen.getByTestId('search-activity');
|
|
175
|
+
});
|
|
176
|
+
});
|
|
177
|
+
describe('group activity', function () {
|
|
178
|
+
var defaultData = {
|
|
179
|
+
uri: 'activities/156a1eda-4c2c-46e3-8550-118c500fb453',
|
|
180
|
+
user: 'marat.ahmetzyanov',
|
|
181
|
+
timestamp: 1620711408828,
|
|
182
|
+
items: [],
|
|
183
|
+
itemsTotal: 0
|
|
184
|
+
};
|
|
185
|
+
it('should render group activity for GROUP_CHANGED activity type', function () {
|
|
186
|
+
var props = { data: defaultData, type: types_1.ActivityTypes.GROUP_CHANGED };
|
|
187
|
+
setUp({ props: props });
|
|
188
|
+
react_2.screen.getByTestId('group-activity');
|
|
189
|
+
});
|
|
190
|
+
it('should render group activity for GROUP_CREATED activity type', function () {
|
|
191
|
+
var props = { data: defaultData, type: types_1.ActivityTypes.GROUP_CREATED };
|
|
192
|
+
setUp({ props: props });
|
|
193
|
+
react_2.screen.getByTestId('group-activity');
|
|
194
|
+
});
|
|
195
|
+
it('should render group activity for GROUP_REMOVED activity type', function () {
|
|
196
|
+
var props = { data: defaultData, type: types_1.ActivityTypes.GROUP_REMOVED };
|
|
197
|
+
setUp({ props: props });
|
|
198
|
+
react_2.screen.getByTestId('group-activity');
|
|
199
|
+
});
|
|
200
|
+
});
|
|
201
|
+
describe('simple activity', function () {
|
|
202
|
+
var defaultData = {
|
|
203
|
+
uri: 'activities/156a1eda-4c2c-46e3-8550-118c500fb453',
|
|
204
|
+
user: 'marat.ahmetzyanov',
|
|
205
|
+
timestamp: 1620711408828,
|
|
206
|
+
description: '{}',
|
|
207
|
+
itemsTotal: 0
|
|
208
|
+
};
|
|
209
|
+
it('should render simple activity for USER_LOGIN activity type', function () {
|
|
210
|
+
var props = { data: defaultData, type: types_1.ActivityTypes.USER_LOGIN };
|
|
211
|
+
setUp({ props: props });
|
|
212
|
+
react_2.screen.getByTestId('simple-activity');
|
|
213
|
+
});
|
|
214
|
+
it('should render simple activity for USER_LOGOUT activity type', function () {
|
|
215
|
+
var props = { data: defaultData, type: types_1.ActivityTypes.USER_LOGOUT };
|
|
216
|
+
setUp({ props: props });
|
|
217
|
+
react_2.screen.getByTestId('simple-activity');
|
|
218
|
+
});
|
|
219
|
+
it('should render simple activity for MODEL_UPDATED activity type', function () {
|
|
220
|
+
var props = { data: defaultData, type: types_1.ActivityTypes.MODEL_UPDATED };
|
|
221
|
+
setUp({ props: props });
|
|
222
|
+
react_2.screen.getByTestId('simple-activity');
|
|
223
|
+
});
|
|
224
|
+
it('should render simple activity for PERIODIC_TASK_SCHEDULED activity type', function () {
|
|
225
|
+
var props = { data: defaultData, type: types_1.ActivityTypes.PERIODIC_TASK_SCHEDULED };
|
|
226
|
+
setUp({ props: props });
|
|
227
|
+
react_2.screen.getByTestId('simple-activity');
|
|
228
|
+
});
|
|
229
|
+
it('should render simple activity for USER_PROFILE_VIEW activity type', function () {
|
|
230
|
+
var props = { data: defaultData, type: types_1.ActivityTypes.USER_PROFILE_VIEW };
|
|
231
|
+
setUp({ props: props });
|
|
232
|
+
react_2.screen.getByTestId('simple-activity');
|
|
233
|
+
});
|
|
234
|
+
});
|
|
235
|
+
describe('synchronization issues activity', function () {
|
|
236
|
+
it('should render synchronization issues activity for SFDC_CONNECTOR_SYNCHRONIZATION_ISSUE activity type', function () {
|
|
237
|
+
var props = {
|
|
238
|
+
data: {
|
|
239
|
+
uri: 'activities/0dcf97d0-5006-46d6-b82f-07579922e2f6',
|
|
240
|
+
user: 'sfdc.connector.admin',
|
|
241
|
+
label: 'label',
|
|
242
|
+
timestamp: 1652374313724,
|
|
243
|
+
items: [
|
|
244
|
+
{
|
|
245
|
+
id: '42uxv5X2',
|
|
246
|
+
timestamp: 1652374313724,
|
|
247
|
+
objectUri: 'entities/15T9kNFk',
|
|
248
|
+
objectType: 'configuration/entityTypes/HCP',
|
|
249
|
+
objectLabel: 'Andy Andy'
|
|
250
|
+
}
|
|
251
|
+
],
|
|
252
|
+
itemsTotal: 1
|
|
253
|
+
},
|
|
254
|
+
type: types_1.ActivityTypes.SFDC_CONNECTOR_SYNCHRONIZATION_ISSUE
|
|
255
|
+
};
|
|
256
|
+
setUp({ props: props });
|
|
257
|
+
react_2.screen.getByTestId('synchronization-issues-activity');
|
|
258
|
+
});
|
|
259
|
+
});
|
|
260
|
+
describe('not implemented', function () {
|
|
261
|
+
it('should render not implemented text for unexpected types', function () {
|
|
262
|
+
var props = { type: 'UNEXPECTED_ACTIVITY' };
|
|
263
|
+
setUp({ props: props });
|
|
264
|
+
react_2.screen.getByText('UNEXPECTED_ACTIVITY NOT IMPLEMENTED');
|
|
265
|
+
});
|
|
266
|
+
});
|
|
267
|
+
});
|
package/cjs/features/activity-log/ActivitiesFactory/components/CommentActivity/CommentActivity.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ActivityTypes } from '../../../types';
|
|
3
3
|
type Props = {
|
|
4
4
|
type: ActivityTypes;
|
|
5
|
-
data: ActivityData;
|
|
6
5
|
};
|
|
7
6
|
export declare const CommentActivity: ({ type }: Props) => React.JSX.Element;
|
|
8
7
|
export {};
|
package/cjs/features/activity-log/ActivitiesFactory/components/CommentActivity/CommentActivity.js
CHANGED
|
@@ -8,6 +8,6 @@ var react_1 = __importDefault(require("react"));
|
|
|
8
8
|
var ActivityTitle_1 = require("../../../ActivityTitle");
|
|
9
9
|
var CommentActivity = function (_a) {
|
|
10
10
|
var type = _a.type;
|
|
11
|
-
return react_1.default.createElement(ActivityTitle_1.ActivityTitle, { type: type });
|
|
11
|
+
return react_1.default.createElement(ActivityTitle_1.ActivityTitle, { type: type, "data-reltio-id": "comment-activity" });
|
|
12
12
|
};
|
|
13
13
|
exports.CommentActivity = CommentActivity;
|
|
@@ -4,30 +4,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
var react_1 = __importDefault(require("react"));
|
|
7
|
-
var
|
|
8
|
-
var CommentActivity_1 = require("./CommentActivity");
|
|
7
|
+
var react_2 = require("@testing-library/react");
|
|
9
8
|
var types_1 = require("../../../types");
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
uri: 'activities/6aa6a54a-a41b-49fd-8070-b4900d3e5468',
|
|
13
|
-
user: 'denis.tkachev',
|
|
14
|
-
label: 'COMMENT_ADDED',
|
|
15
|
-
description: '{"commentId":"00005LQ","createdBy":"denis.tkachev","createdTime":1623229206252,"modifiedTime":1623229206252,"deleted":false,"visibility":"public","status":"open","objectId":"entities/1BKYwm2t","objectType":"entity","permanentLink":"https://tst-01.reltio.com/ui/uitest3/#p~com.reltio.plugins.entity.HCPPerspective_e~entities%2F1BKYwm2t_ps~profile_cmt~00005LQ","relatedObjectUris":["entities/1BKYwm2t"]}',
|
|
16
|
-
timestamp: 1623229209927,
|
|
17
|
-
items: [
|
|
18
|
-
{
|
|
19
|
-
id: '5pUxeNLr',
|
|
20
|
-
user: 'denis.tkachev',
|
|
21
|
-
method: 'POST',
|
|
22
|
-
url: '/reltio/api/uitest3/activities',
|
|
23
|
-
clientType: 'UNKNOWN',
|
|
24
|
-
timestamp: 1623229209927
|
|
25
|
-
}
|
|
26
|
-
],
|
|
27
|
-
itemsTotal: 1
|
|
28
|
-
};
|
|
9
|
+
var CommentActivity_1 = require("./CommentActivity");
|
|
10
|
+
describe('Comment activity tests', function () {
|
|
29
11
|
it('should render correctly', function () {
|
|
30
|
-
|
|
31
|
-
|
|
12
|
+
(0, react_2.render)(react_1.default.createElement(CommentActivity_1.CommentActivity, { type: types_1.ActivityTypes.COMMENT_ADDED }));
|
|
13
|
+
react_2.screen.getByText('Comment added');
|
|
32
14
|
});
|
|
33
15
|
});
|
package/cjs/features/activity-log/ActivitiesFactory/components/GroupActivity/GroupActivity.js
CHANGED
|
@@ -5,16 +5,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.GroupActivity = void 0;
|
|
7
7
|
var react_1 = __importDefault(require("react"));
|
|
8
|
-
var ActivityTitle_1 = require("../../../ActivityTitle");
|
|
9
8
|
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
10
9
|
var MdmModuleContext_1 = require("../../../../../contexts/MdmModuleContext");
|
|
10
|
+
var ActivityTitle_1 = require("../../../ActivityTitle");
|
|
11
11
|
var ObjectLabel_1 = require("../ObjectLabel");
|
|
12
12
|
var GroupActivity = function (_a) {
|
|
13
13
|
var _b, _c;
|
|
14
14
|
var data = _a.data, type = _a.type;
|
|
15
15
|
var metadata = (0, MdmModuleContext_1.useMdmMetadata)();
|
|
16
16
|
var label = (0, mdm_sdk_1.getGroupLabelByTypeUri)(metadata, (_c = (_b = data.items) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.objectType);
|
|
17
|
-
return (react_1.default.createElement(ActivityTitle_1.ActivityTitle, { type: type },
|
|
17
|
+
return (react_1.default.createElement(ActivityTitle_1.ActivityTitle, { type: type, "data-reltio-id": "group-activity" },
|
|
18
18
|
react_1.default.createElement(ObjectLabel_1.ObjectLabel, { label: (0, mdm_sdk_1.getLabel)(label) })));
|
|
19
19
|
};
|
|
20
20
|
exports.GroupActivity = GroupActivity;
|
package/cjs/features/activity-log/ActivitiesFactory/components/GroupActivity/GroupActivity.test.js
CHANGED
|
@@ -20,12 +20,7 @@ var MdmModuleContext_1 = require("../../../../../contexts/MdmModuleContext");
|
|
|
20
20
|
var types_1 = require("../../../types");
|
|
21
21
|
var GroupActivity_1 = require("./GroupActivity");
|
|
22
22
|
var metadata = {
|
|
23
|
-
groupTypes: [
|
|
24
|
-
{
|
|
25
|
-
uri: 'configuration/groupTypes/Test',
|
|
26
|
-
label: 'Test group'
|
|
27
|
-
}
|
|
28
|
-
]
|
|
23
|
+
groupTypes: [{ uri: 'configuration/groupTypes/Test', label: 'Test group' }]
|
|
29
24
|
};
|
|
30
25
|
var setUp = function (props) {
|
|
31
26
|
var Providers = function (_a) {
|
|
@@ -34,28 +29,13 @@ var setUp = function (props) {
|
|
|
34
29
|
};
|
|
35
30
|
return (0, react_2.render)(react_1.default.createElement(GroupActivity_1.GroupActivity, __assign({}, props)), { wrapper: Providers });
|
|
36
31
|
};
|
|
37
|
-
describe('
|
|
32
|
+
describe('Group activity tests', function () {
|
|
38
33
|
it('should render correctly', function () {
|
|
39
34
|
var data = {
|
|
40
35
|
uri: 'activities/d6e61e96-6310-434a-99f9-e694e5f35475',
|
|
41
36
|
user: 'alexander.kirsanov',
|
|
42
37
|
timestamp: 1621874356842,
|
|
43
|
-
items: [
|
|
44
|
-
{
|
|
45
|
-
id: '7a5l7pc1',
|
|
46
|
-
user: 'alexander.kirsanov',
|
|
47
|
-
method: 'POST',
|
|
48
|
-
url: '/reltio/api/alenat/groups/7a5l7h5V/members',
|
|
49
|
-
clientType: 'Reltio UI',
|
|
50
|
-
timestamp: 1621874356842,
|
|
51
|
-
objectUri: 'groups/7a5l7h5V',
|
|
52
|
-
objectType: 'configuration/groupTypes/Test',
|
|
53
|
-
data: {
|
|
54
|
-
type: 'GROUP_CHANGED'
|
|
55
|
-
},
|
|
56
|
-
eventId: '1621874356842_1AeizH7'
|
|
57
|
-
}
|
|
58
|
-
],
|
|
38
|
+
items: [{ id: 'sh2Ks8AN', timestamp: 1621874356842, objectType: 'configuration/groupTypes/Test' }],
|
|
59
39
|
itemsTotal: 1
|
|
60
40
|
};
|
|
61
41
|
var props = { type: types_1.ActivityTypes.GROUP_CHANGED, data: data };
|
package/cjs/features/activity-log/ActivitiesFactory/components/MergeActivity/MergeActivity.js
CHANGED
|
@@ -13,8 +13,8 @@ var MergeActivity = function (_a) {
|
|
|
13
13
|
var type = _a.type, data = _a.data;
|
|
14
14
|
var itemsTotal = data.itemsTotal, items = data.items, uri = data.uri;
|
|
15
15
|
var isMinimized = itemsTotal === 1 && !(items[0].data.potentialMatches || items[0].data.newUri);
|
|
16
|
-
return (react_1.default.createElement("div",
|
|
17
|
-
react_1.default.createElement(ActivityTitle_1.ActivityTitle, { type: type }, isMinimized && react_1.default.createElement(EntityObject_1.EntityObject, { item: items[0] })),
|
|
16
|
+
return (react_1.default.createElement("div", { "data-reltio-id": "merge-activity" },
|
|
17
|
+
react_1.default.createElement(ActivityTitle_1.ActivityTitle, { type: type, "data-reltio-id": "merge-activity-title" }, isMinimized && react_1.default.createElement(EntityObject_1.EntityObject, { item: items[0] })),
|
|
18
18
|
!isMinimized && (react_1.default.createElement(CollapsibleActivityRecords_1.CollapsibleActivityRecords, { activityUri: uri, items: items, RecordComponent: PotentialMatchRecord_1.PotentialMatchRecord }))));
|
|
19
19
|
};
|
|
20
20
|
exports.MergeActivity = MergeActivity;
|
package/cjs/features/activity-log/ActivitiesFactory/components/MergeActivity/MergeActivity.test.js
CHANGED
|
@@ -1,113 +1,92 @@
|
|
|
1
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
|
+
};
|
|
2
13
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
15
|
};
|
|
5
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
17
|
var react_1 = __importDefault(require("react"));
|
|
7
|
-
var
|
|
8
|
-
var
|
|
18
|
+
var react_2 = require("@testing-library/react");
|
|
19
|
+
var MdmModuleContext_1 = require("../../../../../contexts/MdmModuleContext");
|
|
9
20
|
var types_1 = require("../../../types");
|
|
10
|
-
var
|
|
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
|
-
uri: 'activities/8dcbdbce-80ac-4a2c-95f3-e75383fbd10e',
|
|
40
|
-
user: 'denis.tkachev',
|
|
41
|
-
label: '',
|
|
42
|
-
description: '',
|
|
43
|
-
timestamp: 1623153008977,
|
|
44
|
-
items: [
|
|
45
|
-
{
|
|
46
|
-
id: '3Ldt0URn',
|
|
47
|
-
user: 'denis.tkachev',
|
|
48
|
-
method: 'POST',
|
|
49
|
-
url: '/reltio/api/uitest3/entities/_same',
|
|
50
|
-
clientType: 'Reltio UI',
|
|
51
|
-
timestamp: 1623153008977,
|
|
52
|
-
objectUri: 'entities/1BTrULsq',
|
|
53
|
-
objectType: 'configuration/entityTypes/HCP',
|
|
54
|
-
objectLabel: 'Long,',
|
|
55
|
-
data: {
|
|
56
|
-
mergeReason: 'Merge by hand',
|
|
57
|
-
mergeType: 'MANUAL',
|
|
58
|
-
potentialMatches: 'entities/17U7U95d',
|
|
59
|
-
'entities/17U7U95d': 'Potential match test,',
|
|
60
|
-
type: 'ENTITIES_MERGED_MANUALLY'
|
|
61
|
-
},
|
|
62
|
-
eventId: '1623153008977_03D3dbM'
|
|
63
|
-
}
|
|
64
|
-
],
|
|
65
|
-
itemsTotal: 1
|
|
66
|
-
};
|
|
67
|
-
var dataNewUri = {
|
|
68
|
-
uri: 'activities/9449a5d7-1c72-4256-b26a-8b0e95c14899',
|
|
69
|
-
user: 'marat.ahmetzyanov',
|
|
70
|
-
label: '',
|
|
71
|
-
description: '',
|
|
72
|
-
timestamp: 1623154966758,
|
|
73
|
-
items: [
|
|
74
|
-
{
|
|
75
|
-
id: '30tEIJXx',
|
|
76
|
-
user: 'marat.ahmetzyanov',
|
|
77
|
-
method: 'POST',
|
|
78
|
-
url: '/reltio/api/uitest3/entities/1futW9kc/_unmerge',
|
|
79
|
-
clientType: 'Reltio UI',
|
|
80
|
-
timestamp: 1623154966758,
|
|
81
|
-
objectUri: 'entities/1futW9kc',
|
|
82
|
-
objectType: 'configuration/entityTypes/HCP',
|
|
83
|
-
objectLabel: 'HCP DT 1,',
|
|
84
|
-
data: {
|
|
85
|
-
'entities/2eIQy30G': 'HCP DT 2,',
|
|
86
|
-
newUri: 'entities/2eIQy30G',
|
|
87
|
-
type: 'ENTITIES_SPLITTED'
|
|
88
|
-
},
|
|
89
|
-
eventId: '1623154966758_02lA3ja'
|
|
90
|
-
}
|
|
91
|
-
],
|
|
92
|
-
itemsTotal: 1
|
|
21
|
+
var CollapsibleItemsContext_1 = require("../../../contexts/CollapsibleItemsContext");
|
|
22
|
+
var MergeActivity_1 = require("./MergeActivity");
|
|
23
|
+
var defaultItem = {
|
|
24
|
+
id: '5C94p4Yp',
|
|
25
|
+
objectUri: 'entities/1PN94HrW',
|
|
26
|
+
objectLabel: 'object label',
|
|
27
|
+
timestamp: 1620711408828,
|
|
28
|
+
data: { type: types_1.ActivityTypes.ENTITIES_MERGED_ON_THE_FLY }
|
|
29
|
+
};
|
|
30
|
+
var defaultData = {
|
|
31
|
+
uri: 'activities/156a1eda-4c2c-46e3-8550-118c500fb453',
|
|
32
|
+
user: 'marat.ahmetzyanov',
|
|
33
|
+
timestamp: 1620711408828,
|
|
34
|
+
items: [defaultItem],
|
|
35
|
+
itemsTotal: 1
|
|
36
|
+
};
|
|
37
|
+
var defaultProps = {
|
|
38
|
+
data: defaultData,
|
|
39
|
+
type: types_1.ActivityTypes.ENTITIES_MERGED_ON_THE_FLY
|
|
40
|
+
};
|
|
41
|
+
var defaultMdmValues = {
|
|
42
|
+
uiPath: 'https://reltio.com/nui'
|
|
43
|
+
};
|
|
44
|
+
var setUp = function (_a) {
|
|
45
|
+
var _b = _a === void 0 ? {} : _a, _c = _b.props, props = _c === void 0 ? defaultProps : _c, _d = _b.mdmValues, mdmValues = _d === void 0 ? defaultMdmValues : _d;
|
|
46
|
+
var Providers = function (_a) {
|
|
47
|
+
var children = _a.children;
|
|
48
|
+
return (react_1.default.createElement(MdmModuleContext_1.MdmModuleProvider, { values: mdmValues },
|
|
49
|
+
react_1.default.createElement(CollapsibleItemsContext_1.CollapsibleItemsProvider, null, children)));
|
|
93
50
|
};
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
51
|
+
return (0, react_2.render)(react_1.default.createElement(MergeActivity_1.MergeActivity, __assign({}, props)), { wrapper: Providers });
|
|
52
|
+
};
|
|
53
|
+
describe('Merge activity tests', function () {
|
|
54
|
+
it('should render minimized if itemsTotal is 1 and there are not potentialMatches or newUri fields', function () {
|
|
55
|
+
setUp();
|
|
56
|
+
var title = react_2.screen.getByTestId('merge-activity-title');
|
|
57
|
+
(0, react_2.within)(title).getByText('object label');
|
|
58
|
+
(0, react_2.within)(title).getByText('Profile merged on the fly');
|
|
59
|
+
});
|
|
60
|
+
it('should render maximized if itemsTotal is 1 but there is potentialMatches field', function () {
|
|
61
|
+
var props = __assign(__assign({}, defaultProps), { data: __assign(__assign({}, defaultData), { items: [
|
|
62
|
+
__assign(__assign({}, defaultItem), { data: {
|
|
63
|
+
type: types_1.ActivityTypes.POTENTIAL_MATCHES_FOUND,
|
|
64
|
+
potentialMatches: 'entities/sOoSQYm',
|
|
65
|
+
'entities/sOoSQYm': 'entity label 1'
|
|
66
|
+
} })
|
|
67
|
+
] }) });
|
|
68
|
+
setUp({ props: props });
|
|
69
|
+
var title = react_2.screen.getByTestId('merge-activity-title');
|
|
70
|
+
(0, react_2.within)(title).getByText('Profile merged on the fly');
|
|
71
|
+
expect((0, react_2.within)(title).queryByText('object label')).not.toBeInTheDocument();
|
|
72
|
+
var record = react_2.screen.getByTestId('reltio-activity-log-record');
|
|
73
|
+
(0, react_2.within)(record).getByText('object label');
|
|
74
|
+
expect(react_2.screen.getByTestId('potential-matches-field')).toHaveTextContent('Matches found:entity label 1');
|
|
98
75
|
});
|
|
99
|
-
it('should render
|
|
100
|
-
var
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
expect(
|
|
111
|
-
|
|
76
|
+
it('should render maximized if itemsTotal is 1 but there is newUri field', function () {
|
|
77
|
+
var props = __assign(__assign({}, defaultProps), { data: __assign(__assign({}, defaultData), { items: [
|
|
78
|
+
__assign(__assign({}, defaultItem), { data: {
|
|
79
|
+
type: types_1.ActivityTypes.ENTITIES_SPLITTED,
|
|
80
|
+
newUri: 'entities/sOoSQYm',
|
|
81
|
+
'entities/sOoSQYm': 'entity label 1'
|
|
82
|
+
} })
|
|
83
|
+
] }) });
|
|
84
|
+
setUp({ props: props });
|
|
85
|
+
var title = react_2.screen.getByTestId('merge-activity-title');
|
|
86
|
+
(0, react_2.within)(title).getByText('Profile merged on the fly');
|
|
87
|
+
expect((0, react_2.within)(title).queryByText('object label')).not.toBeInTheDocument();
|
|
88
|
+
var record = react_2.screen.getByTestId('reltio-activity-log-record');
|
|
89
|
+
(0, react_2.within)(record).getByText('object label');
|
|
90
|
+
expect(react_2.screen.getByTestId('potential-matches-field')).toHaveTextContent('Un-merged with:entity label 1');
|
|
112
91
|
});
|
|
113
92
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
type Props = {
|
|
2
|
+
type Props = Omit<React.ComponentPropsWithoutRef<'span'>, 'className'> & {
|
|
3
3
|
label: string;
|
|
4
4
|
};
|
|
5
|
-
export declare const ObjectLabel: ({ label }: Props) => React.JSX.Element;
|
|
5
|
+
export declare const ObjectLabel: ({ label, ...restProps }: Props) => React.JSX.Element;
|
|
6
6
|
export {};
|