@reltio/components 1.4.2069 → 1.4.2071

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 (159) hide show
  1. package/FacetViewHeader/FacetViewHeader.js +1 -1
  2. package/ImageAttributesLine/imageAttributeValues.test-data.js +8 -0
  3. package/ImageAttributesLine/index.d.ts +1 -1
  4. package/ImageAttributesLine/index.js +1 -1
  5. package/ImageDetailsView/components/ImageDetailsViewCarousel/ImageDetailsViewCarousel.js +1 -1
  6. package/MergeButton/MergeButton.spec.js +55 -124
  7. package/MetadataTypesSelector/MetadataTypesSelector.js +1 -1
  8. package/MetadataTypesSelector/MetadataTypesSelector.test.js +193 -190
  9. package/MoreAttributesButton/MoreAttributesButton.test.js +173 -166
  10. package/MultiValueSelector/MultiValueSelector.test.js +78 -38
  11. package/MultipliableSelect/MultipliableSelect.test.js +111 -47
  12. package/NestedAttribute/NestedAttribute.test.js +121 -42
  13. package/NestedAttributeEditor/NestedAttributeEditor.test.js +95 -41
  14. package/NotMatchButton/NotMatchButton.spec.js +51 -100
  15. package/PieChart/PieChart.test.js +130 -114
  16. package/PinButton/PinButton.spec.js +89 -22
  17. package/PivotingTooltip/PivotingTooltip.test.js +338 -174
  18. package/PotentialMatchReviewCard/PotentialMatchReviewCard.spec.js +94 -29
  19. package/ProfileBand/ProfileBand.spec.js +60 -53
  20. package/ProfileCard/ProfileCard.test.js +109 -27
  21. package/ProfilesList/ProfilesList.d.ts +1 -3
  22. package/ProfilesList/ProfilesList.js +1 -1
  23. package/ProfilesList/ProfilesList.spec.js +226 -211
  24. package/QueryBuilderRow/QueryBuilderRow.spec.js +83 -90
  25. package/QueryBuilderRowsGroup/QueryBuilderRowsGroup.spec.js +195 -86
  26. package/ReactSelectLoadMoreButton/ReactSelectLoadMoreButton.test.js +73 -15
  27. package/ReactSelectMenuWithPopper/ReactSelectMenuWithPopper.test.js +71 -117
  28. package/ReadOnlyAttributeValuesBlock/ReadOnlyAttributeValuesBlock.test.js +128 -61
  29. package/ReadOnlyAttributesFactory/components/ReadOnlyAttribute/ReadOnlyAttribute.test.js +179 -44
  30. package/ReadOnlyAttributesList/ReadOnlyAttributesList.test.js +254 -211
  31. package/ReadOnlyAttributesList/attributes.test-data.js +4 -4
  32. package/ReadOnlyAttributesPager/ReadOnlyAttributesPager.test.js +75 -18
  33. package/ReadOnlyAttributesView/ReadOnlyAttributesView.test.js +187 -312
  34. package/ReadOnlyComplexAttribute/ReadOnlyComplexAttribute.test.js +210 -219
  35. package/ReadOnlyImageAttributesLine/ReadOnlyImageAttributesLine.test.js +89 -89
  36. package/ReferenceAttributeEditor/ReferenceAttributeEditor.test.js +556 -602
  37. package/ReferenceAttributeEditor/metadata.test-data.d.ts +13 -13
  38. package/ReferenceAttributeEditor/metadata.test-data.js +2 -2
  39. package/ReferenceAttributeEditor/styles.d.ts +1 -1
  40. package/RelationEditor/RelationEditor.test.js +1448 -1392
  41. package/RelationTypeSelector/RelationTypeSelector.test.js +99 -17
  42. package/RelationTypesSelector/RelationTypesSelector.test.js +73 -22
  43. package/ReltioMap/ReltioMap.spec.js +51 -25
  44. package/Roles/Roles.test.js +54 -10
  45. package/ScreenProfileBand/ScreenProfileBand.test.js +142 -72
  46. package/cjs/FacetViewHeader/FacetViewHeader.js +1 -1
  47. package/cjs/ImageAttributesLine/imageAttributeValues.test-data.js +8 -0
  48. package/cjs/ImageAttributesLine/index.d.ts +1 -1
  49. package/cjs/ImageAttributesLine/index.js +2 -1
  50. package/cjs/ImageDetailsView/components/ImageDetailsViewCarousel/ImageDetailsViewCarousel.js +1 -1
  51. package/cjs/MergeButton/MergeButton.spec.js +55 -124
  52. package/cjs/MetadataTypesSelector/MetadataTypesSelector.js +1 -1
  53. package/cjs/MetadataTypesSelector/MetadataTypesSelector.test.js +193 -190
  54. package/cjs/MoreAttributesButton/MoreAttributesButton.test.js +172 -165
  55. package/cjs/MultiValueSelector/MultiValueSelector.test.js +78 -38
  56. package/cjs/MultipliableSelect/MultipliableSelect.test.js +111 -47
  57. package/cjs/NestedAttribute/NestedAttribute.test.js +121 -42
  58. package/cjs/NestedAttributeEditor/NestedAttributeEditor.test.js +94 -40
  59. package/cjs/NotMatchButton/NotMatchButton.spec.js +51 -100
  60. package/cjs/PieChart/PieChart.test.js +130 -114
  61. package/cjs/PinButton/PinButton.spec.js +89 -22
  62. package/cjs/PivotingTooltip/PivotingTooltip.test.js +338 -174
  63. package/cjs/PotentialMatchReviewCard/PotentialMatchReviewCard.spec.js +94 -29
  64. package/cjs/ProfileBand/ProfileBand.spec.js +60 -53
  65. package/cjs/ProfileCard/ProfileCard.test.js +109 -27
  66. package/cjs/ProfilesList/ProfilesList.d.ts +1 -3
  67. package/cjs/ProfilesList/ProfilesList.js +1 -1
  68. package/cjs/ProfilesList/ProfilesList.spec.js +226 -211
  69. package/cjs/QueryBuilderRow/QueryBuilderRow.spec.js +83 -90
  70. package/cjs/QueryBuilderRowsGroup/QueryBuilderRowsGroup.spec.js +195 -86
  71. package/cjs/ReactSelectLoadMoreButton/ReactSelectLoadMoreButton.test.js +73 -15
  72. package/cjs/ReactSelectMenuWithPopper/ReactSelectMenuWithPopper.test.js +71 -117
  73. package/cjs/ReadOnlyAttributeValuesBlock/ReadOnlyAttributeValuesBlock.test.js +128 -61
  74. package/cjs/ReadOnlyAttributesFactory/components/ReadOnlyAttribute/ReadOnlyAttribute.test.js +179 -44
  75. package/cjs/ReadOnlyAttributesList/ReadOnlyAttributesList.test.js +254 -211
  76. package/cjs/ReadOnlyAttributesList/attributes.test-data.js +4 -4
  77. package/cjs/ReadOnlyAttributesPager/ReadOnlyAttributesPager.test.js +75 -18
  78. package/cjs/ReadOnlyAttributesView/ReadOnlyAttributesView.test.js +185 -310
  79. package/cjs/ReadOnlyComplexAttribute/ReadOnlyComplexAttribute.test.js +209 -218
  80. package/cjs/ReadOnlyImageAttributesLine/ReadOnlyImageAttributesLine.test.js +89 -89
  81. package/cjs/ReferenceAttributeEditor/ReferenceAttributeEditor.test.js +555 -601
  82. package/cjs/ReferenceAttributeEditor/metadata.test-data.d.ts +13 -13
  83. package/cjs/ReferenceAttributeEditor/metadata.test-data.js +2 -2
  84. package/cjs/ReferenceAttributeEditor/styles.d.ts +1 -1
  85. package/cjs/RelationEditor/RelationEditor.test.js +1446 -1390
  86. package/cjs/RelationTypeSelector/RelationTypeSelector.test.js +99 -17
  87. package/cjs/RelationTypesSelector/RelationTypesSelector.test.js +73 -22
  88. package/cjs/ReltioMap/ReltioMap.spec.js +51 -25
  89. package/cjs/Roles/Roles.test.js +54 -10
  90. package/cjs/ScreenProfileBand/ScreenProfileBand.test.js +141 -71
  91. package/package.json +2 -2
  92. package/MetadataTypesSelector/components/ListLabel/ListLabel.test.d.ts +0 -1
  93. package/MetadataTypesSelector/components/ListLabel/ListLabel.test.js +0 -24
  94. package/PivotingTooltip/IntegrationPivotingTooltip.test.d.ts +0 -1
  95. package/PivotingTooltip/IntegrationPivotingTooltip.test.js +0 -356
  96. package/PivotingTooltip/components/PivotingTooltipContent/PivotingTooltipContent.test.d.ts +0 -1
  97. package/PivotingTooltip/components/PivotingTooltipContent/PivotingTooltipContent.test.js +0 -201
  98. package/ProfileCard/components/ProfileCardContent/ProfileCardContent.test.d.ts +0 -1
  99. package/ProfileCard/components/ProfileCardContent/ProfileCardContent.test.js +0 -43
  100. package/QueryBuilderRow/components/ReadOnlyFilter/ReadOnlyFilter.spec.d.ts +0 -1
  101. package/QueryBuilderRow/components/ReadOnlyFilter/ReadOnlyFilter.spec.js +0 -31
  102. package/QueryBuilderRow/components/ReadOnlyLogicOperator/ReadOnlyLogicOperator.spec.d.ts +0 -1
  103. package/QueryBuilderRow/components/ReadOnlyLogicOperator/ReadOnlyLogicOperator.spec.js +0 -31
  104. package/ReadOnlyAttributesPager/components/ImageLineRenderer/ImageLineRenderer.test.d.ts +0 -1
  105. package/ReadOnlyAttributesPager/components/ImageLineRenderer/ImageLineRenderer.test.js +0 -45
  106. package/ReadOnlyAttributesPager/components/MultiLineRenderer/MultiLineRenderer.test.d.ts +0 -1
  107. package/ReadOnlyAttributesPager/components/MultiLineRenderer/MultiLineRenderer.test.js +0 -114
  108. package/ReadOnlyAttributesPager/components/OneLineRenderer/OneLineRenderer.test.d.ts +0 -1
  109. package/ReadOnlyAttributesPager/components/OneLineRenderer/OneLineRenderer.test.js +0 -107
  110. package/ReadOnlyAttributesPager/components/SpecialRenderer/SpecialRenderer.test.d.ts +0 -1
  111. package/ReadOnlyAttributesPager/components/SpecialRenderer/SpecialRenderer.test.js +0 -72
  112. package/RelationEditor/IntegrationRelationEditor.test.d.ts +0 -1
  113. package/RelationEditor/IntegrationRelationEditor.test.js +0 -337
  114. package/ReltioMap/components/MapControlContainer/MapControlContainer.d.ts +0 -10
  115. package/ReltioMap/components/MapControlContainer/MapControlContainer.js +0 -24
  116. package/ReltioMap/components/MapControlContainer/MapControlContainer.spec.d.ts +0 -1
  117. package/ReltioMap/components/MapControlContainer/MapControlContainer.spec.js +0 -33
  118. package/ReltioMap/components/MapControlContainer/index.d.ts +0 -1
  119. package/ReltioMap/components/MapControlContainer/index.js +0 -1
  120. package/ReltioMap/components/TopCenterMapControls/TopCenterMapControls.spec.d.ts +0 -1
  121. package/ReltioMap/components/TopCenterMapControls/TopCenterMapControls.spec.js +0 -36
  122. package/ReltioMap/components/TopRightMapControls/TopRightMapControls.spec.d.ts +0 -1
  123. package/ReltioMap/components/TopRightMapControls/TopRightMapControls.spec.js +0 -60
  124. package/Roles/components/Role/Role.test.d.ts +0 -1
  125. package/Roles/components/Role/Role.test.js +0 -55
  126. package/cjs/MetadataTypesSelector/components/ListLabel/ListLabel.test.d.ts +0 -1
  127. package/cjs/MetadataTypesSelector/components/ListLabel/ListLabel.test.js +0 -52
  128. package/cjs/PivotingTooltip/IntegrationPivotingTooltip.test.d.ts +0 -1
  129. package/cjs/PivotingTooltip/IntegrationPivotingTooltip.test.js +0 -361
  130. package/cjs/PivotingTooltip/components/PivotingTooltipContent/PivotingTooltipContent.test.d.ts +0 -1
  131. package/cjs/PivotingTooltip/components/PivotingTooltipContent/PivotingTooltipContent.test.js +0 -206
  132. package/cjs/ProfileCard/components/ProfileCardContent/ProfileCardContent.test.d.ts +0 -1
  133. package/cjs/ProfileCard/components/ProfileCardContent/ProfileCardContent.test.js +0 -48
  134. package/cjs/QueryBuilderRow/components/ReadOnlyFilter/ReadOnlyFilter.spec.d.ts +0 -1
  135. package/cjs/QueryBuilderRow/components/ReadOnlyFilter/ReadOnlyFilter.spec.js +0 -36
  136. package/cjs/QueryBuilderRow/components/ReadOnlyLogicOperator/ReadOnlyLogicOperator.spec.d.ts +0 -1
  137. package/cjs/QueryBuilderRow/components/ReadOnlyLogicOperator/ReadOnlyLogicOperator.spec.js +0 -36
  138. package/cjs/ReadOnlyAttributesPager/components/ImageLineRenderer/ImageLineRenderer.test.d.ts +0 -1
  139. package/cjs/ReadOnlyAttributesPager/components/ImageLineRenderer/ImageLineRenderer.test.js +0 -50
  140. package/cjs/ReadOnlyAttributesPager/components/MultiLineRenderer/MultiLineRenderer.test.d.ts +0 -1
  141. package/cjs/ReadOnlyAttributesPager/components/MultiLineRenderer/MultiLineRenderer.test.js +0 -119
  142. package/cjs/ReadOnlyAttributesPager/components/OneLineRenderer/OneLineRenderer.test.d.ts +0 -1
  143. package/cjs/ReadOnlyAttributesPager/components/OneLineRenderer/OneLineRenderer.test.js +0 -112
  144. package/cjs/ReadOnlyAttributesPager/components/SpecialRenderer/SpecialRenderer.test.d.ts +0 -1
  145. package/cjs/ReadOnlyAttributesPager/components/SpecialRenderer/SpecialRenderer.test.js +0 -77
  146. package/cjs/RelationEditor/IntegrationRelationEditor.test.d.ts +0 -1
  147. package/cjs/RelationEditor/IntegrationRelationEditor.test.js +0 -342
  148. package/cjs/ReltioMap/components/MapControlContainer/MapControlContainer.d.ts +0 -10
  149. package/cjs/ReltioMap/components/MapControlContainer/MapControlContainer.js +0 -28
  150. package/cjs/ReltioMap/components/MapControlContainer/MapControlContainer.spec.d.ts +0 -1
  151. package/cjs/ReltioMap/components/MapControlContainer/MapControlContainer.spec.js +0 -38
  152. package/cjs/ReltioMap/components/MapControlContainer/index.d.ts +0 -1
  153. package/cjs/ReltioMap/components/MapControlContainer/index.js +0 -5
  154. package/cjs/ReltioMap/components/TopCenterMapControls/TopCenterMapControls.spec.d.ts +0 -1
  155. package/cjs/ReltioMap/components/TopCenterMapControls/TopCenterMapControls.spec.js +0 -41
  156. package/cjs/ReltioMap/components/TopRightMapControls/TopRightMapControls.spec.d.ts +0 -1
  157. package/cjs/ReltioMap/components/TopRightMapControls/TopRightMapControls.spec.js +0 -65
  158. package/cjs/Roles/components/Role/Role.test.d.ts +0 -1
  159. package/cjs/Roles/components/Role/Role.test.js +0 -60
