@reltio/components 1.4.2070 → 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 +1 -1
  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
@@ -46,14 +46,14 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
46
46
  }
47
47
  };
48
48
  import React from 'react';
49
- import { mount } from 'enzyme';
50
- import { act } from 'react-dom/test-utils';
51
- import Tooltip from '@mui/material/Tooltip';
52
- import { PivotingTooltip } from './PivotingTooltip';
53
- import { PivotingUriLink } from '../PivotingUriLink';
49
+ import { getFilteredEntities, getTotals } from '@reltio/mdm-sdk';
50
+ import { render, screen, within } from '@testing-library/react';
51
+ import userEvent from '@testing-library/user-event';
54
52
  import { MdmModuleProvider } from '../contexts/MdmModuleContext';
55
53
  import { PivotingAttributeContext } from '../contexts/PivotingAttributeContext';
56
- jest.mock('@reltio/mdm-sdk', function () { return (__assign(__assign({}, jest.requireActual('@reltio/mdm-sdk')), { getFilteredEntities: jest.fn() })); });
54
+ import { PivotingTooltip } from './PivotingTooltip';
55
+ jest.mock('@reltio/mdm-sdk', function () { return (__assign(__assign({}, jest.requireActual('@reltio/mdm-sdk')), { getFilteredEntities: jest.fn(), getTotals: jest.fn() })); });
56
+ var mdmActions = { openPivotingPerspective: jest.fn() };
57
57
  var attributes = [
58
58
  {
59
59
  name: 'Phone',
@@ -83,17 +83,46 @@ var attributes = [
83
83
  var metadata = {
84
84
  entityTypes: [
85
85
  {
86
- attributes: attributes,
87
86
  uri: 'configuration/entityTypes/HCP',
87
+ attributes: attributes,
88
88
  analyticsAttributes: []
89
+ },
90
+ {
91
+ uri: 'configuration/entityTypes/HCO',
92
+ attributes: []
89
93
  }
90
94
  ]
91
95
  };
92
- var uiPath = 'https://reltio.com/nui';
93
- var openPivotingPerspective = jest.fn();
96
+ var defaultMdmValues = {
97
+ metadata: metadata,
98
+ uiPath: 'https://reltio.com/nui',
99
+ globalFilter: {
100
+ query: "((equals(type,'configuration/entityTypes/HCP') and (range(updatedTime,1622458333452,1622717533451) or range(updatedTime,1622458333452,1622717533451))))",
101
+ savedSearches: [],
102
+ savedSearchesUris: []
103
+ },
104
+ entity: { uri: 'entityUri', type: 'configuration/entityTypes/HCP' }
105
+ };
106
+ var defaultProps = {
107
+ value: {
108
+ value: '8-800-555-35-35',
109
+ ov: true,
110
+ type: 'String',
111
+ lookupCode: '8-800-555-35-35',
112
+ lookupRawValue: '8-800-555-35-35',
113
+ uri: 'configuration/entityTypes/HCP/attributes/Phone'
114
+ },
115
+ attributeType: {
116
+ name: 'Phone',
117
+ uri: 'configuration/entityTypes/HCP/attributes/Phone',
118
+ type: 'String'
119
+ },
120
+ children: '8-800-555-35-35'
121
+ };
94
122
  var defaultPivotingAttributeContextValue = [
95
123
  {
96
- uri: 'configuration/entityTypes/HCP/attributes/Phone'
124
+ uri: 'configuration/entityTypes/HCP/attributes/Phone',
125
+ popup: { label: 'HCOs', entityType: 'configuration/entityTypes/HCO' }
97
126
  },
98
127
  {
99
128
  uri: 'configuration/entityTypes/HCP/attributes/Phone2',
@@ -103,183 +132,318 @@ var defaultPivotingAttributeContextValue = [
103
132
  uri: 'configuration/entityTypes/HCP/attributes/Phone3'
104
133
  }
105
134
  ];
106
- var setUp = function (props, pivotingAttributeContextValue) {
107
- if (pivotingAttributeContextValue === void 0) { pivotingAttributeContextValue = defaultPivotingAttributeContextValue; }
108
- return mount(React.createElement(MdmModuleProvider, { values: { metadata: metadata, uiPath: uiPath }, actions: { openPivotingPerspective: openPivotingPerspective } },
135
+ var setUp = function (_a) {
136
+ var _b = _a === void 0 ? {} : _a, _c = _b.props, props = _c === void 0 ? defaultProps : _c, _d = _b.mdmValues, mdmValues = _d === void 0 ? defaultMdmValues : _d, _e = _b.pivotingAttributeContextValue, pivotingAttributeContextValue = _e === void 0 ? defaultPivotingAttributeContextValue : _e;
137
+ var user = userEvent.setup();
138
+ render(React.createElement(MdmModuleProvider, { values: mdmValues, actions: mdmActions },
109
139
  React.createElement(PivotingAttributeContext.Provider, { value: pivotingAttributeContextValue },
110
140
  React.createElement(PivotingTooltip, __assign({}, props)))));
141
+ return { user: user };
111
142
  };
112
- describe('PivotingTooltip tests', function () {
113
- var values = {
114
- value: '8-800-555-35-35',
115
- ov: true,
116
- type: 'String',
117
- lookupCode: '8-800-555-35-35',
118
- lookupRawValue: '8-800-555-35-35'
119
- };
120
- it('should render Tooltip for simple attributes', function () {
121
- var value = __assign(__assign({}, values), { uri: 'configuration/entityTypes/HCP/attributes/Phone' });
122
- var attributeType = {
123
- name: 'Phone',
124
- uri: 'configuration/entityTypes/HCP/attributes/Phone',
125
- type: 'String'
143
+ describe('Pivoting tooltip test', function () {
144
+ beforeEach(function () {
145
+ var allEntities = [
146
+ { uri: 'entities/01Qi9Bv', type: 'configuration/entityTypes/HCP', label: 'hcp entity label 1' },
147
+ { uri: 'entities/ba7sAl2', type: 'configuration/entityTypes/HCP', label: 'hcp entity label 2' },
148
+ { uri: 'entities/Js28AmP', type: 'configuration/entityTypes/HCO', label: 'hco entity label 1' },
149
+ { uri: 'entities/NsmA10S', type: 'configuration/entityTypes/HCO', label: 'hco entity label 2' },
150
+ { uri: 'entities/Lk2Iq09', type: 'configuration/entityTypes/HCO', label: 'hco entity label 3' },
151
+ { uri: 'entities/jsAm291', type: 'configuration/entityTypes/HCO', label: 'hco entity label 4' },
152
+ { uri: 'entities/Nsb30A3', type: 'configuration/entityTypes/HCO', label: 'hco entity label 5' },
153
+ { uri: 'entities/Bsn13La', type: 'configuration/entityTypes/HCO', label: 'hco entity label 6' },
154
+ { uri: 'entities/JamdS14', type: 'configuration/entityTypes/HCO', label: 'hco entity label 7' }
155
+ ];
156
+ var getEntitites = function (_a) {
157
+ var values = _a.filters[0].values;
158
+ var entityType = values[0];
159
+ return allEntities.filter(function (_a) {
160
+ var type = _a.type;
161
+ return type === entityType;
162
+ });
126
163
  };
127
- var props = { value: value, attributeType: attributeType, children: '8-800-555-35-35' };
128
- var component = setUp(props);
129
- var tooltip = component.find(Tooltip);
130
- expect(tooltip.length).toBe(1);
131
- var title = tooltip.prop('title');
132
- expect(title.props.attributeType).toEqual(attributeType);
133
- expect(tooltip.prop('disableInteractive')).toBe(false);
164
+ getFilteredEntities.mockImplementation(getEntitites);
165
+ getTotals.mockImplementation(function (params) { return ({ total: getEntitites(params).length }); });
134
166
  });
135
- it('should not render Tooltip for simple attributes', function () {
136
- var value = __assign(__assign({}, values), { uri: 'configuration/entityTypes/HCP/attributes/Phone123' });
137
- var attributeType = {
138
- name: 'Phone',
139
- uri: 'configuration/entityTypes/HCP/attributes/Phone123',
140
- type: 'String'
141
- };
142
- var props = { value: value, attributeType: attributeType, children: '8-800-555-35-35' };
143
- var component = setUp(props);
144
- expect(component.find(Tooltip).length).toBe(0);
167
+ afterEach(function () {
168
+ jest.clearAllMocks();
145
169
  });
146
- it('should render Tooltip for nested attributes', function () {
147
- var value = {
148
- uri: 'configuration/entityTypes/HCP/attributes/Phone2',
149
- ov: true,
150
- value: {
151
- Phone3: [
152
- __assign(__assign({}, values), { uri: 'configuration/entityTypes/HCP/attributes/Phone2/attributes/Phone3' })
153
- ]
170
+ it('should render tooltip for simple attributes correctly', function () { return __awaiter(void 0, void 0, void 0, function () {
171
+ var user, tooltip, popper, params;
172
+ return __generator(this, function (_a) {
173
+ switch (_a.label) {
174
+ case 0:
175
+ user = setUp().user;
176
+ return [4 /*yield*/, screen.findByText('8-800-555-35-35')];
177
+ case 1:
178
+ tooltip = _a.sent();
179
+ expect(getTotals).toHaveBeenCalledTimes(0);
180
+ expect(getFilteredEntities).toHaveBeenCalledTimes(0);
181
+ return [4 /*yield*/, user.hover(tooltip)];
182
+ case 2:
183
+ _a.sent();
184
+ popper = screen.getByRole('tooltip');
185
+ within(popper).getByText('Pivot profiles');
186
+ within(popper).getByText('7 items');
187
+ within(popper).getByText('HCOs');
188
+ within(popper).getByText('hco entity label 1');
189
+ within(popper).getByText('hco entity label 2');
190
+ within(popper).getByText('hco entity label 3');
191
+ within(popper).getByText('hco entity label 4');
192
+ within(popper).getByText('hco entity label 5');
193
+ within(popper).getByText('hco entity label 6');
194
+ within(popper).getByText('hco entity label 7');
195
+ within(popper).getByText('See all');
196
+ params = {
197
+ filters: [
198
+ { fieldName: 'type', filter: 'equals', values: ['configuration/entityTypes/HCO'] },
199
+ { fieldName: 'attributes.Phone', filter: 'equals', values: ['8-800-555-35-35'] }
200
+ ],
201
+ options: { globalFilter: defaultMdmValues.globalFilter.query, max: 6, searchOptions: '', sort: 'label' }
202
+ };
203
+ expect(getFilteredEntities).toHaveBeenCalledWith(params);
204
+ expect(getTotals).toHaveBeenCalledWith(params);
205
+ return [2 /*return*/];
154
206
  }
155
- };
156
- var props = { value: value, attributeType: attributes[0], children: '8-800-555-35-35' };
157
- var component = setUp(props);
158
- var tooltip = component.find(Tooltip);
159
- expect(tooltip.length).toBe(1);
160
- var title = tooltip.prop('title');
161
- expect(title.props.attributeType).toEqual(attributes[0]);
162
- });
163
- it('should not render Tooltip for nested attributes', function () {
164
- var value = {
165
- uri: 'configuration/entityTypes/HCP/attributes/Phone2555',
166
- ov: true,
167
- value: {
168
- Phone3: [
169
- __assign(__assign({}, values), { uri: 'configuration/entityTypes/HCP/attributes/Phone2/attributes/Phone3' })
170
- ]
207
+ });
208
+ }); });
209
+ it('should not render tooltip for simple attributes if it is not pivoting attribute', function () { return __awaiter(void 0, void 0, void 0, function () {
210
+ var value, attributeType, props, user, _a, _b;
211
+ return __generator(this, function (_c) {
212
+ switch (_c.label) {
213
+ case 0:
214
+ value = __assign(__assign({}, defaultProps.value), { uri: 'configuration/entityTypes/HCP/attributes/Phone123' });
215
+ attributeType = __assign(__assign({}, defaultProps.attributeType), { uri: 'configuration/entityTypes/HCP/attributes/Phone123', name: 'Phone123' });
216
+ props = __assign(__assign({}, defaultProps), { value: value, attributeType: attributeType });
217
+ user = setUp({ props: props }).user;
218
+ _b = (_a = user).hover;
219
+ return [4 /*yield*/, screen.findByText('8-800-555-35-35')];
220
+ case 1: return [4 /*yield*/, _b.apply(_a, [_c.sent()])];
221
+ case 2:
222
+ _c.sent();
223
+ expect(screen.queryByRole('tooltip')).not.toBeInTheDocument();
224
+ return [2 /*return*/];
171
225
  }
172
- };
173
- var attributeType = {
174
- name: 'Phone2',
175
- uri: 'configuration/entityTypes/HCP/attributes/Phone2555',
176
- type: 'Nested',
177
- attributes: [
178
- {
179
- uri: 'configuration/entityTypes/HCP/attributes/Phone2/attributes/Phone3',
180
- name: 'Phone3',
181
- type: 'String'
182
- }
183
- ]
184
- };
185
- var props = { value: value, attributeType: attributeType, children: '8-800-555-35-35' };
186
- var component = setUp(props);
187
- expect(component.find(Tooltip).length).toBe(0);
188
- });
189
- it('should render Tooltip for nested attributes if children do not exist in config of pivoting', function () {
190
- var value = {
191
- uri: 'configuration/entityTypes/HCP/attributes/Phone3',
192
- ov: true,
193
- value: {
194
- Phone4: [
195
- __assign(__assign({}, values), { uri: 'configuration/entityTypes/HCP/attributes/Phone3/attributes/Phone4' })
196
- ]
226
+ });
227
+ }); });
228
+ it('should render tooltip for nested attributes correctly', function () { return __awaiter(void 0, void 0, void 0, function () {
229
+ var value, props, user, tooltip, popper, params;
230
+ return __generator(this, function (_a) {
231
+ switch (_a.label) {
232
+ case 0:
233
+ value = {
234
+ uri: 'configuration/entityTypes/HCP/attributes/Phone2',
235
+ ov: true,
236
+ value: {
237
+ Phone3: [
238
+ {
239
+ value: '8-800-555-35-35',
240
+ ov: true,
241
+ type: 'String',
242
+ lookupCode: '8-800-555-35-35',
243
+ lookupRawValue: '8-800-555-35-35',
244
+ uri: 'configuration/entityTypes/HCP/attributes/Phone2/attributes/Phone3'
245
+ }
246
+ ]
247
+ }
248
+ };
249
+ props = __assign(__assign({}, defaultProps), { value: value, attributeType: attributes[0] });
250
+ user = setUp({ props: props }).user;
251
+ return [4 /*yield*/, screen.findByText('8-800-555-35-35')];
252
+ case 1:
253
+ tooltip = _a.sent();
254
+ expect(getTotals).toHaveBeenCalledTimes(0);
255
+ expect(getFilteredEntities).toHaveBeenCalledTimes(0);
256
+ return [4 /*yield*/, user.hover(tooltip)];
257
+ case 2:
258
+ _a.sent();
259
+ popper = screen.getByRole('tooltip');
260
+ within(popper).getByText('Pivot profiles');
261
+ within(popper).getByText('2 items');
262
+ within(popper).getByText('hcp entity label 1');
263
+ within(popper).getByText('hcp entity label 2');
264
+ expect(within(popper).queryByText('See all')).not.toBeInTheDocument();
265
+ params = {
266
+ filters: [
267
+ { fieldName: 'type', filter: 'equals', values: ['configuration/entityTypes/HCP'] },
268
+ { fieldName: 'attributes.Phone2.Phone3', filter: 'equals', values: ['8-800-555-35-35'] }
269
+ ],
270
+ options: { globalFilter: defaultMdmValues.globalFilter.query, max: 6, searchOptions: '', sort: 'label' }
271
+ };
272
+ expect(getFilteredEntities).toHaveBeenCalledWith(params);
273
+ expect(getTotals).toHaveBeenCalledWith(params);
274
+ return [2 /*return*/];
197
275
  }
198
- };
199
- var props = { value: value, attributeType: attributes[1], children: '8-800-555-35-35' };
200
- var component = setUp(props);
201
- var tooltip = component.find(Tooltip);
202
- expect(tooltip.length).toBe(1);
203
- var title = tooltip.prop('title');
204
- expect(title.props.attributeType).toEqual(attributes[1]);
205
- });
206
- it('should render PivotingTooltipContent with correct config', function () {
207
- var _a;
208
- var value = {
209
- uri: 'configuration/entityTypes/HCP/attributes/Phone2',
210
- ov: true,
211
- value: {
212
- Phone3: [
213
- __assign(__assign({}, values), { uri: 'configuration/entityTypes/HCP/attributes/Phone2/attributes/Phone3' })
214
- ]
276
+ });
277
+ }); });
278
+ it('should not render tooltip for nested attributes if it is not pivoting attribute', function () { return __awaiter(void 0, void 0, void 0, function () {
279
+ var value, attributeType, props, user, _a, _b;
280
+ return __generator(this, function (_c) {
281
+ switch (_c.label) {
282
+ case 0:
283
+ value = {
284
+ uri: 'configuration/entityTypes/HCP/attributes/Phone4',
285
+ ov: true,
286
+ value: {
287
+ Phone3: [
288
+ {
289
+ value: '8-800-555-35-35',
290
+ ov: true,
291
+ type: 'String',
292
+ lookupCode: '8-800-555-35-35',
293
+ lookupRawValue: '8-800-555-35-35',
294
+ uri: 'configuration/entityTypes/HCP/attributes/Phone2/attributes/Phone3'
295
+ }
296
+ ]
297
+ }
298
+ };
299
+ attributeType = __assign(__assign({}, attributes[0]), { name: 'Phone4', uri: 'configuration/entityTypes/HCP/attributes/Phone4' });
300
+ props = __assign(__assign({}, defaultProps), { value: value, attributeType: attributeType });
301
+ user = setUp({ props: props }).user;
302
+ _b = (_a = user).hover;
303
+ return [4 /*yield*/, screen.findByText('8-800-555-35-35')];
304
+ case 1: return [4 /*yield*/, _b.apply(_a, [_c.sent()])];
305
+ case 2:
306
+ _c.sent();
307
+ expect(screen.queryByRole('tooltip')).not.toBeInTheDocument();
308
+ return [2 /*return*/];
215
309
  }
216
- };
217
- var pivotingAttributeContextValue = [
218
- __assign(__assign({}, defaultPivotingAttributeContextValue[1]), { popup: {
219
- label: 'HCOs',
220
- entityType: 'HCO'
221
- } })
222
- ];
223
- var props = { value: value, attributeType: attributes[0], children: '8-800-555-35-35' };
224
- var component = setUp(props, pivotingAttributeContextValue);
225
- var title = component.find(Tooltip).prop('title');
226
- expect(title.props.label).toEqual((_a = pivotingAttributeContextValue[0].popup) === null || _a === void 0 ? void 0 : _a.label);
227
- });
228
- it('should not fail if pivotingAttributesList is null', function () {
229
- var value = __assign(__assign({}, values), { uri: 'configuration/entityTypes/HCP/attributes/Phone' });
230
- var attributeType = {
231
- name: 'Phone',
232
- uri: 'configuration/entityTypes/HCP/attributes/Phone',
233
- type: 'String'
234
- };
235
- var props = { value: value, attributeType: attributeType, children: '8-800-555-35-35' };
236
- var component = setUp(props, null);
237
- var tooltip = component.find(Tooltip);
238
- expect(tooltip.length).toBe(0);
239
- });
240
- it('should open pivoting perspective on click for simple attribute', function () { return __awaiter(void 0, void 0, void 0, function () {
241
- var value, attributeType, props, component;
242
- return __generator(this, function (_a) {
243
- value = __assign(__assign({}, values), { uri: 'configuration/entityTypes/HCP/attributes/Phone' });
244
- attributeType = {
245
- name: 'Phone',
246
- uri: 'configuration/entityTypes/HCP/attributes/Phone',
247
- type: 'String'
248
- };
249
- props = { value: value, attributeType: attributeType, children: '8-800-555-35-35' };
250
- component = setUp(props);
251
- act(function () {
252
- component.find(PivotingUriLink).prop('onClick')();
253
- });
254
- expect(openPivotingPerspective).toHaveBeenCalledWith({ value: [{ Phone: '8-800-555-35-35' }], attributeType: attributeType });
255
- return [2 /*return*/];
256
310
  });
257
311
  }); });
258
- it('should open pivoting perspective on click for nested attribute', function () { return __awaiter(void 0, void 0, void 0, function () {
259
- var value, props, component, generatedValue;
312
+ it('should render tooltip for nested attributes if children do not exist in config of pivoting', function () { return __awaiter(void 0, void 0, void 0, function () {
313
+ var value, props, user, _a, _b, popper, params;
314
+ return __generator(this, function (_c) {
315
+ switch (_c.label) {
316
+ case 0:
317
+ value = {
318
+ uri: 'configuration/entityTypes/HCP/attributes/Phone3',
319
+ ov: true,
320
+ value: {
321
+ Phone4: [
322
+ {
323
+ value: '8-800-555-35-35',
324
+ ov: true,
325
+ type: 'String',
326
+ lookupCode: '8-800-555-35-35',
327
+ lookupRawValue: '8-800-555-35-35',
328
+ uri: 'configuration/entityTypes/HCP/attributes/Phone3/attributes/Phone4'
329
+ }
330
+ ]
331
+ }
332
+ };
333
+ props = __assign(__assign({}, defaultProps), { value: value, attributeType: attributes[1] });
334
+ user = setUp({ props: props }).user;
335
+ _b = (_a = user).hover;
336
+ return [4 /*yield*/, screen.findByText('8-800-555-35-35')];
337
+ case 1: return [4 /*yield*/, _b.apply(_a, [_c.sent()])];
338
+ case 2:
339
+ _c.sent();
340
+ popper = screen.getByRole('tooltip');
341
+ within(popper).getByText('Pivot profiles');
342
+ within(popper).getByText('2 items');
343
+ within(popper).getByText('hcp entity label 1');
344
+ within(popper).getByText('hcp entity label 2');
345
+ expect(within(popper).queryByText('See all')).not.toBeInTheDocument();
346
+ params = {
347
+ filters: [
348
+ { fieldName: 'type', filter: 'equals', values: ['configuration/entityTypes/HCP'] },
349
+ { fieldName: 'attributes.Phone3.Phone4', filter: 'equals', values: ['8-800-555-35-35'] }
350
+ ],
351
+ options: { globalFilter: defaultMdmValues.globalFilter.query, max: 6, searchOptions: '', sort: 'label' }
352
+ };
353
+ expect(getFilteredEntities).toHaveBeenCalledWith(params);
354
+ expect(getTotals).toHaveBeenCalledWith(params);
355
+ return [2 /*return*/];
356
+ }
357
+ });
358
+ }); });
359
+ it('should not fail if pivoting attributes list is null', function () { return __awaiter(void 0, void 0, void 0, function () {
260
360
  return __generator(this, function (_a) {
261
- value = {
262
- uri: 'configuration/entityTypes/HCP/attributes/Phone2',
263
- ov: true,
264
- value: {
265
- Phone3: [
266
- __assign(__assign({}, values), { uri: 'configuration/entityTypes/HCP/attributes/Phone2/attributes/Phone3' })
267
- ]
268
- }
269
- };
270
- props = { value: value, attributeType: attributes[0], children: '8-800-555-35-35' };
271
- component = setUp(props);
272
- act(function () {
273
- component.find(PivotingUriLink).prop('onClick')();
274
- });
275
- generatedValue = [{ Phone3: ['8-800-555-35-35'] }];
276
- expect(openPivotingPerspective).toHaveBeenCalledWith({
277
- value: generatedValue,
278
- attributeType: attributes[0]
279
- });
280
- expect(component.find(PivotingUriLink).prop('value')).toEqual(generatedValue);
281
- expect(component.find(PivotingUriLink).prop('attributeType')).toEqual(attributes[0]);
282
- return [2 /*return*/];
361
+ switch (_a.label) {
362
+ case 0:
363
+ setUp({ pivotingAttributeContextValue: null });
364
+ return [4 /*yield*/, screen.findByText('8-800-555-35-35')];
365
+ case 1:
366
+ _a.sent();
367
+ return [2 /*return*/];
368
+ }
369
+ });
370
+ }); });
371
+ it('should open pivoting perspective on simple attribute click correctly', function () { return __awaiter(void 0, void 0, void 0, function () {
372
+ var user, _a, _b;
373
+ return __generator(this, function (_c) {
374
+ switch (_c.label) {
375
+ case 0:
376
+ user = setUp().user;
377
+ _b = (_a = user).click;
378
+ return [4 /*yield*/, screen.findByText('8-800-555-35-35')];
379
+ case 1: return [4 /*yield*/, _b.apply(_a, [_c.sent()])];
380
+ case 2:
381
+ _c.sent();
382
+ expect(mdmActions.openPivotingPerspective).toHaveBeenCalledWith({
383
+ attributeType: defaultProps.attributeType,
384
+ value: [{ Phone: '8-800-555-35-35' }]
385
+ });
386
+ return [2 /*return*/];
387
+ }
388
+ });
389
+ }); });
390
+ it('should open pivoting perspective on nested attribute click correctly', function () { return __awaiter(void 0, void 0, void 0, function () {
391
+ var value, attributeType, props, user, _a, _b;
392
+ return __generator(this, function (_c) {
393
+ switch (_c.label) {
394
+ case 0:
395
+ value = {
396
+ uri: 'configuration/entityTypes/HCP/attributes/Phone2',
397
+ ov: true,
398
+ value: {
399
+ Phone3: [
400
+ {
401
+ value: '8-800-555-35-35',
402
+ ov: true,
403
+ type: 'String',
404
+ lookupCode: '8-800-555-35-35',
405
+ lookupRawValue: '8-800-555-35-35',
406
+ uri: 'configuration/entityTypes/HCP/attributes/Phone2/attributes/Phone3'
407
+ }
408
+ ]
409
+ }
410
+ };
411
+ attributeType = attributes[0];
412
+ props = __assign(__assign({}, defaultProps), { value: value, attributeType: attributeType });
413
+ user = setUp({ props: props }).user;
414
+ _b = (_a = user).click;
415
+ return [4 /*yield*/, screen.findByText('8-800-555-35-35')];
416
+ case 1: return [4 /*yield*/, _b.apply(_a, [_c.sent()])];
417
+ case 2:
418
+ _c.sent();
419
+ expect(mdmActions.openPivotingPerspective).toHaveBeenCalledWith({
420
+ attributeType: attributeType,
421
+ value: [{ Phone3: ['8-800-555-35-35'] }]
422
+ });
423
+ return [2 /*return*/];
424
+ }
425
+ });
426
+ }); });
427
+ it('should open pivoting perspective on see all button click correctly', function () { return __awaiter(void 0, void 0, void 0, function () {
428
+ var user, _a, _b;
429
+ return __generator(this, function (_c) {
430
+ switch (_c.label) {
431
+ case 0:
432
+ user = setUp().user;
433
+ _b = (_a = user).hover;
434
+ return [4 /*yield*/, screen.findByText('8-800-555-35-35')];
435
+ case 1: return [4 /*yield*/, _b.apply(_a, [_c.sent()])];
436
+ case 2:
437
+ _c.sent();
438
+ return [4 /*yield*/, user.click(screen.getByText('See all'))];
439
+ case 3:
440
+ _c.sent();
441
+ expect(mdmActions.openPivotingPerspective).toHaveBeenCalledWith({
442
+ attributeType: defaultProps.attributeType,
443
+ value: [{ Phone: '8-800-555-35-35' }]
444
+ });
445
+ return [2 /*return*/];
446
+ }
283
447
  });
284
448
  }); });
285
449
  });