@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
|
@@ -1,55 +1,76 @@
|
|
|
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
|
+
};
|
|
1
12
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
13
|
+
import { render, screen } from '@testing-library/react';
|
|
14
|
+
import { MdmModuleProvider } from '../../../../../contexts/MdmModuleContext';
|
|
4
15
|
import { ActivityTypes } from '../../../types';
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
objectType: 'configuration/entityTypes/HCP',
|
|
34
|
-
objectLabel: '- cBtCASwtAeEbTxe Agacati',
|
|
35
|
-
data: {
|
|
36
|
-
potentialMatches: 'entities/10hy6j0b,entities/a,entities/b,entities/c',
|
|
37
|
-
type: 'POTENTIAL_MATCHES_FOUND',
|
|
38
|
-
'entities/10hy6j0b': '- cBtCASwtAeEbTxe Agacati',
|
|
39
|
-
'entities/a': 'first',
|
|
40
|
-
'entities/b': 'second',
|
|
41
|
-
'entities/c': 'third'
|
|
42
|
-
},
|
|
43
|
-
eventId: '1621250963640_02f5sXY'
|
|
16
|
+
import { CollapsibleItemsProvider } from '../../../contexts/CollapsibleItemsContext';
|
|
17
|
+
import { PotentialMatchActivity } from './PotentialMatchActivity';
|
|
18
|
+
var defaultData = {
|
|
19
|
+
uri: 'activities/156a1eda-4c2c-46e3-8550-118c500fb453',
|
|
20
|
+
user: 'marat.ahmetzyanov',
|
|
21
|
+
timestamp: 1620711408828,
|
|
22
|
+
items: [
|
|
23
|
+
{
|
|
24
|
+
id: '5C94p4Yp',
|
|
25
|
+
objectUri: 'entities/1PN94HrW',
|
|
26
|
+
objectLabel: 'item 1 label',
|
|
27
|
+
timestamp: 1620711408828,
|
|
28
|
+
data: {
|
|
29
|
+
type: ActivityTypes.ENTITIES_SPLITTED,
|
|
30
|
+
newUri: 'entities/sOoSQYm',
|
|
31
|
+
'entities/sOoSQYm': 'item 1 entity label 1'
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
id: '72Jsk10Kl',
|
|
36
|
+
objectUri: 'entities/KsJmn28A',
|
|
37
|
+
objectLabel: 'item 2 label',
|
|
38
|
+
timestamp: 1620711404672,
|
|
39
|
+
data: {
|
|
40
|
+
type: ActivityTypes.POTENTIAL_MATCHES_FOUND,
|
|
41
|
+
potentialMatches: 'entities/sOoSQYm,entities/o92Bsm1',
|
|
42
|
+
'entities/sOoSQYm': 'item 2 entity label 1',
|
|
43
|
+
'entities/o92Bsm1': 'item 2 entity label 2'
|
|
44
44
|
}
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
itemsTotal: 2
|
|
48
|
+
};
|
|
49
|
+
var defaultProps = {
|
|
50
|
+
data: defaultData,
|
|
51
|
+
type: ActivityTypes.ENTITIES_SPLITTED
|
|
52
|
+
};
|
|
53
|
+
var defaultMdmValues = {
|
|
54
|
+
uiPath: 'https://reltio.com/nui'
|
|
55
|
+
};
|
|
56
|
+
var setUp = function (_a) {
|
|
57
|
+
var _b = _a === void 0 ? {} : _a, _c = _b.props, props = _c === void 0 ? defaultProps : _c, _d = _b.mdmValues, mdmValues = _d === void 0 ? defaultMdmValues : _d;
|
|
58
|
+
var Providers = function (_a) {
|
|
59
|
+
var children = _a.children;
|
|
60
|
+
return (React.createElement(MdmModuleProvider, { values: mdmValues },
|
|
61
|
+
React.createElement(CollapsibleItemsProvider, null, children)));
|
|
47
62
|
};
|
|
63
|
+
return render(React.createElement(PotentialMatchActivity, __assign({}, props)), { wrapper: Providers });
|
|
64
|
+
};
|
|
65
|
+
describe('Potential match activity tests', function () {
|
|
48
66
|
it('should render correctly', function () {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
var
|
|
52
|
-
expect(
|
|
53
|
-
expect(
|
|
67
|
+
setUp();
|
|
68
|
+
screen.getByText('Profile un-merged');
|
|
69
|
+
var records = screen.getAllByTestId('reltio-activity-log-record');
|
|
70
|
+
expect(records).toHaveLength(2);
|
|
71
|
+
expect(records[0]).toHaveTextContent('item 1 label');
|
|
72
|
+
expect(records[0]).toHaveTextContent('Un-merged with:item 1 entity label 1');
|
|
73
|
+
expect(records[1]).toHaveTextContent('item 2 label');
|
|
74
|
+
expect(records[1]).toHaveTextContent('Matches found:item 2 entity label 1, item 2 entity label 2');
|
|
54
75
|
});
|
|
55
76
|
});
|
package/esm/features/activity-log/ActivitiesFactory/components/ProfileActivity/ProfileActivity.js
CHANGED
|
@@ -7,7 +7,7 @@ export var ProfileActivity = function (_a) {
|
|
|
7
7
|
var _b;
|
|
8
8
|
var type = _a.type, data = _a.data;
|
|
9
9
|
var isMinimized = data.itemsTotal === 1 && !((_b = data.items[0].deltaCollection) === null || _b === void 0 ? void 0 : _b.delta);
|
|
10
|
-
return (React.createElement("div",
|
|
11
|
-
React.createElement(ActivityTitle, { type: type }, isMinimized && React.createElement(EntityObject, { item: data.items[0] })),
|
|
10
|
+
return (React.createElement("div", { "data-reltio-id": "profile-activity" },
|
|
11
|
+
React.createElement(ActivityTitle, { type: type, "data-reltio-id": "profile-activity-title" }, isMinimized && React.createElement(EntityObject, { item: data.items[0] })),
|
|
12
12
|
!isMinimized && (React.createElement(CollapsibleActivityRecords, { activityUri: data.uri, items: data.items, RecordComponent: EntityRecord }))));
|
|
13
13
|
};
|
|
@@ -10,119 +10,135 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import React from 'react';
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
13
|
+
import { render, screen, within } from '@testing-library/react';
|
|
14
|
+
import { MdmModuleProvider } from '../../../../../contexts/MdmModuleContext';
|
|
15
15
|
import { ActivityTypes } from '../../../types';
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
user: 'alexander.kirsanov',
|
|
21
|
-
timestamp: 1622096971385,
|
|
22
|
-
items: [
|
|
23
|
-
{
|
|
24
|
-
id: '30Y8UsZr',
|
|
25
|
-
user: 'alexander.kirsanov',
|
|
26
|
-
method: 'PUT',
|
|
27
|
-
url: '/reltio/api/alenat/entities/k5nO0xA/attributes/TextField/3UIcE257b',
|
|
28
|
-
clientType: 'Reltio UI',
|
|
29
|
-
timestamp: 1622096971385,
|
|
30
|
-
objectUri: 'entities/k5nO0xA',
|
|
31
|
-
objectType: 'configuration/entityTypes/HCP',
|
|
32
|
-
objectLabel: 'BulkUpdate_regression_3 Label_test_Long_label_test_long_long_long_long_long - RelationTableViewss - New Address for HCP_Bulk_Update with long_label Londomir',
|
|
33
|
-
data: {
|
|
34
|
-
type: 'ENTITY_CHANGED'
|
|
35
|
-
},
|
|
36
|
-
deltaCollection: {
|
|
37
|
-
ovChanged: true,
|
|
38
|
-
delta: [
|
|
39
|
-
{
|
|
40
|
-
type: 'ATTRIBUTE_CHANGED',
|
|
41
|
-
attributeType: 'configuration/entityTypes/HCP/attributes/TextField',
|
|
42
|
-
newValue: {
|
|
43
|
-
value: 'Str31',
|
|
44
|
-
ov: true,
|
|
45
|
-
id: '3UIcE257b',
|
|
46
|
-
sources: ['Reltio']
|
|
47
|
-
},
|
|
48
|
-
oldValue: {
|
|
49
|
-
value: 'Str1',
|
|
50
|
-
ov: true,
|
|
51
|
-
id: '3UIcE257b',
|
|
52
|
-
sources: ['Reltio']
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
]
|
|
56
|
-
},
|
|
57
|
-
eventId: '1622096971385_03DVkNW'
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
id: '30Y8UsZr',
|
|
61
|
-
user: 'alexander.kirsanov',
|
|
62
|
-
method: 'PUT',
|
|
63
|
-
url: '/reltio/api/alenat/entities/k5nO0xA/attributes/TextField/3UIcE257b',
|
|
64
|
-
clientType: 'Reltio UI',
|
|
65
|
-
timestamp: 1622096971385,
|
|
66
|
-
objectUri: 'entities/k5nO0xA',
|
|
67
|
-
objectType: 'configuration/entityTypes/HCP',
|
|
68
|
-
objectLabel: 'BulkUpdate_regression_3 Label_test_Long_label_test_long_long_long_long_long - RelationTableViewss - New Address for HCP_Bulk_Update with long_label Londomir',
|
|
69
|
-
data: {
|
|
70
|
-
type: 'ENTITY_CHANGED'
|
|
71
|
-
},
|
|
72
|
-
deltaCollection: {
|
|
73
|
-
ovChanged: true,
|
|
74
|
-
delta: [
|
|
75
|
-
{
|
|
76
|
-
type: 'ATTRIBUTE_CHANGED',
|
|
77
|
-
attributeType: 'configuration/entityTypes/HCP/attributes/TextField',
|
|
78
|
-
newValue: {
|
|
79
|
-
value: 'Str31',
|
|
80
|
-
ov: true,
|
|
81
|
-
id: '3UIcE257b',
|
|
82
|
-
sources: ['Reltio']
|
|
83
|
-
},
|
|
84
|
-
oldValue: {
|
|
85
|
-
value: 'Str1',
|
|
86
|
-
ov: true,
|
|
87
|
-
id: '3UIcE257b',
|
|
88
|
-
sources: ['Reltio']
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
]
|
|
92
|
-
},
|
|
93
|
-
eventId: '1622096971385_03DVkNW'
|
|
94
|
-
}
|
|
95
|
-
],
|
|
96
|
-
itemsTotal: 1
|
|
97
|
-
};
|
|
98
|
-
var itemWithoutDelta = {
|
|
16
|
+
import { CollapsibleItemsProvider } from '../../../contexts/CollapsibleItemsContext';
|
|
17
|
+
import { ProfileActivity } from './ProfileActivity';
|
|
18
|
+
var defaultItems = [
|
|
19
|
+
{
|
|
99
20
|
id: '30Y8UsZr',
|
|
100
|
-
user: 'alexander.kirsanov',
|
|
101
|
-
method: 'PUT',
|
|
102
|
-
url: '/reltio/api/alenat/entities/k5nO0xA/attributes/TextField/3UIcE257b',
|
|
103
|
-
clientType: 'Reltio UI',
|
|
104
21
|
timestamp: 1622096971385,
|
|
105
22
|
objectUri: 'entities/k5nO0xA',
|
|
106
23
|
objectType: 'configuration/entityTypes/HCP',
|
|
107
|
-
objectLabel: '
|
|
108
|
-
data: {
|
|
109
|
-
|
|
110
|
-
|
|
24
|
+
objectLabel: 'item 1',
|
|
25
|
+
data: { type: ActivityTypes.ENTITY_CHANGED },
|
|
26
|
+
deltaCollection: {
|
|
27
|
+
ovChanged: true,
|
|
28
|
+
delta: [
|
|
29
|
+
{
|
|
30
|
+
type: 'ATTRIBUTE_CHANGED',
|
|
31
|
+
attributeType: 'configuration/entityTypes/HCP/attributes/TextField',
|
|
32
|
+
newValue: { value: 'new value', ov: true, id: '3UIcE257b', sources: ['Reltio'] },
|
|
33
|
+
oldValue: { value: 'old value', ov: true, id: '3UIcE257b', sources: ['Reltio'] }
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
id: 'o8NMgwA3',
|
|
40
|
+
timestamp: 1622096971385,
|
|
41
|
+
objectUri: 'entities/jD9maD2',
|
|
42
|
+
objectType: 'configuration/entityTypes/HCP',
|
|
43
|
+
objectLabel: 'item 2',
|
|
44
|
+
data: { type: ActivityTypes.ENTITY_CHANGED },
|
|
111
45
|
deltaCollection: {
|
|
112
|
-
ovChanged:
|
|
113
|
-
|
|
114
|
-
|
|
46
|
+
ovChanged: true,
|
|
47
|
+
delta: [
|
|
48
|
+
{
|
|
49
|
+
type: 'ATTRIBUTE_REMOVED',
|
|
50
|
+
attributeType: 'configuration/entityTypes/HCP/attributes/TextField',
|
|
51
|
+
oldValue: { value: 'removed value', ov: true, id: 'jd9SamA', sources: ['Reltio'] }
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
];
|
|
57
|
+
var defaultData = {
|
|
58
|
+
uri: 'activities/f0efd6b4-129b-4379-a37c-ac2c08e3f2a5',
|
|
59
|
+
user: 'alexander.kirsanov',
|
|
60
|
+
timestamp: 1622096971385,
|
|
61
|
+
items: defaultItems,
|
|
62
|
+
itemsTotal: 2
|
|
63
|
+
};
|
|
64
|
+
var defaultProps = {
|
|
65
|
+
data: defaultData,
|
|
66
|
+
type: ActivityTypes.ENTITY_CHANGED
|
|
67
|
+
};
|
|
68
|
+
var defaultMdmValues = {
|
|
69
|
+
metadata: {
|
|
70
|
+
entityTypes: [
|
|
71
|
+
{
|
|
72
|
+
uri: 'configuration/entityTypes/HCP',
|
|
73
|
+
label: 'HCP',
|
|
74
|
+
attributes: [
|
|
75
|
+
{
|
|
76
|
+
label: 'String',
|
|
77
|
+
name: 'TextField',
|
|
78
|
+
type: 'String',
|
|
79
|
+
uri: 'configuration/entityTypes/HCP/attributes/TextField'
|
|
80
|
+
}
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
uiPath: 'https://reltio.com/nui'
|
|
86
|
+
};
|
|
87
|
+
var setUp = function (_a) {
|
|
88
|
+
var _b = _a === void 0 ? {} : _a, _c = _b.props, props = _c === void 0 ? defaultProps : _c, _d = _b.mdmValues, mdmValues = _d === void 0 ? defaultMdmValues : _d;
|
|
89
|
+
var Providers = function (_a) {
|
|
90
|
+
var children = _a.children;
|
|
91
|
+
return (React.createElement(MdmModuleProvider, { values: mdmValues },
|
|
92
|
+
React.createElement(CollapsibleItemsProvider, null, children)));
|
|
115
93
|
};
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
var
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
94
|
+
return render(React.createElement(ProfileActivity, __assign({}, props)), { wrapper: Providers });
|
|
95
|
+
};
|
|
96
|
+
describe('Profile activity tests', function () {
|
|
97
|
+
it('should render minimized if itemsTotal is 1 and there is not delta field', function () {
|
|
98
|
+
var props = __assign(__assign({}, defaultProps), { data: __assign(__assign({}, defaultData), { items: [
|
|
99
|
+
{
|
|
100
|
+
id: '30Y8UsZr',
|
|
101
|
+
timestamp: 1622096971385,
|
|
102
|
+
objectUri: 'entities/k5nO0xA',
|
|
103
|
+
objectType: 'configuration/entityTypes/HCP',
|
|
104
|
+
objectLabel: 'item 1',
|
|
105
|
+
data: { type: ActivityTypes.ENTITY_CHANGED }
|
|
106
|
+
}
|
|
107
|
+
], itemsTotal: 1 }) });
|
|
108
|
+
setUp({ props: props });
|
|
109
|
+
var title = screen.getByTestId('profile-activity-title');
|
|
110
|
+
within(title).getByText('item 1');
|
|
111
|
+
within(title).getByText('Profile updated');
|
|
112
|
+
expect(screen.queryByTestId('reltio-activity-log-record')).not.toBeInTheDocument();
|
|
113
|
+
});
|
|
114
|
+
it('should render maximized if itemsTotal is 1 but there is delta field', function () {
|
|
115
|
+
var props = __assign(__assign({}, defaultProps), { data: __assign(__assign({}, defaultData), { items: defaultItems.slice(0, 1), itemsTotal: 1 }) });
|
|
116
|
+
setUp({ props: props });
|
|
117
|
+
var title = screen.getByTestId('profile-activity-title');
|
|
118
|
+
within(title).getByText('Profile updated');
|
|
119
|
+
expect(within(title).queryByText('item 1')).not.toBeInTheDocument();
|
|
120
|
+
var record = screen.getByTestId('reltio-activity-log-record');
|
|
121
|
+
within(record).getByText('item 1');
|
|
122
|
+
expect(record).toHaveTextContent('String:');
|
|
123
|
+
expect(record).toHaveTextContent('old value');
|
|
124
|
+
expect(record).toHaveTextContent('new value');
|
|
125
|
+
expect(record).toHaveTextContent('edited');
|
|
126
|
+
});
|
|
127
|
+
it('should render maximized if itemsTotal is not 1', function () {
|
|
128
|
+
setUp();
|
|
129
|
+
var title = screen.getByTestId('profile-activity-title');
|
|
130
|
+
within(title).getByText('Profile updated');
|
|
131
|
+
expect(within(title).queryByText('item 1')).not.toBeInTheDocument();
|
|
132
|
+
expect(within(title).queryByText('item 2')).not.toBeInTheDocument();
|
|
133
|
+
var records = screen.getAllByTestId('reltio-activity-log-record');
|
|
134
|
+
within(records[0]).getByText('item 1');
|
|
135
|
+
expect(records[0]).toHaveTextContent('String:');
|
|
136
|
+
expect(records[0]).toHaveTextContent('old value');
|
|
137
|
+
expect(records[0]).toHaveTextContent('new value');
|
|
138
|
+
expect(records[0]).toHaveTextContent('edited');
|
|
139
|
+
within(records[1]).getByText('item 2');
|
|
140
|
+
expect(records[1]).toHaveTextContent('String:');
|
|
141
|
+
expect(records[1]).toHaveTextContent('removed value');
|
|
142
|
+
expect(records[1]).toHaveTextContent('deleted');
|
|
127
143
|
});
|
|
128
144
|
});
|
package/esm/features/activity-log/ActivitiesFactory/components/RelationActivity/RelationActivity.js
CHANGED
|
@@ -7,7 +7,7 @@ export var RelationActivity = function (_a) {
|
|
|
7
7
|
var _b;
|
|
8
8
|
var type = _a.type, data = _a.data;
|
|
9
9
|
var isMinimized = data.itemsTotal === 1 && !((_b = data.items[0].deltaCollection) === null || _b === void 0 ? void 0 : _b.delta);
|
|
10
|
-
return (React.createElement("div",
|
|
11
|
-
React.createElement(ActivityTitle, { type: type }, isMinimized && React.createElement(RelationObject, { item: data.items[0] })),
|
|
10
|
+
return (React.createElement("div", { "data-reltio-id": "relation-activity" },
|
|
11
|
+
React.createElement(ActivityTitle, { type: type, "data-reltio-id": "relation-activity-title" }, isMinimized && React.createElement(RelationObject, { item: data.items[0] })),
|
|
12
12
|
!isMinimized && (React.createElement(CollapsibleActivityRecords, { activityUri: data.uri, items: data.items, RecordComponent: RelationRecord }))));
|
|
13
13
|
};
|
|
@@ -10,129 +10,142 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import React from 'react';
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
13
|
+
import { render, screen, within } from '@testing-library/react';
|
|
14
|
+
import { MdmModuleProvider } from '../../../../../contexts/MdmModuleContext';
|
|
15
15
|
import { ActivityTypes } from '../../../types';
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
user: 'egorshkov',
|
|
21
|
-
timestamp: 1621250955807,
|
|
22
|
-
items: [
|
|
23
|
-
{
|
|
24
|
-
id: '89tO5c5G',
|
|
25
|
-
user: 'egorshkov',
|
|
26
|
-
method: 'POST',
|
|
27
|
-
url: '/reltio/api/alenat/entities/10hy6j0b/_update',
|
|
28
|
-
clientType: 'Reltio UI',
|
|
29
|
-
timestamp: 1621250955807,
|
|
30
|
-
objectUri: 'relations/edEoxDC',
|
|
31
|
-
objectType: 'configuration/relationTypes/HasAddress',
|
|
32
|
-
startObjectUri: 'entities/10hy6j0b',
|
|
33
|
-
startObjectLabel: '- cBtCASwtAeEbTxe Agacati',
|
|
34
|
-
endObjectUri: 'entities/1BVkicLG',
|
|
35
|
-
endObjectLabel: 'cBtCASwtAeEbTxe Agacati Nash',
|
|
36
|
-
data: {
|
|
37
|
-
type: 'RELATIONSHIP_CHANGED'
|
|
38
|
-
},
|
|
39
|
-
deltaCollection: {
|
|
40
|
-
ovChanged: true,
|
|
41
|
-
delta: [
|
|
42
|
-
{
|
|
43
|
-
type: 'ATTRIBUTE_CHANGED',
|
|
44
|
-
attributeType: 'configuration/relationTypes/HasAddress/attributes/AddressType',
|
|
45
|
-
newValue: {
|
|
46
|
-
value: 'CLIN',
|
|
47
|
-
ov: true,
|
|
48
|
-
id: '2BY80NuxW',
|
|
49
|
-
sources: ['Reltio']
|
|
50
|
-
},
|
|
51
|
-
oldValue: {
|
|
52
|
-
value: 'BUSI',
|
|
53
|
-
ov: true,
|
|
54
|
-
id: '2BY80NuxW',
|
|
55
|
-
sources: ['Reltio']
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
]
|
|
59
|
-
},
|
|
60
|
-
eventId: '1621250955807_025tRjR'
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
id: '89tO5c5G',
|
|
64
|
-
user: 'egorshkov',
|
|
65
|
-
method: 'POST',
|
|
66
|
-
url: '/reltio/api/alenat/entities/10hy6j0b/_update',
|
|
67
|
-
clientType: 'Reltio UI',
|
|
68
|
-
timestamp: 1621250955807,
|
|
69
|
-
objectUri: 'relations/edEoxDC',
|
|
70
|
-
objectType: 'configuration/relationTypes/HasAddress',
|
|
71
|
-
startObjectUri: 'entities/10hy6j0b',
|
|
72
|
-
startObjectLabel: '- cBtCASwtAeEbTxe Agacati',
|
|
73
|
-
endObjectUri: 'entities/1BVkicLG',
|
|
74
|
-
endObjectLabel: 'cBtCASwtAeEbTxe Agacati Nash',
|
|
75
|
-
data: {
|
|
76
|
-
type: 'RELATIONSHIP_CHANGED'
|
|
77
|
-
},
|
|
78
|
-
deltaCollection: {
|
|
79
|
-
ovChanged: true,
|
|
80
|
-
delta: [
|
|
81
|
-
{
|
|
82
|
-
type: 'ATTRIBUTE_CHANGED',
|
|
83
|
-
attributeType: 'configuration/relationTypes/HasAddress/attributes/AddressType',
|
|
84
|
-
newValue: {
|
|
85
|
-
value: 'CLINS',
|
|
86
|
-
ov: true,
|
|
87
|
-
id: '2BY80NuxW',
|
|
88
|
-
sources: ['Reltio']
|
|
89
|
-
},
|
|
90
|
-
oldValue: {
|
|
91
|
-
value: 'BUSIQ',
|
|
92
|
-
ov: true,
|
|
93
|
-
id: '2BY80NuxW',
|
|
94
|
-
sources: ['Reltio']
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
]
|
|
98
|
-
},
|
|
99
|
-
eventId: '1621250955807_025tRjR'
|
|
100
|
-
}
|
|
101
|
-
],
|
|
102
|
-
itemsTotal: 2
|
|
103
|
-
};
|
|
104
|
-
var itemWithoutDelta = {
|
|
16
|
+
import { CollapsibleItemsProvider } from '../../../contexts/CollapsibleItemsContext';
|
|
17
|
+
import { RelationActivity } from './RelationActivity';
|
|
18
|
+
var defaultItems = [
|
|
19
|
+
{
|
|
105
20
|
id: '89tO5c5G',
|
|
106
|
-
user: 'egorshkov',
|
|
107
|
-
method: 'POST',
|
|
108
|
-
url: '/reltio/api/alenat/entities/10hy6j0b/_update',
|
|
109
|
-
clientType: 'Reltio UI',
|
|
110
21
|
timestamp: 1621250955807,
|
|
111
22
|
objectUri: 'relations/edEoxDC',
|
|
112
23
|
objectType: 'configuration/relationTypes/HasAddress',
|
|
113
24
|
startObjectUri: 'entities/10hy6j0b',
|
|
114
|
-
startObjectLabel: '
|
|
25
|
+
startObjectLabel: 'item 1 start object label',
|
|
115
26
|
endObjectUri: 'entities/1BVkicLG',
|
|
116
|
-
endObjectLabel: '
|
|
117
|
-
data: {
|
|
118
|
-
|
|
119
|
-
|
|
27
|
+
endObjectLabel: 'item 1 end object label',
|
|
28
|
+
data: { type: ActivityTypes.RELATIONSHIP_CHANGED },
|
|
29
|
+
deltaCollection: {
|
|
30
|
+
ovChanged: true,
|
|
31
|
+
delta: [
|
|
32
|
+
{
|
|
33
|
+
type: 'ATTRIBUTE_CHANGED',
|
|
34
|
+
attributeType: 'configuration/relationTypes/HasAddress/attributes/AddressType',
|
|
35
|
+
newValue: { value: 'CLIN', ov: true, id: 'yTn28IobS', sources: ['Reltio'] },
|
|
36
|
+
oldValue: { value: 'BUSI', ov: true, id: 'yTn28IobS', sources: ['Reltio'] }
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
id: '473Jsm3S',
|
|
43
|
+
timestamp: 1621250955807,
|
|
44
|
+
objectUri: 'relations/dK321SxZ',
|
|
45
|
+
objectType: 'configuration/relationTypes/HasAddress',
|
|
46
|
+
startObjectUri: 'entities/l28Nd2Zx',
|
|
47
|
+
startObjectLabel: 'item 2 start object label',
|
|
48
|
+
endObjectUri: 'entities/oP23Nsm3',
|
|
49
|
+
endObjectLabel: 'item 2 end object label',
|
|
50
|
+
data: { type: ActivityTypes.RELATIONSHIP_CHANGED },
|
|
120
51
|
deltaCollection: {
|
|
121
|
-
ovChanged:
|
|
122
|
-
delta:
|
|
123
|
-
|
|
124
|
-
|
|
52
|
+
ovChanged: true,
|
|
53
|
+
delta: [
|
|
54
|
+
{
|
|
55
|
+
type: 'ATTRIBUTE_CHANGED',
|
|
56
|
+
attributeType: 'configuration/relationTypes/HasAddress/attributes/AddressType',
|
|
57
|
+
newValue: { value: 'CLINS', ov: true, id: '2BY80NuxW', sources: ['Reltio'] },
|
|
58
|
+
oldValue: { value: 'BUSIQ', ov: true, id: '2BY80NuxW', sources: ['Reltio'] }
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
];
|
|
64
|
+
var defaultData = {
|
|
65
|
+
uri: 'activities/f0efd6b4-129b-4379-a37c-ac2c08e3f2a5',
|
|
66
|
+
user: 'alexander.kirsanov',
|
|
67
|
+
timestamp: 1622096971385,
|
|
68
|
+
items: defaultItems,
|
|
69
|
+
itemsTotal: 2
|
|
70
|
+
};
|
|
71
|
+
var defaultProps = {
|
|
72
|
+
data: defaultData,
|
|
73
|
+
type: ActivityTypes.RELATIONSHIP_CHANGED
|
|
74
|
+
};
|
|
75
|
+
var defaultMdmValues = {
|
|
76
|
+
metadata: {
|
|
77
|
+
entityTypes: [],
|
|
78
|
+
relationTypes: [
|
|
79
|
+
{
|
|
80
|
+
uri: 'configuration/relationTypes/HasAddress',
|
|
81
|
+
label: 'Has address',
|
|
82
|
+
attributes: [
|
|
83
|
+
{
|
|
84
|
+
label: 'Address type',
|
|
85
|
+
name: 'AddressType',
|
|
86
|
+
type: 'String',
|
|
87
|
+
uri: 'configuration/relationTypes/HasAddress/attributes/AddressType'
|
|
88
|
+
}
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
]
|
|
92
|
+
},
|
|
93
|
+
uiPath: 'https://reltio.com/nui'
|
|
94
|
+
};
|
|
95
|
+
var setUp = function (_a) {
|
|
96
|
+
var _b = _a === void 0 ? {} : _a, _c = _b.props, props = _c === void 0 ? defaultProps : _c, _d = _b.mdmValues, mdmValues = _d === void 0 ? defaultMdmValues : _d;
|
|
97
|
+
var Providers = function (_a) {
|
|
98
|
+
var children = _a.children;
|
|
99
|
+
return (React.createElement(MdmModuleProvider, { values: mdmValues },
|
|
100
|
+
React.createElement(CollapsibleItemsProvider, null, children)));
|
|
125
101
|
};
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
var
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
expect(
|
|
102
|
+
return render(React.createElement(RelationActivity, __assign({}, props)), { wrapper: Providers });
|
|
103
|
+
};
|
|
104
|
+
describe('Relation activity tests', function () {
|
|
105
|
+
it('should render minimized if itemsTotal is 1 and there is not delta field', function () {
|
|
106
|
+
var props = __assign(__assign({}, defaultProps), { data: __assign(__assign({}, defaultData), { items: [__assign(__assign({}, defaultItems[0]), { deltaCollection: undefined })], itemsTotal: 1 }) });
|
|
107
|
+
setUp({ props: props });
|
|
108
|
+
var title = screen.getByTestId('relation-activity-title');
|
|
109
|
+
within(title).getByText('item 1 start object label');
|
|
110
|
+
within(title).getByText('item 1 end object label');
|
|
111
|
+
within(title).getByText('Relationship updated');
|
|
112
|
+
expect(screen.queryByTestId('reltio-activity-log-record')).not.toBeInTheDocument();
|
|
113
|
+
});
|
|
114
|
+
it('should render maximized if itemsTotal is 1 but there is delta field', function () {
|
|
115
|
+
var props = __assign(__assign({}, defaultProps), { data: __assign(__assign({}, defaultData), { items: defaultItems.slice(0, 1), itemsTotal: 1 }) });
|
|
116
|
+
setUp({ props: props });
|
|
117
|
+
var title = screen.getByTestId('relation-activity-title');
|
|
118
|
+
within(title).getByText('Relationship updated');
|
|
119
|
+
expect(within(title).queryByText('item 1 start object label')).not.toBeInTheDocument();
|
|
120
|
+
expect(within(title).queryByText('item 1 end object label')).not.toBeInTheDocument();
|
|
121
|
+
var record = screen.getByTestId('reltio-activity-log-record');
|
|
122
|
+
within(record).getByText('item 1 start object label');
|
|
123
|
+
within(record).getByText('item 1 end object label');
|
|
124
|
+
expect(record).toHaveTextContent('Address type:');
|
|
125
|
+
expect(record).toHaveTextContent('BUSI');
|
|
126
|
+
expect(record).toHaveTextContent('CLIN');
|
|
127
|
+
expect(record).toHaveTextContent('edited');
|
|
128
|
+
});
|
|
129
|
+
it('should render maximized if itemsTotal is not 1', function () {
|
|
130
|
+
setUp();
|
|
131
|
+
var title = screen.getByTestId('relation-activity-title');
|
|
132
|
+
within(title).getByText('Relationship updated');
|
|
133
|
+
expect(within(title).queryByText('item 1 start object label')).not.toBeInTheDocument();
|
|
134
|
+
expect(within(title).queryByText('item 1 end object label')).not.toBeInTheDocument();
|
|
135
|
+
expect(within(title).queryByText('item 2 start object label')).not.toBeInTheDocument();
|
|
136
|
+
expect(within(title).queryByText('item 2 end object label')).not.toBeInTheDocument();
|
|
137
|
+
var records = screen.getAllByTestId('reltio-activity-log-record');
|
|
138
|
+
within(records[0]).getByText('item 1 start object label');
|
|
139
|
+
within(records[0]).getByText('item 1 end object label');
|
|
140
|
+
expect(records[0]).toHaveTextContent('Address type:');
|
|
141
|
+
expect(records[0]).toHaveTextContent('BUSI');
|
|
142
|
+
expect(records[0]).toHaveTextContent('CLIN');
|
|
143
|
+
expect(records[0]).toHaveTextContent('edited');
|
|
144
|
+
within(records[1]).getByText('item 2 start object label');
|
|
145
|
+
within(records[1]).getByText('item 2 end object label');
|
|
146
|
+
expect(records[1]).toHaveTextContent('Address type:');
|
|
147
|
+
expect(records[1]).toHaveTextContent('BUSIQ');
|
|
148
|
+
expect(records[1]).toHaveTextContent('CLINS');
|
|
149
|
+
expect(records[1]).toHaveTextContent('edited');
|
|
137
150
|
});
|
|
138
151
|
});
|