@reltio/components 1.4.1996 → 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.
Files changed (141) hide show
  1. package/cjs/ResizablePanes/ResizablePanes.js +5 -6
  2. package/cjs/features/activity-log/ActivitiesFactory/ActivitiesFactory.d.ts +1 -1
  3. package/cjs/features/activity-log/ActivitiesFactory/ActivitiesFactory.js +1 -1
  4. package/cjs/features/activity-log/ActivitiesFactory/ActivitiesFactory.test.js +267 -0
  5. package/cjs/features/activity-log/ActivitiesFactory/components/CommentActivity/CommentActivity.d.ts +1 -2
  6. package/cjs/features/activity-log/ActivitiesFactory/components/CommentActivity/CommentActivity.js +1 -1
  7. package/cjs/features/activity-log/ActivitiesFactory/components/CommentActivity/CommentActivity.test.js +5 -23
  8. package/cjs/features/activity-log/ActivitiesFactory/components/GroupActivity/GroupActivity.js +2 -2
  9. package/cjs/features/activity-log/ActivitiesFactory/components/GroupActivity/GroupActivity.test.js +3 -23
  10. package/cjs/features/activity-log/ActivitiesFactory/components/MergeActivity/MergeActivity.js +2 -2
  11. package/cjs/features/activity-log/ActivitiesFactory/components/MergeActivity/MergeActivity.test.js +81 -102
  12. package/cjs/features/activity-log/ActivitiesFactory/components/ObjectLabel/ObjectLabel.d.ts +2 -2
  13. package/cjs/features/activity-log/ActivitiesFactory/components/ObjectLabel/ObjectLabel.js +24 -2
  14. package/cjs/features/activity-log/ActivitiesFactory/components/PotentialMatchActivity/PotentialMatchActivity.js +1 -1
  15. package/cjs/features/activity-log/ActivitiesFactory/components/PotentialMatchActivity/PotentialMatchActivity.test.js +69 -48
  16. package/cjs/features/activity-log/ActivitiesFactory/components/ProfileActivity/ProfileActivity.js +2 -2
  17. package/cjs/features/activity-log/ActivitiesFactory/components/ProfileActivity/ProfileActivity.test.js +123 -107
  18. package/cjs/features/activity-log/ActivitiesFactory/components/RelationActivity/RelationActivity.js +2 -2
  19. package/cjs/features/activity-log/ActivitiesFactory/components/RelationActivity/RelationActivity.test.js +128 -115
  20. package/cjs/features/activity-log/ActivitiesFactory/components/SearchActivity/SearchActivity.js +1 -1
  21. package/cjs/features/activity-log/ActivitiesFactory/components/SearchActivity/SearchActivity.test.js +160 -183
  22. package/cjs/features/activity-log/ActivitiesFactory/components/SimpleActivity/SimpleActivity.js +2 -2
  23. package/cjs/features/activity-log/ActivitiesFactory/components/SimpleActivity/SimpleActivity.test.js +44 -28
  24. package/cjs/features/activity-log/ActivitiesFactory/components/SynchronizationIssuesActivity/SynchronizationIssuesActivity.js +4 -5
  25. package/cjs/features/activity-log/ActivitiesFactory/components/SynchronizationIssuesActivity/SynchronizationIssuesActivity.test.js +54 -47
  26. package/cjs/features/activity-log/ActivityLog/ActivityLog.test.js +83 -22
  27. package/cjs/features/activity-log/ActivityLog/components/GroupItem/GroupItem.js +1 -1
  28. package/cjs/features/activity-log/ActivityLogFilter/ActivityLogFilter.test.js +784 -0
  29. package/cjs/features/activity-log/ActivityTitle/ActivityTitle.d.ts +2 -3
  30. package/cjs/features/activity-log/ActivityTitle/ActivityTitle.js +24 -2
  31. package/cjs/features/activity-log/CollapsibleActivityRecords/CollapsibleActivityRecords.test.js +102 -79
  32. package/cjs/features/activity-log/EntityObject/EntityObject.test.js +35 -26
  33. package/cjs/features/activity-log/Field/Field.d.ts +2 -3
  34. package/cjs/features/activity-log/Field/Field.js +24 -2
  35. package/cjs/features/activity-log/PotentialMatchRecord/PotentialMatchRecord.test.js +160 -34
  36. package/cjs/features/activity-log/PotentialMatchRecord/components/PotentialMatchField/PotentialMatchField.js +1 -1
  37. package/cjs/features/activity-log/RecordUpdates/RecordUpdates.test.js +207 -0
  38. package/cjs/features/activity-log/RecordUpdates/components/DeltaField/DeltaField.js +1 -1
  39. package/cjs/features/activity-log/RelationObject/RelationObject.test.js +46 -29
  40. package/cjs/features/activity-log/RelationRecord/RelationRecord.test.js +88 -68
  41. package/esm/ResizablePanes/ResizablePanes.js +5 -6
  42. package/esm/features/activity-log/ActivitiesFactory/ActivitiesFactory.d.ts +1 -1
  43. package/esm/features/activity-log/ActivitiesFactory/ActivitiesFactory.js +1 -1
  44. package/esm/features/activity-log/ActivitiesFactory/ActivitiesFactory.test.js +262 -0
  45. package/esm/features/activity-log/ActivitiesFactory/components/CommentActivity/CommentActivity.d.ts +1 -2
  46. package/esm/features/activity-log/ActivitiesFactory/components/CommentActivity/CommentActivity.js +1 -1
  47. package/esm/features/activity-log/ActivitiesFactory/components/CommentActivity/CommentActivity.test.js +5 -23
  48. package/esm/features/activity-log/ActivitiesFactory/components/GroupActivity/GroupActivity.js +2 -2
  49. package/esm/features/activity-log/ActivitiesFactory/components/GroupActivity/GroupActivity.test.js +3 -23
  50. package/esm/features/activity-log/ActivitiesFactory/components/MergeActivity/MergeActivity.js +2 -2
  51. package/esm/features/activity-log/ActivitiesFactory/components/MergeActivity/MergeActivity.test.js +81 -102
  52. package/esm/features/activity-log/ActivitiesFactory/components/ObjectLabel/ObjectLabel.d.ts +2 -2
  53. package/esm/features/activity-log/ActivitiesFactory/components/ObjectLabel/ObjectLabel.js +24 -2
  54. package/esm/features/activity-log/ActivitiesFactory/components/PotentialMatchActivity/PotentialMatchActivity.js +1 -1
  55. package/esm/features/activity-log/ActivitiesFactory/components/PotentialMatchActivity/PotentialMatchActivity.test.js +69 -48
  56. package/esm/features/activity-log/ActivitiesFactory/components/ProfileActivity/ProfileActivity.js +2 -2
  57. package/esm/features/activity-log/ActivitiesFactory/components/ProfileActivity/ProfileActivity.test.js +123 -107
  58. package/esm/features/activity-log/ActivitiesFactory/components/RelationActivity/RelationActivity.js +2 -2
  59. package/esm/features/activity-log/ActivitiesFactory/components/RelationActivity/RelationActivity.test.js +128 -115
  60. package/esm/features/activity-log/ActivitiesFactory/components/SearchActivity/SearchActivity.js +1 -1
  61. package/esm/features/activity-log/ActivitiesFactory/components/SearchActivity/SearchActivity.test.js +160 -183
  62. package/esm/features/activity-log/ActivitiesFactory/components/SimpleActivity/SimpleActivity.js +2 -2
  63. package/esm/features/activity-log/ActivitiesFactory/components/SimpleActivity/SimpleActivity.test.js +44 -28
  64. package/esm/features/activity-log/ActivitiesFactory/components/SynchronizationIssuesActivity/SynchronizationIssuesActivity.js +4 -5
  65. package/esm/features/activity-log/ActivitiesFactory/components/SynchronizationIssuesActivity/SynchronizationIssuesActivity.test.js +54 -47
  66. package/esm/features/activity-log/ActivityLog/ActivityLog.test.js +83 -22
  67. package/esm/features/activity-log/ActivityLog/components/GroupItem/GroupItem.js +1 -1
  68. package/esm/features/activity-log/ActivityLogFilter/ActivityLogFilter.test.js +779 -0
  69. package/esm/features/activity-log/ActivityTitle/ActivityTitle.d.ts +2 -3
  70. package/esm/features/activity-log/ActivityTitle/ActivityTitle.js +24 -2
  71. package/esm/features/activity-log/CollapsibleActivityRecords/CollapsibleActivityRecords.test.js +104 -58
  72. package/esm/features/activity-log/EntityObject/EntityObject.test.js +35 -26
  73. package/esm/features/activity-log/Field/Field.d.ts +2 -3
  74. package/esm/features/activity-log/Field/Field.js +24 -2
  75. package/esm/features/activity-log/PotentialMatchRecord/PotentialMatchRecord.test.js +160 -34
  76. package/esm/features/activity-log/PotentialMatchRecord/components/PotentialMatchField/PotentialMatchField.js +1 -1
  77. package/esm/features/activity-log/RecordUpdates/RecordUpdates.test.js +202 -0
  78. package/esm/features/activity-log/RecordUpdates/components/DeltaField/DeltaField.js +1 -1
  79. package/esm/features/activity-log/RelationObject/RelationObject.test.js +46 -29
  80. package/esm/features/activity-log/RelationRecord/RelationRecord.test.js +88 -68
  81. package/package.json +1 -1
  82. package/cjs/features/activity-log/ActivityExportButton/ActivityExportButton.specs.js +0 -142
  83. package/cjs/features/activity-log/ActivityFilterButton/ActivityFilterButton.specs.js +0 -131
  84. package/cjs/features/activity-log/ActivityFilterEditor/ActivityFilterEditor.specs.js +0 -252
  85. package/cjs/features/activity-log/ActivityFilterEditor/components/ActivitySelector/ActivitySelector.specs.js +0 -158
  86. package/cjs/features/activity-log/ActivityFilterEditor/components/EntityChangedSelectors/EntityChangedSelectors.specs.js +0 -135
  87. package/cjs/features/activity-log/ActivityFilterEditor/components/EntityTypesSelector/EntityTypesSelector.specs.js +0 -65
  88. package/cjs/features/activity-log/ActivityFilterEditor/components/SourceSelector/SourceSelector.specs.d.ts +0 -1
  89. package/cjs/features/activity-log/ActivityFilterEditor/components/SourceSelector/SourceSelector.specs.js +0 -119
  90. package/cjs/features/activity-log/ActivityFilterEditor/editor.test-data.d.ts +0 -25
  91. package/cjs/features/activity-log/ActivityFilterEditor/editor.test-data.js +0 -75
  92. package/cjs/features/activity-log/ActivityLog/components/ActivityItem/ActivityItem.test.d.ts +0 -1
  93. package/cjs/features/activity-log/ActivityLog/components/ActivityItem/ActivityItem.test.js +0 -140
  94. package/cjs/features/activity-log/ActivityLog/components/GroupItem/GroupItem.test.d.ts +0 -1
  95. package/cjs/features/activity-log/ActivityLog/components/GroupItem/GroupItem.test.js +0 -41
  96. package/cjs/features/activity-log/ActivityLogFilter/ActivityLogFilter.specs.d.ts +0 -1
  97. package/cjs/features/activity-log/ActivityLogFilter/ActivityLogFilter.specs.js +0 -87
  98. package/cjs/features/activity-log/ActivityTitle/ActivityTitle.test.d.ts +0 -1
  99. package/cjs/features/activity-log/ActivityTitle/ActivityTitle.test.js +0 -19
  100. package/cjs/features/activity-log/PotentialMatchRecord/components/PotentialMatchField/PotentialMatchField.test.d.ts +0 -1
  101. package/cjs/features/activity-log/PotentialMatchRecord/components/PotentialMatchField/PotentialMatchField.test.js +0 -179
  102. package/cjs/features/activity-log/RecordUpdates/RecordUpdates.specs.d.ts +0 -1
  103. package/cjs/features/activity-log/RecordUpdates/RecordUpdates.specs.js +0 -150
  104. package/cjs/features/activity-log/RecordUpdates/components/DeltaField/DeltaField.test.d.ts +0 -1
  105. package/cjs/features/activity-log/RecordUpdates/components/DeltaField/DeltaField.test.js +0 -124
  106. package/esm/features/activity-log/ActivityExportButton/ActivityExportButton.specs.d.ts +0 -1
  107. package/esm/features/activity-log/ActivityExportButton/ActivityExportButton.specs.js +0 -137
  108. package/esm/features/activity-log/ActivityFilterButton/ActivityFilterButton.specs.d.ts +0 -1
  109. package/esm/features/activity-log/ActivityFilterButton/ActivityFilterButton.specs.js +0 -126
  110. package/esm/features/activity-log/ActivityFilterEditor/ActivityFilterEditor.specs.d.ts +0 -1
  111. package/esm/features/activity-log/ActivityFilterEditor/ActivityFilterEditor.specs.js +0 -247
  112. package/esm/features/activity-log/ActivityFilterEditor/components/ActivitySelector/ActivitySelector.specs.d.ts +0 -1
  113. package/esm/features/activity-log/ActivityFilterEditor/components/ActivitySelector/ActivitySelector.specs.js +0 -153
  114. package/esm/features/activity-log/ActivityFilterEditor/components/EntityChangedSelectors/EntityChangedSelectors.specs.d.ts +0 -1
  115. package/esm/features/activity-log/ActivityFilterEditor/components/EntityChangedSelectors/EntityChangedSelectors.specs.js +0 -130
  116. package/esm/features/activity-log/ActivityFilterEditor/components/EntityTypesSelector/EntityTypesSelector.specs.d.ts +0 -1
  117. package/esm/features/activity-log/ActivityFilterEditor/components/EntityTypesSelector/EntityTypesSelector.specs.js +0 -60
  118. package/esm/features/activity-log/ActivityFilterEditor/components/SourceSelector/SourceSelector.specs.d.ts +0 -1
  119. package/esm/features/activity-log/ActivityFilterEditor/components/SourceSelector/SourceSelector.specs.js +0 -114
  120. package/esm/features/activity-log/ActivityFilterEditor/editor.test-data.d.ts +0 -25
  121. package/esm/features/activity-log/ActivityFilterEditor/editor.test-data.js +0 -72
  122. package/esm/features/activity-log/ActivityLog/components/ActivityItem/ActivityItem.test.d.ts +0 -1
  123. package/esm/features/activity-log/ActivityLog/components/ActivityItem/ActivityItem.test.js +0 -135
  124. package/esm/features/activity-log/ActivityLog/components/GroupItem/GroupItem.test.d.ts +0 -1
  125. package/esm/features/activity-log/ActivityLog/components/GroupItem/GroupItem.test.js +0 -36
  126. package/esm/features/activity-log/ActivityLogFilter/ActivityLogFilter.specs.d.ts +0 -1
  127. package/esm/features/activity-log/ActivityLogFilter/ActivityLogFilter.specs.js +0 -82
  128. package/esm/features/activity-log/ActivityTitle/ActivityTitle.test.d.ts +0 -1
  129. package/esm/features/activity-log/ActivityTitle/ActivityTitle.test.js +0 -14
  130. package/esm/features/activity-log/PotentialMatchRecord/components/PotentialMatchField/PotentialMatchField.test.d.ts +0 -1
  131. package/esm/features/activity-log/PotentialMatchRecord/components/PotentialMatchField/PotentialMatchField.test.js +0 -151
  132. package/esm/features/activity-log/RecordUpdates/RecordUpdates.specs.d.ts +0 -1
  133. package/esm/features/activity-log/RecordUpdates/RecordUpdates.specs.js +0 -122
  134. package/esm/features/activity-log/RecordUpdates/components/DeltaField/DeltaField.test.d.ts +0 -1
  135. package/esm/features/activity-log/RecordUpdates/components/DeltaField/DeltaField.test.js +0 -119
  136. /package/cjs/features/activity-log/{ActivityExportButton/ActivityExportButton.specs.d.ts → ActivitiesFactory/ActivitiesFactory.test.d.ts} +0 -0
  137. /package/cjs/features/activity-log/{ActivityFilterButton/ActivityFilterButton.specs.d.ts → ActivityLogFilter/ActivityLogFilter.test.d.ts} +0 -0
  138. /package/cjs/features/activity-log/{ActivityFilterEditor/ActivityFilterEditor.specs.d.ts → RecordUpdates/RecordUpdates.test.d.ts} +0 -0
  139. /package/{cjs/features/activity-log/ActivityFilterEditor/components/ActivitySelector/ActivitySelector.specs.d.ts → esm/features/activity-log/ActivitiesFactory/ActivitiesFactory.test.d.ts} +0 -0
  140. /package/{cjs/features/activity-log/ActivityFilterEditor/components/EntityChangedSelectors/EntityChangedSelectors.specs.d.ts → esm/features/activity-log/ActivityLogFilter/ActivityLogFilter.test.d.ts} +0 -0
  141. /package/{cjs/features/activity-log/ActivityFilterEditor/components/EntityTypesSelector/EntityTypesSelector.specs.d.ts → esm/features/activity-log/RecordUpdates/RecordUpdates.test.d.ts} +0 -0
