@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.
Files changed (139) hide show
  1. package/cjs/features/activity-log/ActivitiesFactory/ActivitiesFactory.d.ts +1 -1
  2. package/cjs/features/activity-log/ActivitiesFactory/ActivitiesFactory.js +1 -1
  3. package/cjs/features/activity-log/ActivitiesFactory/ActivitiesFactory.test.js +267 -0
  4. package/cjs/features/activity-log/ActivitiesFactory/components/CommentActivity/CommentActivity.d.ts +1 -2
  5. package/cjs/features/activity-log/ActivitiesFactory/components/CommentActivity/CommentActivity.js +1 -1
  6. package/cjs/features/activity-log/ActivitiesFactory/components/CommentActivity/CommentActivity.test.js +5 -23
  7. package/cjs/features/activity-log/ActivitiesFactory/components/GroupActivity/GroupActivity.js +2 -2
  8. package/cjs/features/activity-log/ActivitiesFactory/components/GroupActivity/GroupActivity.test.js +3 -23
  9. package/cjs/features/activity-log/ActivitiesFactory/components/MergeActivity/MergeActivity.js +2 -2
  10. package/cjs/features/activity-log/ActivitiesFactory/components/MergeActivity/MergeActivity.test.js +81 -102
  11. package/cjs/features/activity-log/ActivitiesFactory/components/ObjectLabel/ObjectLabel.d.ts +2 -2
  12. package/cjs/features/activity-log/ActivitiesFactory/components/ObjectLabel/ObjectLabel.js +24 -2
  13. package/cjs/features/activity-log/ActivitiesFactory/components/PotentialMatchActivity/PotentialMatchActivity.js +1 -1
  14. package/cjs/features/activity-log/ActivitiesFactory/components/PotentialMatchActivity/PotentialMatchActivity.test.js +69 -48
  15. package/cjs/features/activity-log/ActivitiesFactory/components/ProfileActivity/ProfileActivity.js +2 -2
  16. package/cjs/features/activity-log/ActivitiesFactory/components/ProfileActivity/ProfileActivity.test.js +123 -107
  17. package/cjs/features/activity-log/ActivitiesFactory/components/RelationActivity/RelationActivity.js +2 -2
  18. package/cjs/features/activity-log/ActivitiesFactory/components/RelationActivity/RelationActivity.test.js +128 -115
  19. package/cjs/features/activity-log/ActivitiesFactory/components/SearchActivity/SearchActivity.js +1 -1
  20. package/cjs/features/activity-log/ActivitiesFactory/components/SearchActivity/SearchActivity.test.js +160 -183
  21. package/cjs/features/activity-log/ActivitiesFactory/components/SimpleActivity/SimpleActivity.js +2 -2
  22. package/cjs/features/activity-log/ActivitiesFactory/components/SimpleActivity/SimpleActivity.test.js +44 -28
  23. package/cjs/features/activity-log/ActivitiesFactory/components/SynchronizationIssuesActivity/SynchronizationIssuesActivity.js +4 -5
  24. package/cjs/features/activity-log/ActivitiesFactory/components/SynchronizationIssuesActivity/SynchronizationIssuesActivity.test.js +54 -47
  25. package/cjs/features/activity-log/ActivityLog/ActivityLog.test.js +83 -22
  26. package/cjs/features/activity-log/ActivityLog/components/GroupItem/GroupItem.js +1 -1
  27. package/cjs/features/activity-log/ActivityLogFilter/ActivityLogFilter.test.js +784 -0
  28. package/cjs/features/activity-log/ActivityTitle/ActivityTitle.d.ts +2 -3
  29. package/cjs/features/activity-log/ActivityTitle/ActivityTitle.js +24 -2
  30. package/cjs/features/activity-log/CollapsibleActivityRecords/CollapsibleActivityRecords.test.js +102 -79
  31. package/cjs/features/activity-log/EntityObject/EntityObject.test.js +35 -26
  32. package/cjs/features/activity-log/Field/Field.d.ts +2 -3
  33. package/cjs/features/activity-log/Field/Field.js +24 -2
  34. package/cjs/features/activity-log/PotentialMatchRecord/PotentialMatchRecord.test.js +160 -34
  35. package/cjs/features/activity-log/PotentialMatchRecord/components/PotentialMatchField/PotentialMatchField.js +1 -1
  36. package/cjs/features/activity-log/RecordUpdates/RecordUpdates.test.js +207 -0
  37. package/cjs/features/activity-log/RecordUpdates/components/DeltaField/DeltaField.js +1 -1
  38. package/cjs/features/activity-log/RelationObject/RelationObject.test.js +46 -29
  39. package/cjs/features/activity-log/RelationRecord/RelationRecord.test.js +88 -68
  40. package/esm/features/activity-log/ActivitiesFactory/ActivitiesFactory.d.ts +1 -1
  41. package/esm/features/activity-log/ActivitiesFactory/ActivitiesFactory.js +1 -1
  42. package/esm/features/activity-log/ActivitiesFactory/ActivitiesFactory.test.js +262 -0
  43. package/esm/features/activity-log/ActivitiesFactory/components/CommentActivity/CommentActivity.d.ts +1 -2
  44. package/esm/features/activity-log/ActivitiesFactory/components/CommentActivity/CommentActivity.js +1 -1
  45. package/esm/features/activity-log/ActivitiesFactory/components/CommentActivity/CommentActivity.test.js +5 -23
  46. package/esm/features/activity-log/ActivitiesFactory/components/GroupActivity/GroupActivity.js +2 -2
  47. package/esm/features/activity-log/ActivitiesFactory/components/GroupActivity/GroupActivity.test.js +3 -23
  48. package/esm/features/activity-log/ActivitiesFactory/components/MergeActivity/MergeActivity.js +2 -2
  49. package/esm/features/activity-log/ActivitiesFactory/components/MergeActivity/MergeActivity.test.js +81 -102
  50. package/esm/features/activity-log/ActivitiesFactory/components/ObjectLabel/ObjectLabel.d.ts +2 -2
  51. package/esm/features/activity-log/ActivitiesFactory/components/ObjectLabel/ObjectLabel.js +24 -2
  52. package/esm/features/activity-log/ActivitiesFactory/components/PotentialMatchActivity/PotentialMatchActivity.js +1 -1
  53. package/esm/features/activity-log/ActivitiesFactory/components/PotentialMatchActivity/PotentialMatchActivity.test.js +69 -48
  54. package/esm/features/activity-log/ActivitiesFactory/components/ProfileActivity/ProfileActivity.js +2 -2
  55. package/esm/features/activity-log/ActivitiesFactory/components/ProfileActivity/ProfileActivity.test.js +123 -107
  56. package/esm/features/activity-log/ActivitiesFactory/components/RelationActivity/RelationActivity.js +2 -2
  57. package/esm/features/activity-log/ActivitiesFactory/components/RelationActivity/RelationActivity.test.js +128 -115
  58. package/esm/features/activity-log/ActivitiesFactory/components/SearchActivity/SearchActivity.js +1 -1
  59. package/esm/features/activity-log/ActivitiesFactory/components/SearchActivity/SearchActivity.test.js +160 -183
  60. package/esm/features/activity-log/ActivitiesFactory/components/SimpleActivity/SimpleActivity.js +2 -2
  61. package/esm/features/activity-log/ActivitiesFactory/components/SimpleActivity/SimpleActivity.test.js +44 -28
  62. package/esm/features/activity-log/ActivitiesFactory/components/SynchronizationIssuesActivity/SynchronizationIssuesActivity.js +4 -5
  63. package/esm/features/activity-log/ActivitiesFactory/components/SynchronizationIssuesActivity/SynchronizationIssuesActivity.test.js +54 -47
  64. package/esm/features/activity-log/ActivityLog/ActivityLog.test.js +83 -22
  65. package/esm/features/activity-log/ActivityLog/components/GroupItem/GroupItem.js +1 -1
  66. package/esm/features/activity-log/ActivityLogFilter/ActivityLogFilter.test.js +779 -0
  67. package/esm/features/activity-log/ActivityTitle/ActivityTitle.d.ts +2 -3
  68. package/esm/features/activity-log/ActivityTitle/ActivityTitle.js +24 -2
  69. package/esm/features/activity-log/CollapsibleActivityRecords/CollapsibleActivityRecords.test.js +104 -58
  70. package/esm/features/activity-log/EntityObject/EntityObject.test.js +35 -26
  71. package/esm/features/activity-log/Field/Field.d.ts +2 -3
  72. package/esm/features/activity-log/Field/Field.js +24 -2
  73. package/esm/features/activity-log/PotentialMatchRecord/PotentialMatchRecord.test.js +160 -34
  74. package/esm/features/activity-log/PotentialMatchRecord/components/PotentialMatchField/PotentialMatchField.js +1 -1
  75. package/esm/features/activity-log/RecordUpdates/RecordUpdates.test.js +202 -0
  76. package/esm/features/activity-log/RecordUpdates/components/DeltaField/DeltaField.js +1 -1
  77. package/esm/features/activity-log/RelationObject/RelationObject.test.js +46 -29
  78. package/esm/features/activity-log/RelationRecord/RelationRecord.test.js +88 -68
  79. package/package.json +1 -1
  80. package/cjs/features/activity-log/ActivityExportButton/ActivityExportButton.specs.js +0 -142
  81. package/cjs/features/activity-log/ActivityFilterButton/ActivityFilterButton.specs.js +0 -131
  82. package/cjs/features/activity-log/ActivityFilterEditor/ActivityFilterEditor.specs.js +0 -252
  83. package/cjs/features/activity-log/ActivityFilterEditor/components/ActivitySelector/ActivitySelector.specs.js +0 -158
  84. package/cjs/features/activity-log/ActivityFilterEditor/components/EntityChangedSelectors/EntityChangedSelectors.specs.js +0 -135
  85. package/cjs/features/activity-log/ActivityFilterEditor/components/EntityTypesSelector/EntityTypesSelector.specs.js +0 -65
  86. package/cjs/features/activity-log/ActivityFilterEditor/components/SourceSelector/SourceSelector.specs.d.ts +0 -1
  87. package/cjs/features/activity-log/ActivityFilterEditor/components/SourceSelector/SourceSelector.specs.js +0 -119
  88. package/cjs/features/activity-log/ActivityFilterEditor/editor.test-data.d.ts +0 -25
  89. package/cjs/features/activity-log/ActivityFilterEditor/editor.test-data.js +0 -75
  90. package/cjs/features/activity-log/ActivityLog/components/ActivityItem/ActivityItem.test.d.ts +0 -1
  91. package/cjs/features/activity-log/ActivityLog/components/ActivityItem/ActivityItem.test.js +0 -140
  92. package/cjs/features/activity-log/ActivityLog/components/GroupItem/GroupItem.test.d.ts +0 -1
  93. package/cjs/features/activity-log/ActivityLog/components/GroupItem/GroupItem.test.js +0 -41
  94. package/cjs/features/activity-log/ActivityLogFilter/ActivityLogFilter.specs.d.ts +0 -1
  95. package/cjs/features/activity-log/ActivityLogFilter/ActivityLogFilter.specs.js +0 -87
  96. package/cjs/features/activity-log/ActivityTitle/ActivityTitle.test.d.ts +0 -1
  97. package/cjs/features/activity-log/ActivityTitle/ActivityTitle.test.js +0 -19
  98. package/cjs/features/activity-log/PotentialMatchRecord/components/PotentialMatchField/PotentialMatchField.test.d.ts +0 -1
  99. package/cjs/features/activity-log/PotentialMatchRecord/components/PotentialMatchField/PotentialMatchField.test.js +0 -179
  100. package/cjs/features/activity-log/RecordUpdates/RecordUpdates.specs.d.ts +0 -1
  101. package/cjs/features/activity-log/RecordUpdates/RecordUpdates.specs.js +0 -150
  102. package/cjs/features/activity-log/RecordUpdates/components/DeltaField/DeltaField.test.d.ts +0 -1
  103. package/cjs/features/activity-log/RecordUpdates/components/DeltaField/DeltaField.test.js +0 -124
  104. package/esm/features/activity-log/ActivityExportButton/ActivityExportButton.specs.d.ts +0 -1
  105. package/esm/features/activity-log/ActivityExportButton/ActivityExportButton.specs.js +0 -137
  106. package/esm/features/activity-log/ActivityFilterButton/ActivityFilterButton.specs.d.ts +0 -1
  107. package/esm/features/activity-log/ActivityFilterButton/ActivityFilterButton.specs.js +0 -126
  108. package/esm/features/activity-log/ActivityFilterEditor/ActivityFilterEditor.specs.d.ts +0 -1
  109. package/esm/features/activity-log/ActivityFilterEditor/ActivityFilterEditor.specs.js +0 -247
  110. package/esm/features/activity-log/ActivityFilterEditor/components/ActivitySelector/ActivitySelector.specs.d.ts +0 -1
  111. package/esm/features/activity-log/ActivityFilterEditor/components/ActivitySelector/ActivitySelector.specs.js +0 -153
  112. package/esm/features/activity-log/ActivityFilterEditor/components/EntityChangedSelectors/EntityChangedSelectors.specs.d.ts +0 -1
  113. package/esm/features/activity-log/ActivityFilterEditor/components/EntityChangedSelectors/EntityChangedSelectors.specs.js +0 -130
  114. package/esm/features/activity-log/ActivityFilterEditor/components/EntityTypesSelector/EntityTypesSelector.specs.d.ts +0 -1
  115. package/esm/features/activity-log/ActivityFilterEditor/components/EntityTypesSelector/EntityTypesSelector.specs.js +0 -60
  116. package/esm/features/activity-log/ActivityFilterEditor/components/SourceSelector/SourceSelector.specs.d.ts +0 -1
  117. package/esm/features/activity-log/ActivityFilterEditor/components/SourceSelector/SourceSelector.specs.js +0 -114
  118. package/esm/features/activity-log/ActivityFilterEditor/editor.test-data.d.ts +0 -25
  119. package/esm/features/activity-log/ActivityFilterEditor/editor.test-data.js +0 -72
  120. package/esm/features/activity-log/ActivityLog/components/ActivityItem/ActivityItem.test.d.ts +0 -1
  121. package/esm/features/activity-log/ActivityLog/components/ActivityItem/ActivityItem.test.js +0 -135
  122. package/esm/features/activity-log/ActivityLog/components/GroupItem/GroupItem.test.d.ts +0 -1
  123. package/esm/features/activity-log/ActivityLog/components/GroupItem/GroupItem.test.js +0 -36
  124. package/esm/features/activity-log/ActivityLogFilter/ActivityLogFilter.specs.d.ts +0 -1
  125. package/esm/features/activity-log/ActivityLogFilter/ActivityLogFilter.specs.js +0 -82
  126. package/esm/features/activity-log/ActivityTitle/ActivityTitle.test.d.ts +0 -1
  127. package/esm/features/activity-log/ActivityTitle/ActivityTitle.test.js +0 -14
  128. package/esm/features/activity-log/PotentialMatchRecord/components/PotentialMatchField/PotentialMatchField.test.d.ts +0 -1
  129. package/esm/features/activity-log/PotentialMatchRecord/components/PotentialMatchField/PotentialMatchField.test.js +0 -151
  130. package/esm/features/activity-log/RecordUpdates/RecordUpdates.specs.d.ts +0 -1
  131. package/esm/features/activity-log/RecordUpdates/RecordUpdates.specs.js +0 -122
  132. package/esm/features/activity-log/RecordUpdates/components/DeltaField/DeltaField.test.d.ts +0 -1
  133. package/esm/features/activity-log/RecordUpdates/components/DeltaField/DeltaField.test.js +0 -119
  134. /package/cjs/features/activity-log/{ActivityExportButton/ActivityExportButton.specs.d.ts → ActivitiesFactory/ActivitiesFactory.test.d.ts} +0 -0
  135. /package/cjs/features/activity-log/{ActivityFilterButton/ActivityFilterButton.specs.d.ts → ActivityLogFilter/ActivityLogFilter.test.d.ts} +0 -0
  136. /package/cjs/features/activity-log/{ActivityFilterEditor/ActivityFilterEditor.specs.d.ts → RecordUpdates/RecordUpdates.test.d.ts} +0 -0
  137. /package/{cjs/features/activity-log/ActivityFilterEditor/components/ActivitySelector/ActivitySelector.specs.d.ts → esm/features/activity-log/ActivitiesFactory/ActivitiesFactory.test.d.ts} +0 -0
  138. /package/{cjs/features/activity-log/ActivityFilterEditor/components/EntityChangedSelectors/EntityChangedSelectors.specs.d.ts → esm/features/activity-log/ActivityLogFilter/ActivityLogFilter.test.d.ts} +0 -0
  139. /package/{cjs/features/activity-log/ActivityFilterEditor/components/EntityTypesSelector/EntityTypesSelector.specs.d.ts → esm/features/activity-log/RecordUpdates/RecordUpdates.test.d.ts} +0 -0