@@ -1,201 +0,0 @@
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
- };
48
- import React from 'react';
49
- import { mount } from 'enzyme';
50
- import { act } from 'react-dom/test-utils';
51
- import { getTotals } from '@reltio/mdm-sdk';
52
- import { PivotingUriLink } from '../../../PivotingUriLink';
53
- import { MdmModuleProvider } from '../../../contexts/MdmModuleContext';
54
- import { PivotingTooltipContent } from './PivotingTooltipContent';
55
- jest.mock('@reltio/mdm-sdk', function () { return (__assign(__assign({}, jest.requireActual('@reltio/mdm-sdk')), { getFilteredEntities: jest.fn(), getTotals: jest.fn() })); });
56
- jest.mock('../../../EntityAvatar', function () { return ({
57
- EntityAvatar: function () { return React.createElement("div", null); }
58
- }); });
59
- var entityType = 'configuration/entityTypes/HCP';
60
- var entity = {
61
- uri: 'entities/13JKIKAz',
62
- type: entityType,
63
- attributes: {},
64
- label: 'Active'
65
- };
66
- var mdmValues = {
67
- activityFilter: undefined,
68
- globalFilter: {
69
- query: "((equals(type,'configuration/entityTypes/HCP') and (range(updatedTime,1622458333452,1622717533451) or range(updatedTime,1622458333452,1622717533451))))",
70
- savedSearches: [],
71
- savedSearchesUris: []
72
- },
73
- searchOptions: {},
74
- entity: entity,
75
- uiPath: 'https://reltio.com/nui'
76
- };
77
- var defaultProps = {
78
- generatedValue: [{ CountryCode: 'IT' }],
79
- value: '123 456',
80
- attributeType: {
81
- label: 'Country Code',
82
- name: 'CountryCode',
83
- type: 'String',
84
- uri: 'configuration/entityTypes/HCP/attributes/CountryCode'
85
- },
86
- config: {},
87
- onSeeAllClick: jest.fn(),
88
- entities: [
89
- {
90
- uri: 'entities/1',
91
- type: 'configuration/entityTypes/HCP',
92
- label: 'BulkUpdate_regression_12',
93
- secondaryLabel: 'UKyFCjjugYimtXm Ihmetwet'
94
- }
95
- ],
96
- total: 2
97
- };
98
- var setUp = function (props) {
99
- if (props === void 0) { props = defaultProps; }
100
- return mount(React.createElement(MdmModuleProvider, { values: mdmValues },
101
- React.createElement(PivotingTooltipContent, __assign({}, props))));
102
- };
103
- describe('PivotingTooltipContent test', function () {
104
- it('EntityUriLink should be rendered', function () { return __awaiter(void 0, void 0, void 0, function () {
105
- var component, entityContainer;
106
- return __generator(this, function (_a) {
107
- component = setUp();
108
- expect(component).not.toBeNull();
109
- entityContainer = component.find('.entityContainer');
110
- expect(entityContainer.length).toBe(1);
111
- return [2 /*return*/];
112
- });
113
- }); });
114
- it('EntityUriLink should be rendered with to many entities', function () { return __awaiter(void 0, void 0, void 0, function () {
115
- var component, entityContainer;
116
- return __generator(this, function (_a) {
117
- component = setUp(__assign(__assign({}, defaultProps), { entities: [
118
- {
119
- uri: 'entities/1',
120
- type: 'configuration/entityTypes/HCP',
121
- label: 'BulkUpdate_regression_12',
122
- secondaryLabel: 'UKyFCjjugYimtXm Ihmetwet'
123
- },
124
- {
125
- uri: 'entities/2',
126
- type: 'configuration/entityTypes/HCP',
127
- label: 'BulkUpdate_regression_12',
128
- secondaryLabel: 'UKyFCjjugYimtXm Ihmetwet'
129
- },
130
- {
131
- uri: 'entities/3',
132
- type: 'configuration/entityTypes/HCP',
133
- label: 'BulkUpdate_regression_12',
134
- secondaryLabel: 'UKyFCjjugYimtXm Ihmetwet'
135
- },
136
- {
137
- uri: 'entities/4',
138
- type: 'configuration/entityTypes/HCP',
139
- label: 'BulkUpdate_regression_12',
140
- secondaryLabel: 'UKyFCjjugYimtXm Ihmetwet'
141
- },
142
- {
143
- uri: 'entities/5',
144
- type: 'configuration/entityTypes/HCP',
145
- label: 'BulkUpdate_regression_12',
146
- secondaryLabel: 'UKyFCjjugYimtXm Ihmetwet'
147
- },
148
- {
149
- uri: 'entities/6',
150
- type: 'configuration/entityTypes/HCP',
151
- label: 'BulkUpdate_regression_12',
152
- secondaryLabel: 'UKyFCjjugYimtXm Ihmetwet'
153
- }
154
- ] }));
155
- expect(component).not.toBeNull();
156
- entityContainer = component.find('.entityContainer');
157
- expect(entityContainer.length).toBe(6);
158
- return [2 /*return*/];
159
- });
160
- }); });
161
- it('should show number of items correctly', function () { return __awaiter(void 0, void 0, void 0, function () {
162
- var component;
163
- return __generator(this, function (_a) {
164
- component = setUp();
165
- expect(component.find('.headerCount').text()).toBe('2 items');
166
- return [2 /*return*/];
167
- });
168
- }); });
169
- it('should not show footer with see all button if total count less than 6', function () { return __awaiter(void 0, void 0, void 0, function () {
170
- var component;
171
- return __generator(this, function (_a) {
172
- getTotals.mockImplementation(function () { return Promise.resolve({ total: 4 }); });
173
- component = setUp();
174
- expect(component.find('.footer')).toHaveLength(0);
175
- return [2 /*return*/];
176
- });
177
- }); });
178
- it('should show footer with see all button if total count more than 6', function () { return __awaiter(void 0, void 0, void 0, function () {
179
- var component;
180
- return __generator(this, function (_a) {
181
- getTotals.mockImplementation(function () { return Promise.resolve({ total: 10 }); });
182
- component = setUp(__assign(__assign({}, defaultProps), { total: 7 }));
183
- expect(component.find('.footer')).toHaveLength(1);
184
- return [2 /*return*/];
185
- });
186
- }); });
187
- it('handleClickSeeAll handler should work and the properties are passed correctly', function () { return __awaiter(void 0, void 0, void 0, function () {
188
- var generatedValue, attributeType, onSeeAllClick, component;
189
- return __generator(this, function (_a) {
190
- generatedValue = defaultProps.generatedValue, attributeType = defaultProps.attributeType, onSeeAllClick = defaultProps.onSeeAllClick;
191
- component = setUp(__assign(__assign({}, defaultProps), { total: 7 }));
192
- act(function () {
193
- component.find(PivotingUriLink).prop('onClick')();
194
- });
195
- expect(onSeeAllClick).toHaveBeenCalled();
196
- expect(component.find(PivotingUriLink).prop('value')).toEqual(generatedValue);
197
- expect(component.find(PivotingUriLink).prop('attributeType')).toEqual(attributeType);
198
- return [2 /*return*/];
199
- });
200
- }); });
201
- });
@@ -1,43 +0,0 @@
1
- import React from 'react';
2
- import { shallow } from 'enzyme';
3
- import { ProfileCardContent } from './ProfileCardContent';
4
- import { EntityAvatar } from '../../../EntityAvatar';
5
- import { ExpandedValueTooltip } from '../../../ExpandedValueTooltip';
6
- import { EntityTypeBadge } from '../../../EntityTypeBadge';
7
- import { EntityUriLink } from '../../../EntityUriLink';
8
- describe('ProfileCardContent tests', function () {
9
- var entity = {
10
- uri: 'entities/123',
11
- label: 'Main label',
12
- secondaryLabel: 'secondary label',
13
- type: 'configuration/entityTypes/HCP'
14
- };
15
- var writeTextFn = jest.fn();
16
- beforeAll(function () {
17
- Object.assign(navigator, {
18
- clipboard: {
19
- writeText: writeTextFn
20
- }
21
- });
22
- });
23
- it('should render main parts', function () {
24
- var component = shallow(React.createElement(ProfileCardContent, { entity: entity }));
25
- expect(component.find(EntityAvatar).length).toBe(1);
26
- expect(component.find(EntityAvatar).prop('entity')).toBe(entity);
27
- var link = component.find(EntityUriLink);
28
- expect(link.length).toBe(1);
29
- expect(link.prop('value')).toBe('entities/123');
30
- var expandedValueTooltip = link.find(ExpandedValueTooltip);
31
- expect(expandedValueTooltip.length).toBe(1);
32
- expect(expandedValueTooltip.prop('value')).toBe(entity.label);
33
- expect(component.find(ExpandedValueTooltip).at(1).prop('value')).toBe(entity.secondaryLabel);
34
- expect(component.find(EntityTypeBadge).length).toBe(1);
35
- expect(component.find(EntityTypeBadge).prop('entity')).toBe(entity);
36
- expect(component.find('.entityIdValue').text()).toBe(entity.uri.split('/')[1]);
37
- });
38
- it('should copy entity ID on click', function () {
39
- var component = shallow(React.createElement(ProfileCardContent, { entity: entity }));
40
- component.find('.entityId').simulate('click');
41
- expect(writeTextFn).toHaveBeenCalledWith('123');
42
- });
43
- });
@@ -1,31 +0,0 @@
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
- import React from 'react';
13
- import { shallow } from 'enzyme';
14
- import { ReadOnlyFilter } from './ReadOnlyFilter';
15
- describe('ReadOnlyFilter tests', function () {
16
- it('should render filter if rowData.filter is defined', function () {
17
- var props = {
18
- rowData: { filter: 'exists' },
19
- rowContext: {}
20
- };
21
- var component = shallow(React.createElement(ReadOnlyFilter, __assign({}, props)));
22
- expect(component.text()).toBe('exists');
23
- });
24
- it('should render "equals" if rowData is undefined', function () {
25
- var props = {
26
- rowContext: {}
27
- };
28
- var component = shallow(React.createElement(ReadOnlyFilter, __assign({}, props)));
29
- expect(component.text()).toBe('equals');
30
- });
31
- });
@@ -1,31 +0,0 @@
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
- import React from 'react';
13
- import { shallow } from 'enzyme';
14
- import { ReadOnlyLogicOperator } from './ReadOnlyLogicOperator';
15
- describe('ReadOnlyLogicOperator tests', function () {
16
- it('should show capitalized logic operator when operator is defined', function () {
17
- var props = {
18
- rowData: { operator: 'and' },
19
- rowContext: {}
20
- };
21
- var component = shallow(React.createElement(ReadOnlyLogicOperator, __assign({}, props)));
22
- expect(component.text()).toBe('And');
23
- });
24
- it('should show "Where" caption when operator is undefined', function () {
25
- var props = {
26
- rowContext: {}
27
- };
28
- var component = shallow(React.createElement(ReadOnlyLogicOperator, __assign({}, props)));
29
- expect(component.text()).toBe('Where');
30
- });
31
- });
@@ -1,45 +0,0 @@
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
- import React from 'react';
13
- import { shallow } from 'enzyme';
14
- import { ImageLineRenderer } from './ImageLineRenderer';
15
- import { ReadOnlyImageAttributesLine } from '../../../ReadOnlyImageAttributesLine';
16
- import { AttributeTitle } from '../../../AttributeTitle';
17
- import { DescriptionIcon } from '../../../DescriptionIcon';
18
- var attributeType = {
19
- uri: 'configuration/entityTypes/HCP/attributes/ImageGallery',
20
- type: 'Image',
21
- name: 'ImageGallery',
22
- label: 'Image Gallery',
23
- description: 'Image Gallery description'
24
- };
25
- var props = {
26
- attributeValues: [],
27
- attributeType: attributeType,
28
- paging: {},
29
- parentUri: 'entities/sIeHttl',
30
- requestNextPageOfAttributeValues: jest.fn(),
31
- showNonOv: false
32
- };
33
- describe('ImageLineRenderer tests', function () {
34
- it('should render ReadOnlyImageAttributesLine with correct props', function () {
35
- var component = shallow(React.createElement(ImageLineRenderer, __assign({}, props)));
36
- expect(component.find(ReadOnlyImageAttributesLine).props()).toEqual(props);
37
- });
38
- it('should render title row correctly', function () {
39
- var component = shallow(React.createElement(ImageLineRenderer, __assign({}, props)));
40
- var titleRow = component.find('.titleRow');
41
- expect(titleRow).toHaveLength(1);
42
- expect(titleRow.find(AttributeTitle).prop('label')).toBe(attributeType.label);
43
- expect(titleRow.find(DescriptionIcon).prop('description')).toBe(attributeType.description);
44
- });
45
- });
@@ -1,114 +0,0 @@
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
- import React from 'react';
13
- import { shallow } from 'enzyme';
14
- import { MultiLineRenderer } from './MultiLineRenderer';
15
- import { ReadOnlyAttribute } from '../../../ReadOnlyAttributesFactory';
16
- import { AttributeTitle } from '../../../AttributeTitle';
17
- import { ShowMore } from '../../../ShowMore';
18
- import { ShowLess } from '../../../ShowLess';
19
- import { OvIcon } from '../../../OvIcon';
20
- import { DescriptionIcon } from '../../../DescriptionIcon';
21
- describe('MultiLineRenderer tests', function () {
22
- var attributeType = {
23
- uri: 'configuration/entityTypes/HCP/attributes/Simple',
24
- type: 'String',
25
- name: 'Simple',
26
- label: 'Simple label',
27
- description: 'Description for Simple'
28
- };
29
- var values = [
30
- {
31
- type: attributeType.uri,
32
- uri: 'entities/sIeHttl/attributes/Simple/u123',
33
- value: '123',
34
- ov: true
35
- },
36
- {
37
- type: attributeType.uri,
38
- uri: 'entities/sIeHttl/attributes/Simple/u456',
39
- value: '456',
40
- ov: true
41
- }
42
- ];
43
- var defaultProps = {
44
- attributeType: attributeType,
45
- values: values,
46
- nonVisibleValues: [],
47
- parentUri: 'entities/sIeHttl',
48
- showNonOv: false,
49
- totalNonVisibleValues: 0,
50
- max: 10,
51
- totalVisibleValues: 2,
52
- requestNextPageOfAttributeValues: jest.fn()
53
- };
54
- it('should render main parts', function () {
55
- var props = __assign({}, defaultProps);
56
- var component = shallow(React.createElement(MultiLineRenderer, __assign({}, props)));
57
- var title = component.find(AttributeTitle);
58
- expect(title.length).toBe(1);
59
- expect(title.prop('label')).toBe(props.attributeType.label);
60
- var descriptionIcon = component.find(DescriptionIcon);
61
- expect(descriptionIcon.length).toBe(1);
62
- expect(descriptionIcon.prop('description')).toBe(props.attributeType.description);
63
- var ovIcon = component.find(OvIcon);
64
- expect(ovIcon.length).toBe(1);
65
- expect(ovIcon.prop('nonOvValues')).toBe(props.nonVisibleValues);
66
- expect(ovIcon.prop('attributeType')).toBe(props.attributeType);
67
- expect(ovIcon.prop('nonOvTotal')).toBe(props.totalNonVisibleValues);
68
- expect(component.find(ShowMore).length).toBe(0);
69
- expect(component.find(ShowLess).length).toBe(0);
70
- expect(component.find(ReadOnlyAttribute).length).toBe(2);
71
- });
72
- it('should set correct props for ReadOnlyAttribute component', function () {
73
- var props = __assign({}, defaultProps);
74
- var component = shallow(React.createElement(MultiLineRenderer, __assign({}, props)));
75
- var attributes = component.find(ReadOnlyAttribute);
76
- expect(attributes.length).toBe(2);
77
- attributes.forEach(function (attribute, i) {
78
- expect(attribute.prop('attributeValue')).toBe(props.values[i]);
79
- expect(attribute.prop('attributeType')).toBe(props.attributeType);
80
- });
81
- });
82
- it('should render showMore if "totalOvValues" prop is greater than "max" prop', function () {
83
- var props = __assign(__assign({}, defaultProps), { totalVisibleValues: 5, max: 2, requestNextPageOfAttributeValues: jest.fn() });
84
- var component = shallow(React.createElement(MultiLineRenderer, __assign({}, props)));
85
- expect(component.find(ShowLess).length).toBe(0);
86
- expect(component.find(ShowMore).length).toBe(1);
87
- expect(component.find(ShowMore).prop('moreNumber')).toBe(2);
88
- expect(component.find(ShowMore).prop('valueNumber')).toBe(3);
89
- expect(props.requestNextPageOfAttributeValues).toHaveBeenCalledTimes(0);
90
- component.find(ShowMore).prop('onClick')();
91
- expect(props.requestNextPageOfAttributeValues).toHaveBeenCalledWith({
92
- parentUri: props.parentUri,
93
- attributeTypeUri: props.attributeType.uri,
94
- attributeTypeName: props.attributeType.name,
95
- values: props.values,
96
- defaultMaxValues: props.max
97
- });
98
- expect(props.requestNextPageOfAttributeValues).toHaveBeenCalledTimes(1);
99
- expect(component.find(ShowLess).length).toBe(0);
100
- expect(component.find(ShowMore).length).toBe(1);
101
- expect(component.find(ShowMore).prop('moreNumber')).toBe(1);
102
- expect(component.find(ShowMore).prop('valueNumber')).toBe(1);
103
- component.find(ShowMore).prop('onClick')();
104
- expect(props.requestNextPageOfAttributeValues).toHaveBeenCalledTimes(2);
105
- expect(component.find(ShowLess).length).toBe(1);
106
- expect(component.find(ShowMore).length).toBe(0);
107
- component.find(ShowLess).prop('onClick')();
108
- expect(props.requestNextPageOfAttributeValues).toHaveBeenCalledTimes(2);
109
- expect(component.find(ShowLess).length).toBe(0);
110
- expect(component.find(ShowMore).length).toBe(1);
111
- expect(component.find(ShowMore).prop('moreNumber')).toBe(2);
112
- expect(component.find(ShowMore).prop('valueNumber')).toBe(3);
113
- });
114
- });
@@ -1,107 +0,0 @@
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
- import React from 'react';
13
- import { shallow } from 'enzyme';
14
- import { CollaborationObjectTypes } from '@reltio/mdm-sdk';
15
- import { OneLineRenderer } from './OneLineRenderer';
16
- import { ReadOnlyAttribute } from '../../../ReadOnlyAttributesFactory';
17
- import { AttributeTitle } from '../../../AttributeTitle';
18
- import { OvIcon } from '../../../OvIcon';
19
- import { DescriptionIcon } from '../../../DescriptionIcon';
20
- import { CommentsContainer } from '../../../CommentsContainer';
21
- import { COMMENTS_CONTAINER_VISIBILITY_AREA } from '../../../constants/classnames';
22
- describe('OneLineRenderer tests', function () {
23
- var attributeType = {
24
- uri: 'configuration/entityTypes/HCP/attributes/Simple',
25
- type: 'String',
26
- name: 'Simple',
27
- label: 'Simple label',
28
- description: 'Simple description'
29
- };
30
- var value = {
31
- type: attributeType.uri,
32
- uri: 'entities/sIeHttl/attributes/Simple/u123',
33
- value: '123',
34
- ov: true
35
- };
36
- var defaultProps = {
37
- attributeType: attributeType,
38
- value: value,
39
- nonVisibleValues: [],
40
- totalNonVisibleValues: 0
41
- };
42
- it('should render main parts', function () {
43
- var props = __assign({}, defaultProps);
44
- var component = shallow(React.createElement(OneLineRenderer, __assign({}, props)));
45
- var title = component.find(AttributeTitle);
46
- expect(title.length).toBe(1);
47
- expect(title.prop('label')).toBe(props.attributeType.label);
48
- var descriptionIcon = component.find(DescriptionIcon);
49
- expect(descriptionIcon.length).toBe(1);
50
- expect(descriptionIcon.prop('description')).toBe(props.attributeType.description);
51
- var ovIcon = component.find(OvIcon);
52
- expect(ovIcon.length).toBe(1);
53
- expect(ovIcon.prop('nonOvValues')).toBe(props.nonVisibleValues);
54
- expect(ovIcon.prop('attributeType')).toBe(props.attributeType);
55
- expect(ovIcon.prop('nonOvTotal')).toBe(props.totalNonVisibleValues);
56
- expect(component.find(ReadOnlyAttribute).length).toBe(1);
57
- expect(component.find(CommentsContainer).length).toBe(1);
58
- });
59
- it('should set correct props for ReadOnlyAttribute component', function () {
60
- var props = __assign({}, defaultProps);
61
- var component = shallow(React.createElement(OneLineRenderer, __assign({}, props)));
62
- var attribute = component.find(ReadOnlyAttribute);
63
- expect(attribute.length).toBe(1);
64
- expect(attribute.prop('attributeValue')).toBe(props.value);
65
- expect(attribute.prop('attributeType')).toBe(props.attributeType);
66
- expect(attribute.prop('inlined')).toBe(true);
67
- });
68
- it('should render CommentsContainer inside COMMENTS_CONTAINER_VISIBILITY_AREA with correct props', function () {
69
- var props = __assign({}, defaultProps);
70
- var component = shallow(React.createElement(OneLineRenderer, __assign({}, props)));
71
- var commentsContainer = component.find(".".concat(COMMENTS_CONTAINER_VISIBILITY_AREA)).find(CommentsContainer);
72
- expect(commentsContainer.length).toBe(1);
73
- expect(commentsContainer.prop('uri')).toBe('entities/sIeHttl/attributes/Simple/u123');
74
- expect(commentsContainer.prop('relatedObjectUris')).toEqual(['entities/sIeHttl']);
75
- expect(commentsContainer.prop('objectType')).toBe(CollaborationObjectTypes.ENTITY_ATTRIBUTE);
76
- });
77
- it('should set correct props for CommentsContainer component if we have relation attribute', function () {
78
- var relationAttributeType = {
79
- uri: 'configuration/relationTypes/HCPtoHCP/attributes/AffiliationStatus',
80
- type: 'String',
81
- name: 'AffiliationStatus',
82
- label: 'Affiliation Status'
83
- };
84
- var value = {
85
- type: relationAttributeType.uri,
86
- uri: 'relations/12rMNliU/attributes/AffiliationSubType/3e6txxgYJ',
87
- value: 'Active',
88
- ov: true
89
- };
90
- var props = {
91
- attributeType: relationAttributeType,
92
- value: value,
93
- nonVisibleValues: [],
94
- totalNonVisibleValues: 0
95
- };
96
- var component = shallow(React.createElement(OneLineRenderer, __assign({}, props)));
97
- var commentsContainer = component.find(CommentsContainer);
98
- expect(commentsContainer.prop('relatedObjectUris')).toEqual(['relations/12rMNliU']);
99
- expect(commentsContainer.prop('objectType')).toBe(CollaborationObjectTypes.RELATION_ATTRIBUTE);
100
- component.setProps({
101
- value: __assign(__assign({}, value), { uri: 'entities/sIeHttl/attributes/Reference/r123/Simple/u123' })
102
- });
103
- commentsContainer = component.find(CommentsContainer);
104
- expect(commentsContainer.prop('relatedObjectUris')).toEqual(['entities/sIeHttl']);
105
- expect(commentsContainer.prop('objectType')).toBe(CollaborationObjectTypes.ENTITY_ATTRIBUTE);
106
- });
107
- });