@@ -1,135 +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 __importDefault = (this && this.__importDefault) || function (mod) {
14
- return (mod && mod.__esModule) ? mod : { "default": mod };
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- var react_1 = __importDefault(require("react"));
18
- var enzyme_1 = require("enzyme");
19
- var mdm_sdk_1 = require("@reltio/mdm-sdk");
20
- var AttributeSelector_1 = require("../../../../../AttributeSelector");
21
- var SourceSelector_1 = require("../SourceSelector");
22
- var EntityChangedSelectors_1 = require("./EntityChangedSelectors");
23
- var EntityTypesSelector_1 = require("../EntityTypesSelector");
24
- var MdmModuleContext_1 = require("../../../../../contexts/MdmModuleContext");
25
- jest.mock('@reltio/mdm-sdk', function () { return (__assign(__assign({}, jest.requireActual('@reltio/mdm-sdk')), { findClosestCommonAncestor: jest.fn() })); });
26
- jest.mock('../../../../../AttributeSelector', function () { return ({
27
- AttributeSelector: function () { return null; }
28
- }); });
29
- jest.mock('../SourceSelector', function () { return ({
30
- SourceSelector: function () { return null; }
31
- }); });
32
- jest.mock('../EntityTypesSelector', function () { return ({
33
- EntityTypesSelector: function () { return null; }
34
- }); });
35
- var defaultMetadata = {
36
- entityTypes: [
37
- {
38
- uri: 'configuration/entityTypes/HCP',
39
- label: 'HCP',
40
- attributes: []
41
- },
42
- {
43
- uri: 'configuration/entityTypes/HCA',
44
- label: 'HCA',
45
- attributes: []
46
- },
47
- {
48
- uri: 'configuration/entityTypes/EntityType',
49
- label: 'EntityType',
50
- attributes: []
51
- }
52
- ]
53
- };
54
- var filter = {
55
- activities: [],
56
- users: [],
57
- dateRange: {
58
- type: mdm_sdk_1.DateRangeTypes.WITHIN,
59
- period: [4, 'month']
60
- },
61
- attributes: [
62
- {
63
- label: 'Activity',
64
- value: 'configuration/entityTypes/HCP/attributes/activitywith',
65
- attrType: {
66
- label: 'Activity',
67
- name: 'activitywith',
68
- description: 'Activity',
69
- type: 'Reference',
70
- uri: 'configuration/entityTypes/HCP/attributes/activitywith'
71
- },
72
- chipLabel: 'Activity',
73
- level: 0
74
- }
75
- ],
76
- sources: [
77
- {
78
- uri: 'configuration/sources/Reltio',
79
- label: 'Reltio',
80
- icon: 'images/source/reltio.png',
81
- abbreviation: 'Reltio'
82
- }
83
- ],
84
- entityTypes: [
85
- {
86
- uri: 'configuration/entityTypes/HCA',
87
- label: 'HCA',
88
- attributes: []
89
- },
90
- {
91
- uri: 'configuration/entityTypes/HCP',
92
- label: 'HCP',
93
- attributes: []
94
- }
95
- ]
96
- };
97
- var defaultProps = { filter: filter, onPropChange: jest.fn() };
98
- var setUp = function (props) {
99
- if (props === void 0) { props = defaultProps; }
100
- return (0, enzyme_1.mount)(react_1.default.createElement(MdmModuleContext_1.MdmModuleProvider, { values: { metadata: defaultMetadata } },
101
- react_1.default.createElement(EntityChangedSelectors_1.EntityChangedSelectors, __assign({}, props))));
102
- };
103
- describe('EntityChangedSelectors tests', function () {
104
- beforeAll(function () {
105
- mdm_sdk_1.findClosestCommonAncestor.mockReturnValue(defaultMetadata.entityTypes[0].uri);
106
- });
107
- it('should render correct default state', function () {
108
- var wrapper = setUp();
109
- var entityTypeSelector = wrapper.find(EntityTypesSelector_1.EntityTypesSelector);
110
- expect(entityTypeSelector.length).toBe(1);
111
- expect(entityTypeSelector.props()).toMatchObject({});
112
- var attributeSelector = wrapper.find(AttributeSelector_1.AttributeSelector);
113
- expect(attributeSelector.length).toBe(1);
114
- expect(attributeSelector.props()).toMatchObject({
115
- selectedAttributes: defaultProps.filter.attributes,
116
- entityType: defaultMetadata.entityTypes[0],
117
- disableUnderline: true
118
- });
119
- expect(wrapper.find(SourceSelector_1.SourceSelector).length).toBe(1);
120
- expect(wrapper.find(SourceSelector_1.SourceSelector).prop('selectedSources')).toBe(defaultProps.filter.sources);
121
- });
122
- it('should not render EntityTypesSelector and pass entityType when entityType prop is defined', function () {
123
- var entityType = { uri: 'test', attributes: [] };
124
- var wrapper = setUp(__assign(__assign({}, defaultProps), { entityType: entityType }));
125
- expect(wrapper.find(EntityTypesSelector_1.EntityTypesSelector).length).toBe(0);
126
- expect(wrapper.find(AttributeSelector_1.AttributeSelector).length).toBe(1);
127
- expect(wrapper.find(AttributeSelector_1.AttributeSelector).props()).toMatchObject({
128
- selectedAttributes: defaultProps.filter.attributes,
129
- entityType: entityType,
130
- disableUnderline: true
131
- });
132
- expect(wrapper.find(SourceSelector_1.SourceSelector).length).toBe(1);
133
- expect(wrapper.find(SourceSelector_1.SourceSelector).prop('selectedSources')).toBe(defaultProps.filter.sources);
134
- });
135
- });
@@ -1,65 +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 __importDefault = (this && this.__importDefault) || function (mod) {
14
- return (mod && mod.__esModule) ? mod : { "default": mod };
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- var react_1 = __importDefault(require("react"));
18
- var enzyme_1 = require("enzyme");
19
- var ramda_1 = require("ramda");
20
- var MultiSelect_1 = require("../../../../../MultiSelect");
21
- var EntityTypesSelector_1 = require("./EntityTypesSelector");
22
- var entityTypes = [
23
- {
24
- uri: 'configuration/entityTypes/HCP',
25
- label: 'HCP',
26
- attributes: []
27
- },
28
- {
29
- uri: 'configuration/entityTypes/HCA',
30
- label: 'HCA',
31
- attributes: []
32
- },
33
- {
34
- uri: 'configuration/entityTypes/EntityType',
35
- label: 'EntityType',
36
- attributes: []
37
- }
38
- ];
39
- var selectedEntityTypes = [entityTypes[0], entityTypes[1]];
40
- var prepareOption = (0, ramda_1.map)(function (entityType) { return ({ label: entityType.label, value: entityType.uri, entityType: entityType }); });
41
- describe('EntityTypesSelector tests', function () {
42
- var onChangeSpy = jest.fn();
43
- var props = {
44
- entityTypes: entityTypes,
45
- selectedEntityTypes: selectedEntityTypes,
46
- onChange: onChangeSpy
47
- };
48
- it('should render correctly', function () {
49
- var wrapper = (0, enzyme_1.shallow)(react_1.default.createElement(EntityTypesSelector_1.EntityTypesSelector, __assign({}, props)));
50
- expect(wrapper.find('.filterSubtitle').text()).toBe('Type');
51
- var select = wrapper.find(MultiSelect_1.MultiSelect);
52
- expect(select.length).toBe(1);
53
- expect(select.props()).toMatchObject({
54
- options: (0, ramda_1.pipe)((0, ramda_1.sortBy)((0, ramda_1.prop)('label')), prepareOption)(entityTypes),
55
- value: prepareOption(selectedEntityTypes)
56
- });
57
- });
58
- it('should call onChange when new option is selected', function () {
59
- var newValues = [{ value: entityTypes[2].uri, label: entityTypes[2].label, entityType: entityTypes[2] }];
60
- var wrapper = (0, enzyme_1.shallow)(react_1.default.createElement(EntityTypesSelector_1.EntityTypesSelector, __assign({}, props)));
61
- var select = wrapper.find(MultiSelect_1.MultiSelect);
62
- select.prop('onChange')(newValues);
63
- expect(onChangeSpy).toHaveBeenCalledWith(newValues.map(function (value) { return value.entityType; }));
64
- });
65
- });
@@ -1,119 +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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
- return new (P || (P = Promise))(function (resolve, reject) {
16
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
17
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
18
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
19
- step((generator = generator.apply(thisArg, _arguments || [])).next());
20
- });
21
- };
22
- var __generator = (this && this.__generator) || function (thisArg, body) {
23
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
24
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
- function verb(n) { return function (v) { return step([n, v]); }; }
26
- function step(op) {
27
- if (f) throw new TypeError("Generator is already executing.");
28
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
29
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
- if (y = 0, t) op = [op[0] & 2, t.value];
31
- switch (op[0]) {
32
- case 0: case 1: t = op; break;
33
- case 4: _.label++; return { value: op[1], done: false };
34
- case 5: _.label++; y = op[1]; op = [0]; continue;
35
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
36
- default:
37
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
38
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
39
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
40
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
41
- if (t[2]) _.ops.pop();
42
- _.trys.pop(); continue;
43
- }
44
- op = body.call(thisArg, _);
45
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
46
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
47
- }
48
- };
49
- var __importDefault = (this && this.__importDefault) || function (mod) {
50
- return (mod && mod.__esModule) ? mod : { "default": mod };
51
- };
52
- Object.defineProperty(exports, "__esModule", { value: true });
53
- var react_1 = __importDefault(require("react"));
54
- var react_2 = require("@testing-library/react");
55
- var user_event_1 = __importDefault(require("@testing-library/user-event"));
56
- var SourceSelector_1 = require("./SourceSelector");
57
- var MdmModuleContext_1 = require("../../../../../contexts/MdmModuleContext");
58
- var defaultMetadata = {
59
- sources: [
60
- {
61
- uri: 'configuration/sources/IMSPLAN',
62
- label: 'IMS PLAN',
63
- icon: 'images/source/source_s.png',
64
- abbreviation: 'IMSPLAN'
65
- },
66
- {
67
- uri: 'configuration/sources/RELTIO',
68
- label: 'RELTIO',
69
- icon: 'images/source/source_s.png',
70
- abbreviation: 'RELTIO'
71
- },
72
- {
73
- uri: 'configuration/sources/TEST',
74
- label: 'TEST',
75
- icon: 'images/source/source_s.png',
76
- abbreviation: 'TEST'
77
- }
78
- ],
79
- entityTypes: []
80
- };
81
- var defaultProps = {
82
- selectedSources: [],
83
- onChange: jest.fn()
84
- };
85
- var setUp = function (props) {
86
- if (props === void 0) { props = defaultProps; }
87
- var user = user_event_1.default.setup();
88
- var Providers = function (_a) {
89
- var children = _a.children;
90
- return (react_1.default.createElement(MdmModuleContext_1.MdmModuleProvider, { values: { metadata: defaultMetadata } }, children));
91
- };
92
- return __assign(__assign({}, (0, react_2.render)(react_1.default.createElement(SourceSelector_1.SourceSelector, __assign({}, props)), { wrapper: Providers })), { user: user });
93
- };
94
- describe('Source selector tests', function () {
95
- it('should render correct default state and call onChange when new item is selected', function () { return __awaiter(void 0, void 0, void 0, function () {
96
- var onChange, user, input, _a, sources;
97
- return __generator(this, function (_b) {
98
- switch (_b.label) {
99
- case 0:
100
- onChange = defaultProps.onChange;
101
- user = setUp().user;
102
- react_2.screen.getByText('Source');
103
- input = react_2.screen.getByRole('combobox');
104
- return [4 /*yield*/, user.click(input)];
105
- case 1:
106
- _b.sent();
107
- react_2.screen.getByText('IMS PLAN');
108
- react_2.screen.getByText('RELTIO');
109
- react_2.screen.getByText('TEST');
110
- return [4 /*yield*/, user.click(react_2.screen.getByText('IMS PLAN'))];
111
- case 2:
112
- _b.sent();
113
- _a = defaultMetadata.sources, sources = _a === void 0 ? [] : _a;
114
- expect(onChange).toHaveBeenCalledWith([sources[0]], expect.any(Object));
115
- return [2 /*return*/];
116
- }
117
- });
118
- }); });
119
- });
@@ -1,25 +0,0 @@
1
- import { ActivitiesFilter } from '../types';
2
- export declare const usersResponse: {
3
- username: string;
4
- email: string;
5
- }[];
6
- export declare const value: ActivitiesFilter;
7
- export declare const metadata: {
8
- entityTypes: {
9
- uri: string;
10
- label: string;
11
- attributes: {
12
- label: string;
13
- name: string;
14
- description: string;
15
- type: string;
16
- hidden: boolean;
17
- important: boolean;
18
- system: boolean;
19
- searchable: boolean;
20
- uri: string;
21
- }[];
22
- }[];
23
- relationTypes: any[];
24
- sources: any[];
25
- };
@@ -1,75 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.metadata = exports.value = exports.usersResponse = void 0;
4
- var mdm_sdk_1 = require("@reltio/mdm-sdk");
5
- var types_1 = require("../types");
6
- exports.usersResponse = [
7
- { username: 'username1', email: 'email1' },
8
- { username: 'username2', email: 'email2' },
9
- { username: 'username3', email: 'email3' }
10
- ];
11
- var entityTypes = [
12
- {
13
- uri: 'configuration/entityTypes/HCA',
14
- label: 'HCA',
15
- attributes: []
16
- },
17
- {
18
- uri: 'configuration/entityTypes/HCP',
19
- label: 'HCP',
20
- attributes: [
21
- {
22
- label: 'Activity',
23
- name: 'activitywith',
24
- description: 'Activity',
25
- type: 'String',
26
- hidden: false,
27
- important: false,
28
- system: false,
29
- searchable: true,
30
- uri: 'configuration/entityTypes/HCP/attributes/activitywith'
31
- }
32
- ]
33
- }
34
- ];
35
- exports.value = {
36
- users: ['username1', 'username2'],
37
- activities: [types_1.ActivityTypes.MODEL_UPDATED, types_1.ActivityTypes.COMMENT_ADDED],
38
- attributes: [
39
- {
40
- label: 'Activity',
41
- value: 'configuration/entityTypes/HCP/attributes/activitywith',
42
- attrType: {
43
- label: 'Activity',
44
- name: 'activitywith',
45
- description: 'Activity',
46
- type: 'String',
47
- hidden: false,
48
- important: false,
49
- system: false,
50
- searchable: true,
51
- uri: 'configuration/entityTypes/HCP/attributes/activitywith'
52
- },
53
- chipLabel: 'Activity',
54
- level: 0
55
- }
56
- ],
57
- sources: [
58
- {
59
- uri: 'configuration/sources/Reltio',
60
- label: 'Reltio',
61
- icon: 'images/source/reltio.png',
62
- abbreviation: 'Reltio'
63
- }
64
- ],
65
- entityTypes: entityTypes,
66
- dateRange: {
67
- type: mdm_sdk_1.DateRangeTypes.WITHIN,
68
- period: [4, 'month']
69
- }
70
- };
71
- exports.metadata = {
72
- entityTypes: entityTypes,
73
- relationTypes: [],
74
- sources: []
75
- };
@@ -1,140 +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 __importDefault = (this && this.__importDefault) || function (mod) {
14
- return (mod && mod.__esModule) ? mod : { "default": mod };
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- var react_1 = __importDefault(require("react"));
18
- var ui_i18n_1 = __importDefault(require("ui-i18n"));
19
- var react_2 = require("@testing-library/react");
20
- var CollapsibleItemsContext_1 = require("../../../contexts/CollapsibleItemsContext");
21
- var MdmModuleContext_1 = require("../../../../../contexts/MdmModuleContext");
22
- var ActivityItem_1 = require("./ActivityItem");
23
- describe('ActivityItem tests', function () {
24
- var props = {
25
- item: {
26
- uri: 'activities/e87a3fa5-19e5-4f6c-a5eb-ef296ffb6200',
27
- user: 'alexander.kirsanov',
28
- timestamp: 1625651146042,
29
- items: [
30
- {
31
- id: '5kDR6w7P',
32
- user: 'alexander.kirsanov',
33
- method: 'POST',
34
- url: '/reltio/api/sokol/entities/_same',
35
- clientType: 'Reltio UI',
36
- timestamp: 1625651146042,
37
- objectUri: 'entities/11B3njW5',
38
- objectType: 'configuration/entityTypes/Contact',
39
- objectLabel: 'Child',
40
- data: {
41
- mergeReason: 'Merge by hand',
42
- mergeType: 'MANUAL',
43
- potentialMatches: 'entities/1af0Kc9A',
44
- type: 'ENTITIES_MERGED_MANUALLY',
45
- 'entities/1af0Kc9A': 'William3'
46
- },
47
- eventId: '1625651146042_0hX0z4v'
48
- },
49
- {
50
- id: '5kDR78uB',
51
- user: 'alexander.kirsanov',
52
- method: 'POST',
53
- url: '/reltio/api/sokol/entities/_same',
54
- clientType: 'Reltio UI',
55
- timestamp: 1625651146042,
56
- objectUri: 'entities/1af0Kc9A',
57
- objectType: 'configuration/entityTypes/Contact',
58
- objectLabel: 'William3',
59
- data: {
60
- type: 'ENTITY_LOST_MERGE'
61
- },
62
- eventId: '1625651146042_0hPzNV9'
63
- },
64
- {
65
- id: '5kDR70Nf',
66
- user: 'alexander.kirsanov',
67
- method: 'POST',
68
- url: '/reltio/api/sokol/entities/_same',
69
- clientType: 'Reltio UI',
70
- timestamp: 1625651146042,
71
- objectUri: 'relations/1Jp4lDRt',
72
- objectType: 'configuration/relationTypes/Parent',
73
- startObjectUri: 'entities/1af0Kc9A',
74
- startObjectLabel: 'William3',
75
- endObjectUri: 'entities/11B3nnmL',
76
- endObjectLabel: 'William3',
77
- data: {
78
- type: 'RELATIONSHIP_CHANGED'
79
- },
80
- deltaCollection: {
81
- ovChanged: false
82
- },
83
- eventId: '1625651146042_0hEd1VD'
84
- },
85
- {
86
- id: '5kDR74dv',
87
- user: 'alexander.kirsanov',
88
- method: 'POST',
89
- url: '/reltio/api/sokol/entities/_same',
90
- clientType: 'Reltio UI',
91
- timestamp: 1625651146042,
92
- objectUri: 'entities/11B3njW5',
93
- objectType: 'configuration/entityTypes/Contact',
94
- objectLabel: 'William1',
95
- data: {
96
- type: 'ENTITY_CHANGED'
97
- },
98
- deltaCollection: {
99
- ovChanged: true,
100
- delta: [
101
- {
102
- type: 'ATTRIBUTE_CHANGED',
103
- attributeType: 'configuration/entityTypes/Contact/attributes/Name',
104
- newValue: {
105
- value: 'Child',
106
- ov: false,
107
- id: '4AgJ4ZWFq',
108
- sources: ['Reltio']
109
- },
110
- oldValue: {
111
- value: 'Child',
112
- ov: true,
113
- id: '4AgJ4ZWFq',
114
- sources: ['Reltio']
115
- }
116
- }
117
- ]
118
- },
119
- eventId: '1625651146042_0hsNu3t'
120
- }
121
- ],
122
- itemsTotal: 4
123
- }
124
- };
125
- it('should render correctly', function () {
126
- var metadata = { entityTypes: [] };
127
- var Providers = function (_a) {
128
- var children = _a.children;
129
- return (react_1.default.createElement(MdmModuleContext_1.MdmModuleProvider, { values: { metadata: metadata } },
130
- react_1.default.createElement(CollapsibleItemsContext_1.CollapsibleItemsProvider, null, children)));
131
- };
132
- (0, react_2.render)(react_1.default.createElement(ActivityItem_1.ActivityItem, __assign({}, props)), { wrapper: Providers });
133
- expect(react_2.screen.getByText(props.item.user)).toBeInTheDocument();
134
- expect(react_2.screen.getByText(ui_i18n_1.default.date(props.item.timestamp, 'LT'))).toBeInTheDocument();
135
- expect(react_2.screen.getByText('Profile merged manually')).toBeInTheDocument();
136
- expect(react_2.screen.getByText('Profile lost merge')).toBeInTheDocument();
137
- expect(react_2.screen.getByText('Relationship updated')).toBeInTheDocument();
138
- expect(react_2.screen.getByText('Profile updated')).toBeInTheDocument();
139
- });
140
- });
@@ -1,41 +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 __importDefault = (this && this.__importDefault) || function (mod) {
14
- return (mod && mod.__esModule) ? mod : { "default": mod };
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- var react_1 = __importDefault(require("react"));
18
- var ui_i18n_1 = __importDefault(require("ui-i18n"));
19
- var enzyme_1 = require("enzyme");
20
- var GroupItem_1 = require("./GroupItem");
21
- describe('GroupItem tests', function () {
22
- var props = {
23
- item: {
24
- collapsed: false,
25
- index: 0,
26
- timestamp: 12345
27
- },
28
- onToggle: jest.fn()
29
- };
30
- it('should render correctly', function () {
31
- var wrapper = (0, enzyme_1.shallow)(react_1.default.createElement(GroupItem_1.GroupItem, __assign({}, props)));
32
- expect(wrapper.find('.groupIcon')).toHaveLength(1);
33
- expect(wrapper.find('.groupTitle').text()).toBe(ui_i18n_1.default.date(props.item.timestamp, 'LL'));
34
- expect(wrapper.find('CollapseButton').prop('isOpen')).toBe(true);
35
- });
36
- it('should call props.onToggle on collapse button click', function () {
37
- var wrapper = (0, enzyme_1.shallow)(react_1.default.createElement(GroupItem_1.GroupItem, __assign({}, props)));
38
- wrapper.find('CollapseButton').simulate('click');
39
- expect(props.onToggle).toHaveBeenCalledWith(props.item.index);
40
- });
41
- });