@@ -1,8 +1,7 @@
1
1
  import React from 'react';
2
2
  import { ActivityTypes } from '../types';
3
- type Props = {
3
+ type Props = Omit<React.ComponentPropsWithoutRef<'div'>, 'className'> & {
4
4
  type: ActivityTypes;
5
- children?: React.ReactNode;
6
5
  };
7
- export declare const ActivityTitle: ({ type, children }: Props) => React.JSX.Element;
6
+ export declare const ActivityTitle: ({ type, children, ...restProps }: Props) => React.JSX.Element;
8
7
  export {};
@@ -1,10 +1,32 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
1
23
  import React from 'react';
2
24
  import { getActivityLabel } from '../utils/activities';
3
25
  import { useStyles } from './styles';
4
26
  export var ActivityTitle = function (_a) {
5
- var type = _a.type, children = _a.children;
27
+ var type = _a.type, children = _a.children, restProps = __rest(_a, ["type", "children"]);
6
28
  var styles = useStyles();
7
- return (React.createElement("span", { className: styles.activityTitle },
29
+ return (React.createElement("span", __assign({ className: styles.activityTitle }, restProps),
8
30
  React.createElement("span", { className: styles.activityType }, getActivityLabel(type)),
9
31
  children));
10
32
  };
@@ -1,66 +1,112 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
13
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14
+ return new (P || (P = Promise))(function (resolve, reject) {
15
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
16
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
17
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
18
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
19
+ });
20
+ };
21
+ var __generator = (this && this.__generator) || function (thisArg, body) {
22
+ 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);
23
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
24
+ function verb(n) { return function (v) { return step([n, v]); }; }
25
+ function step(op) {
26
+ if (f) throw new TypeError("Generator is already executing.");
27
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
28
+ 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;
29
+ if (y = 0, t) op = [op[0] & 2, t.value];
30
+ switch (op[0]) {
31
+ case 0: case 1: t = op; break;
32
+ case 4: _.label++; return { value: op[1], done: false };
33
+ case 5: _.label++; y = op[1]; op = [0]; continue;
34
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
35
+ default:
36
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
37
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
38
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
39
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
40
+ if (t[2]) _.ops.pop();
41
+ _.trys.pop(); continue;
42
+ }
43
+ op = body.call(thisArg, _);
44
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
45
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
46
+ }
47
+ };
1
48
  import React from 'react';
2
- import { act } from 'react-dom/test-utils';
3
- import { shallow } from 'enzyme';
4
- import * as collapsibleItemsContext from '../contexts/CollapsibleItemsContext';
49
+ import { render, screen } from '@testing-library/react';
50
+ import userEvent from '@testing-library/user-event';
51
+ import { CollapsibleItemsProvider } from '../contexts/CollapsibleItemsContext';
5
52
  import { CollapsibleActivityRecords } from './CollapsibleActivityRecords';
6
- import { MoreItemsLink } from '../MoreItemsLink';
7
- var Component = function () { return React.createElement(React.Fragment, null); };
8
- describe('CollapsibleActivityRecords tests', function () {
9
- var onExpand = jest.fn();
10
- var useCollapsibleItems = jest.spyOn(collapsibleItemsContext, 'useCollapsibleItems');
11
- beforeEach(function () {
12
- useCollapsibleItems.mockImplementation(function () { return ({ itemsToShow: [], onExpand: onExpand, collapsedItemsCount: 0 }); });
13
- });
53
+ var defaultItems = [
54
+ { id: 'item-1', timestamp: 1234567890 },
55
+ { id: 'item-2', timestamp: 1234567890 },
56
+ { id: 'item-3', timestamp: 1234567890 },
57
+ { id: 'item-4', timestamp: 1234567890 },
58
+ { id: 'item-5', timestamp: 1234567890 }
59
+ ];
60
+ var RecordComponent = function (_a) {
61
+ var item = _a.item;
62
+ return React.createElement("div", { "data-reltio-id": "activity-record" }, item.id);
63
+ };
64
+ var defaultProps = { activityUri: 'activity-uri', items: defaultItems, RecordComponent: RecordComponent };
65
+ var setUp = function (props) {
66
+ if (props === void 0) { props = defaultProps; }
67
+ var user = userEvent.setup();
68
+ var Providers = function (_a) {
69
+ var children = _a.children;
70
+ return (React.createElement(CollapsibleItemsProvider, null, children));
71
+ };
72
+ return __assign(__assign({}, render(React.createElement(CollapsibleActivityRecords, __assign({}, props)), { wrapper: Providers })), { user: user });
73
+ };
74
+ describe('Collapsible activity records tests', function () {
14
75
  it('should not render anything if items empty', function () {
15
- var component = shallow(React.createElement(CollapsibleActivityRecords, { RecordComponent: Component, items: [], activityUri: '11' }));
16
- expect(component.find(Component)).toHaveLength(0);
17
- expect(component.find(MoreItemsLink)).toHaveLength(0);
18
- });
19
- it('should render 3 items without Link', function () {
20
- var items = [
21
- { id: 'string1', timestamp: 123 },
22
- { id: 'string2', timestamp: 123 },
23
- { id: 'string3', timestamp: 123 }
24
- ];
25
- useCollapsibleItems.mockImplementation(function () { return ({ itemsToShow: items, onExpand: onExpand, collapsedItemsCount: 0 }); });
26
- var component = shallow(React.createElement(CollapsibleActivityRecords, { RecordComponent: Component, items: items, activityUri: '11' }));
27
- expect(component.find(Component)).toHaveLength(3);
28
- expect(component.find(MoreItemsLink)).toHaveLength(0);
76
+ var container = setUp(__assign(__assign({}, defaultProps), { items: [] })).container;
77
+ expect(container).toBeEmptyDOMElement();
29
78
  });
30
- it('should render 3 items with Link and call onExpand on click', function () {
31
- var items = [
32
- { id: 'string1', timestamp: 123 },
33
- { id: 'string2', timestamp: 123 },
34
- { id: 'string3', timestamp: 123 },
35
- { id: 'string4', timestamp: 123 },
36
- { id: 'string5', timestamp: 123 }
37
- ];
38
- useCollapsibleItems.mockImplementation(function () { return ({
39
- itemsToShow: items.slice(0, 3),
40
- onExpand: onExpand,
41
- collapsedItemsCount: 2
42
- }); });
43
- var component = shallow(React.createElement(CollapsibleActivityRecords, { RecordComponent: Component, items: items, activityUri: '11' }));
44
- expect(component.find(Component)).toHaveLength(3);
45
- var moreItemsLink = component.find(MoreItemsLink);
46
- expect(moreItemsLink.prop('itemsCount')).toBe(2);
47
- expect(moreItemsLink.prop('itemsLabel')).toBe('records');
48
- act(function () {
49
- moreItemsLink.prop('onClick')();
79
+ it('should render and expand items correctly', function () { return __awaiter(void 0, void 0, void 0, function () {
80
+ var user, activityRecords;
81
+ return __generator(this, function (_a) {
82
+ switch (_a.label) {
83
+ case 0:
84
+ user = setUp().user;
85
+ activityRecords = screen.getAllByTestId('activity-record');
86
+ expect(activityRecords).toHaveLength(3);
87
+ expect(activityRecords[0]).toHaveTextContent('item-1');
88
+ expect(activityRecords[1]).toHaveTextContent('item-2');
89
+ expect(activityRecords[2]).toHaveTextContent('item-3');
90
+ return [4 /*yield*/, user.click(screen.getByRole('button', { name: '2 more records' }))];
91
+ case 1:
92
+ _a.sent();
93
+ activityRecords = screen.getAllByTestId('activity-record');
94
+ expect(activityRecords).toHaveLength(5);
95
+ expect(activityRecords[3]).toHaveTextContent('item-4');
96
+ expect(activityRecords[4]).toHaveTextContent('item-5');
97
+ expect(screen.queryByRole('button')).not.toBeInTheDocument();
98
+ return [2 /*return*/];
99
+ }
50
100
  });
51
- expect(onExpand).toHaveBeenCalled();
101
+ }); });
102
+ it('should not render more items link if items count is 3 or less', function () {
103
+ setUp(__assign(__assign({}, defaultProps), { items: defaultItems.slice(0, 3) }));
104
+ expect(screen.getAllByTestId('activity-record')).toHaveLength(3);
105
+ expect(screen.queryByRole('button')).not.toBeInTheDocument();
52
106
  });
53
- it('should render 5 items without Link', function () {
54
- var items = [
55
- { id: 'string1', timestamp: 123 },
56
- { id: 'string2', timestamp: 123 },
57
- { id: 'string3', timestamp: 123 },
58
- { id: 'string4', timestamp: 123 },
59
- { id: 'string5', timestamp: 123 }
60
- ];
61
- useCollapsibleItems.mockImplementation(function () { return ({ itemsToShow: items, onExpand: onExpand, collapsedItemsCount: 0 }); });
62
- var component = shallow(React.createElement(CollapsibleActivityRecords, { RecordComponent: Component, items: items, activityUri: '11' }));
63
- expect(component.find(Component)).toHaveLength(5);
64
- expect(component.find(MoreItemsLink)).toHaveLength(0);
107
+ it('should render more items link correctly if items count is 4', function () {
108
+ setUp(__assign(__assign({}, defaultProps), { items: defaultItems.slice(0, 4) }));
109
+ expect(screen.getAllByTestId('activity-record')).toHaveLength(3);
110
+ screen.getByRole('button', { name: '1 more record' });
65
111
  });
66
112
  });
@@ -10,32 +10,41 @@ var __assign = (this && this.__assign) || function () {
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
12
  import React from 'react';
13
- import { shallow } from 'enzyme';
13
+ import { render, screen } from '@testing-library/react';
14
+ import { MdmModuleProvider } from '../../../contexts/MdmModuleContext';
15
+ import { ActivityTypes } from '../types';
14
16
  import { EntityObject } from './EntityObject';
15
- describe('EntityObject tests', function () {
16
- it('should render correctly', function () {
17
- var item = {
18
- id: '3vJgNLSN',
19
- user: 'egorshkov',
20
- method: 'POST',
21
- url: '/reltio/api/alenat/entities/sOoSQYm/_update',
22
- clientType: 'Reltio UI',
23
- timestamp: 1621847085259,
24
- objectUri: 'relations/edEnRRW',
25
- objectType: 'configuration/relationTypes/HasAddress',
26
- objectLabel: '- cBtCASwtAeEbTxe Agacati',
27
- data: {
28
- type: 'ENTITY_CHANGED'
29
- },
30
- eventId: '1621847085259_00qpSyx'
31
- };
32
- var wrapper = shallow(React.createElement(EntityObject, { item: item }));
33
- var objectUri = item.objectUri, objectLabel = item.objectLabel;
34
- var link = wrapper.find('EntityUriLink');
35
- expect(link.length).toBe(1);
36
- expect(link.prop('value')).toBe(objectUri);
37
- expect(link.text()).toBe(objectLabel);
38
- wrapper.setProps({ item: __assign(__assign({}, item), { data: { type: 'ENTITY_REMOVED' } }) });
39
- expect(wrapper.find('.removed').length).toBe(1);
17
+ var defaultItem = {
18
+ id: '3vJgNLSN',
19
+ timestamp: 1621847085259,
20
+ objectUri: 'relations/edEnRRW',
21
+ objectLabel: 'object label',
22
+ data: { type: ActivityTypes.ENTITY_CHANGED }
23
+ };
24
+ var defaultProps = {
25
+ item: defaultItem
26
+ };
27
+ var defaultMdmValues = {
28
+ uiPath: 'https://reltio.com/nui'
29
+ };
30
+ var setUp = function (_a) {
31
+ var _b = _a === void 0 ? {} : _a, _c = _b.props, props = _c === void 0 ? defaultProps : _c, _d = _b.mdmValues, mdmValues = _d === void 0 ? defaultMdmValues : _d;
32
+ var Providers = function (_a) {
33
+ var children = _a.children;
34
+ return (React.createElement(MdmModuleProvider, { values: mdmValues }, children));
35
+ };
36
+ return render(React.createElement(EntityObject, __assign({}, props)), { wrapper: Providers });
37
+ };
38
+ describe('Entity object tests', function () {
39
+ it('should render entity object correctly', function () {
40
+ setUp();
41
+ var link = screen.getByText('object label');
42
+ expect(link).toHaveAttribute('href', 'https://reltio.com/nui#p~com.reltio.plugins.entity.default.DefaultPerspective_e~relations/edEnRRW');
43
+ expect(link).not.toHaveClass('removed');
44
+ });
45
+ it('should render entity object with ENTITY_REMOVED type correctly', function () {
46
+ var props = __assign(__assign({}, defaultProps), { item: __assign(__assign({}, defaultItem), { data: { type: ActivityTypes.ENTITY_REMOVED } }) });
47
+ setUp({ props: props });
48
+ expect(screen.getByText('object label')).toHaveClass('removed');
40
49
  });
41
50
  });
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
- type Props = {
2
+ type Props = Omit<React.ComponentPropsWithoutRef<'div'>, 'className'> & {
3
3
  fieldName: string;
4
- children: React.ReactNode;
5
4
  };
6
- export declare const Field: ({ fieldName, children }: Props) => React.JSX.Element;
5
+ export declare const Field: ({ fieldName, children, ...restProps }: Props) => React.JSX.Element;
7
6
  export {};
@@ -1,9 +1,31 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
1
23
  import React from 'react';
2
24
  import { useStyles } from './styles';
3
25
  export var Field = function (_a) {
4
- var fieldName = _a.fieldName, children = _a.children;
26
+ var fieldName = _a.fieldName, children = _a.children, restProps = __rest(_a, ["fieldName", "children"]);
5
27
  var styles = useStyles();
6
- return (React.createElement("div", { className: styles.field },
28
+ return (React.createElement("div", __assign({ className: styles.field }, restProps),
7
29
  React.createElement("span", { className: styles.fieldName },
8
30
  fieldName,
9
31
  ":"),
@@ -9,44 +9,170 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
13
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14
+ return new (P || (P = Promise))(function (resolve, reject) {
15
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
16
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
17
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
18
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
19
+ });
20
+ };
21
+ var __generator = (this && this.__generator) || function (thisArg, body) {
22
+ 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);
23
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
24
+ function verb(n) { return function (v) { return step([n, v]); }; }
25
+ function step(op) {
26
+ if (f) throw new TypeError("Generator is already executing.");
27
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
28
+ 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;
29
+ if (y = 0, t) op = [op[0] & 2, t.value];
30
+ switch (op[0]) {
31
+ case 0: case 1: t = op; break;
32
+ case 4: _.label++; return { value: op[1], done: false };
33
+ case 5: _.label++; y = op[1]; op = [0]; continue;
34
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
35
+ default:
36
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
37
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
38
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
39
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
40
+ if (t[2]) _.ops.pop();
41
+ _.trys.pop(); continue;
42
+ }
43
+ op = body.call(thisArg, _);
44
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
45
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
46
+ }
47
+ };
12
48
  import React from 'react';
13
- import { shallow } from 'enzyme';
49
+ import { render, screen } from '@testing-library/react';
50
+ import userEvent from '@testing-library/user-event';
51
+ import { MdmModuleProvider } from '../../../contexts/MdmModuleContext';
52
+ import { CollapsibleItemsProvider } from '../contexts/CollapsibleItemsContext';
53
+ import { ActivityTypes } from '../types';
14
54
  import { PotentialMatchRecord } from './PotentialMatchRecord';
15
- describe('PotentialMatchRecord tests', function () {
16
- var item = {
17
- id: '3LfWvAlI',
18
- user: 'IncrementalMatchThread',
19
- clientType: 'API',
20
- timestamp: 1621847092199,
21
- objectUri: 'entities/11EunumT',
22
- objectType: 'configuration/entityTypes/HCP',
23
- objectLabel: '- cBtCASwtAeEbTxe Agacati',
24
- data: {
25
- potentialMatches: 'entities/sOoSQYm,entities/sOoSQYq,entities/sOoSQYw',
26
- type: 'POTENTIAL_MATCHES_FOUND',
27
- 'entities/sOoSQYm': '- cBtCASwtAeEbTxe Agacati',
28
- 'entities/sOoSQYq': '- cBtCASwtAeEbTxe Test',
29
- 'entities/sOoSQYw': '123'
30
- },
31
- eventId: '1621847092199_00Nr58d'
55
+ var defaultItem = {
56
+ id: '3LfWvAlI',
57
+ timestamp: 1621847092199,
58
+ objectUri: 'entities/11EunumT',
59
+ objectType: 'configuration/entityTypes/HCP',
60
+ objectLabel: 'record label',
61
+ data: {
62
+ potentialMatches: 'entities/sOoSQYm,entities/sOoSQYq,entities/sOoSQYw,entities/p3Js13Nm,entities/zIlemSd09',
63
+ type: ActivityTypes.POTENTIAL_MATCHES_FOUND,
64
+ 'entities/sOoSQYm': 'entity label 1',
65
+ 'entities/sOoSQYq': 'entity label 2',
66
+ 'entities/sOoSQYw': 'entity label 3',
67
+ 'entities/p3Js13Nm': 'entity label 4',
68
+ 'entities/zIlemSd09': 'entity label 5'
69
+ }
70
+ };
71
+ var defaultProps = {
72
+ item: defaultItem
73
+ };
74
+ var defaultMdmValues = {
75
+ uiPath: 'https://reltio.com/nui'
76
+ };
77
+ var setUp = function (_a) {
78
+ var _b = _a === void 0 ? {} : _a, _c = _b.props, props = _c === void 0 ? defaultProps : _c, _d = _b.mdmValues, mdmValues = _d === void 0 ? defaultMdmValues : _d;
79
+ var user = userEvent.setup();
80
+ var Providers = function (_a) {
81
+ var children = _a.children;
82
+ return (React.createElement(MdmModuleProvider, { values: mdmValues },
83
+ React.createElement(CollapsibleItemsProvider, null, children)));
32
84
  };
33
- it('should render correctly', function () {
34
- var wrapper = shallow(React.createElement(PotentialMatchRecord, { item: item }));
35
- expect(wrapper.find('EntityObject').length).toBe(1);
36
- expect(wrapper.find('PotentialMatchField').length).toBe(1);
85
+ return __assign({ user: user }, render(React.createElement(PotentialMatchRecord, __assign({}, props)), { wrapper: Providers }));
86
+ };
87
+ describe('Potential match record tests', function () {
88
+ it('should render nothing if there are not potentialMatches or newUri fields', function () {
89
+ var props = __assign(__assign({}, defaultProps), { item: __assign(__assign({}, defaultItem), { data: { type: ActivityTypes.POTENTIAL_MATCHES_FOUND } }) });
90
+ var container = setUp({ props: props }).container;
91
+ expect(container).toBeEmptyDOMElement();
37
92
  });
38
- it('should render newUri correctly', function () {
39
- var newUriItem = __assign(__assign({}, item), { data: {
40
- 'entities/2eIQy30G': 'HCP DT 2,',
41
- newUri: 'entities/2eIQy30G',
42
- type: 'ENTITIES_SPLITTED'
43
- } });
44
- var wrapper = shallow(React.createElement(PotentialMatchRecord, { item: newUriItem }));
45
- expect(wrapper.find('EntityObject').length).toBe(1);
46
- expect(wrapper.find('PotentialMatchField').length).toBe(1);
93
+ it('should render record label correctly', function () {
94
+ setUp();
95
+ expect(screen.getByText('record label')).toHaveAttribute('href', 'https://reltio.com/nui#p~com.reltio.plugins.entity.default.DefaultPerspective_e~entities/11EunumT');
47
96
  });
48
- it('should not render if there are not potentialMatches/newUri', function () {
49
- var wrapper = shallow(React.createElement(PotentialMatchRecord, { item: __assign(__assign({}, item), { data: { type: 'POTENTIAL_MATCHES_FOUND' } }) }));
50
- expect(wrapper.isEmptyRender()).toBe(true);
97
+ it('should render matches correctly for potentialMatches field', function () { return __awaiter(void 0, void 0, void 0, function () {
98
+ var user, _a, links, moreItemsLink;
99
+ var _b;
100
+ return __generator(this, function (_c) {
101
+ switch (_c.label) {
102
+ case 0:
103
+ user = setUp().user;
104
+ expect(screen.getByTestId('potential-matches-field')).toHaveTextContent('Matches found:entity label 1, entity label 2, entity label 3 and 2 more matches');
105
+ _a = screen.getAllByRole('link'), links = _a.slice(1);
106
+ expect(links).toHaveLength(3);
107
+ expect(links[0]).toHaveTextContent('entity label 1');
108
+ expect(links[0]).toHaveAttribute('href', 'https://reltio.com/nui#p~com.reltio.plugins.entity.default.DefaultPerspective_e~entities/sOoSQYm');
109
+ expect(links[1]).toHaveTextContent('entity label 2');
110
+ expect(links[1]).toHaveAttribute('href', 'https://reltio.com/nui#p~com.reltio.plugins.entity.default.DefaultPerspective_e~entities/sOoSQYq');
111
+ expect(links[2]).toHaveTextContent('entity label 3');
112
+ expect(links[2]).toHaveAttribute('href', 'https://reltio.com/nui#p~com.reltio.plugins.entity.default.DefaultPerspective_e~entities/sOoSQYw');
113
+ moreItemsLink = screen.getByRole('button', { name: '2 more matches' });
114
+ return [4 /*yield*/, user.click(moreItemsLink)];
115
+ case 1:
116
+ _c.sent();
117
+ expect(screen.getByTestId('potential-matches-field')).toHaveTextContent('Matches found:entity label 1, entity label 2, entity label 3, entity label 4, entity label 5');
118
+ _b = screen.getAllByRole('link'), links = _b.slice(1);
119
+ expect(links).toHaveLength(5);
120
+ expect(links[3]).toHaveTextContent('entity label 4');
121
+ expect(links[3]).toHaveAttribute('href', 'https://reltio.com/nui#p~com.reltio.plugins.entity.default.DefaultPerspective_e~entities/p3Js13Nm');
122
+ expect(links[4]).toHaveTextContent('entity label 5');
123
+ expect(links[4]).toHaveAttribute('href', 'https://reltio.com/nui#p~com.reltio.plugins.entity.default.DefaultPerspective_e~entities/zIlemSd09');
124
+ expect(moreItemsLink).not.toBeInTheDocument();
125
+ return [2 /*return*/];
126
+ }
127
+ });
128
+ }); });
129
+ it('should render matches correctly for newUri field', function () { return __awaiter(void 0, void 0, void 0, function () {
130
+ var props, user, _a, links, moreItemsLink;
131
+ var _b;
132
+ return __generator(this, function (_c) {
133
+ switch (_c.label) {
134
+ case 0:
135
+ props = __assign(__assign({}, defaultProps), { item: __assign(__assign({}, defaultItem), { data: {
136
+ type: ActivityTypes.ENTITIES_SPLITTED,
137
+ newUri: 'entities/sOoSQYm,entities/sOoSQYq,entities/sOoSQYw,entities/p3Js13Nm',
138
+ 'entities/sOoSQYm': 'entity label 1',
139
+ 'entities/sOoSQYq': 'entity label 2',
140
+ 'entities/sOoSQYw': 'entity label 3',
141
+ 'entities/p3Js13Nm': 'entity label 4'
142
+ } }) });
143
+ user = setUp({ props: props }).user;
144
+ expect(screen.getByTestId('potential-matches-field')).toHaveTextContent('Un-merged with:entity label 1, entity label 2, entity label 3 and 1 more match');
145
+ _a = screen.getAllByRole('link'), links = _a.slice(1);
146
+ expect(links).toHaveLength(3);
147
+ expect(links[0]).toHaveTextContent('entity label 1');
148
+ expect(links[0]).toHaveAttribute('href', 'https://reltio.com/nui#p~com.reltio.plugins.entity.default.DefaultPerspective_e~entities/sOoSQYm');
149
+ expect(links[1]).toHaveTextContent('entity label 2');
150
+ expect(links[1]).toHaveAttribute('href', 'https://reltio.com/nui#p~com.reltio.plugins.entity.default.DefaultPerspective_e~entities/sOoSQYq');
151
+ expect(links[2]).toHaveTextContent('entity label 3');
152
+ expect(links[2]).toHaveAttribute('href', 'https://reltio.com/nui#p~com.reltio.plugins.entity.default.DefaultPerspective_e~entities/sOoSQYw');
153
+ moreItemsLink = screen.getByRole('button', { name: '1 more match' });
154
+ return [4 /*yield*/, user.click(moreItemsLink)];
155
+ case 1:
156
+ _c.sent();
157
+ expect(screen.getByTestId('potential-matches-field')).toHaveTextContent('Un-merged with:entity label 1, entity label 2, entity label 3, entity label 4');
158
+ _b = screen.getAllByRole('link'), links = _b.slice(1);
159
+ expect(links).toHaveLength(4);
160
+ expect(links[3]).toHaveTextContent('entity label 4');
161
+ expect(links[3]).toHaveAttribute('href', 'https://reltio.com/nui#p~com.reltio.plugins.entity.default.DefaultPerspective_e~entities/p3Js13Nm');
162
+ expect(moreItemsLink).not.toBeInTheDocument();
163
+ return [2 /*return*/];
164
+ }
165
+ });
166
+ }); });
167
+ it('should not render more items link if items count is 3 or less', function () {
168
+ var props = __assign(__assign({}, defaultProps), { item: __assign(__assign({}, defaultItem), { data: {
169
+ potentialMatches: 'entities/sOoSQYm,entities/sOoSQYq,entities/sOoSQYw',
170
+ type: ActivityTypes.POTENTIAL_MATCHES_FOUND,
171
+ 'entities/sOoSQYm': 'entity label 1',
172
+ 'entities/sOoSQYq': 'entity label 2',
173
+ 'entities/sOoSQYw': 'entity label 3'
174
+ } }) });
175
+ setUp({ props: props });
176
+ expect(screen.queryByRole('button')).not.toBeInTheDocument();
51
177
  });
52
178
  });
@@ -16,7 +16,7 @@ export var PotentialMatchField = function (_a) {
16
16
  items: matches.split(',')
17
17
  }), onExpand = _c.onExpand, collapsedItemsCount = _c.collapsedItemsCount, itemsToShow = _c.itemsToShow;
18
18
  var type = data === null || data === void 0 ? void 0 : data.type;
19
- return (React.createElement(Field, { fieldName: getFieldName(type) },
19
+ return (React.createElement(Field, { fieldName: getFieldName(type), "data-reltio-id": "potential-matches-field" },
20
20
  itemsToShow
21
21
  .map(function (url, index) { return (React.createElement(EntityUriLink, { key: index, value: url, className: styles.link }, getLabel(data[url]))); })
22
22
  .reduce(function (prev, curr) { return [prev, ', ', curr]; }),