@reltio/components 1.4.1998 → 1.4.2000

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 (178) hide show
  1. package/cjs/UpSetChart/UpSetChart.d.ts +5 -8
  2. package/cjs/UpSetChart/UpSetChart.js +61 -5
  3. package/cjs/UpSetChart/UpSetChart.test.js +198 -0
  4. package/cjs/UpSetChart/components/IntersectionsChart/IntersectionsChart.d.ts +15 -0
  5. package/cjs/UpSetChart/components/IntersectionsChart/IntersectionsChart.js +66 -0
  6. package/cjs/UpSetChart/components/IntersectionsChart/index.d.ts +1 -0
  7. package/cjs/UpSetChart/components/IntersectionsChart/index.js +5 -0
  8. package/cjs/UpSetChart/components/IntersectionsChart/styles.d.ts +1 -0
  9. package/cjs/UpSetChart/components/IntersectionsChart/styles.js +32 -0
  10. package/cjs/UpSetChart/components/IntersectionsChartAxis/IntersectionsChartAxis.d.ts +10 -0
  11. package/cjs/UpSetChart/components/IntersectionsChartAxis/IntersectionsChartAxis.js +64 -0
  12. package/cjs/UpSetChart/components/IntersectionsChartAxis/index.d.ts +1 -0
  13. package/cjs/UpSetChart/components/IntersectionsChartAxis/index.js +5 -0
  14. package/cjs/UpSetChart/components/IntersectionsChartAxis/styles.d.ts +1 -0
  15. package/cjs/UpSetChart/components/IntersectionsChartAxis/styles.js +32 -0
  16. package/cjs/UpSetChart/components/IntersectionsMatrix/IntersectionsMatrix.d.ts +13 -0
  17. package/cjs/UpSetChart/components/IntersectionsMatrix/IntersectionsMatrix.js +56 -0
  18. package/cjs/UpSetChart/components/IntersectionsMatrix/index.d.ts +1 -0
  19. package/cjs/UpSetChart/components/IntersectionsMatrix/index.js +5 -0
  20. package/cjs/UpSetChart/components/IntersectionsMatrix/styles.d.ts +1 -0
  21. package/cjs/UpSetChart/components/IntersectionsMatrix/styles.js +27 -0
  22. package/cjs/UpSetChart/components/SetsChart/SetsChart.d.ts +15 -0
  23. package/cjs/UpSetChart/components/SetsChart/SetsChart.js +58 -0
  24. package/cjs/UpSetChart/components/SetsChart/index.d.ts +1 -0
  25. package/cjs/UpSetChart/components/SetsChart/index.js +5 -0
  26. package/cjs/UpSetChart/components/SetsChart/styles.d.ts +1 -0
  27. package/cjs/UpSetChart/components/SetsChart/styles.js +43 -0
  28. package/cjs/UpSetChart/components/SetsChartAxis/SetsChartAxis.d.ts +6 -0
  29. package/cjs/UpSetChart/components/SetsChartAxis/SetsChartAxis.js +20 -0
  30. package/cjs/UpSetChart/components/SetsChartAxis/index.d.ts +1 -0
  31. package/cjs/UpSetChart/components/SetsChartAxis/index.js +5 -0
  32. package/cjs/UpSetChart/components/SetsChartAxis/styles.d.ts +1 -0
  33. package/cjs/UpSetChart/components/SetsChartAxis/styles.js +17 -0
  34. package/cjs/UpSetChart/constants.d.ts +16 -3
  35. package/cjs/UpSetChart/constants.js +20 -4
  36. package/cjs/UpSetChart/gameOfThrones.test-data.d.ts +4 -0
  37. package/cjs/UpSetChart/gameOfThrones.test-data.js +26 -0
  38. package/cjs/UpSetChart/helpers.d.ts +20 -0
  39. package/cjs/UpSetChart/helpers.js +127 -0
  40. package/cjs/UpSetChart/styles.d.ts +4 -1
  41. package/cjs/UpSetChart/styles.js +11 -12
  42. package/cjs/UpSetChart/types.d.ts +16 -0
  43. package/cjs/UpSetChart/types.js +2 -0
  44. package/cjs/UpSetChart/useUpSetChartSizes.d.ts +20 -0
  45. package/cjs/UpSetChart/useUpSetChartSizes.js +34 -0
  46. package/cjs/features/crosswalks/AttributesTable/AttributesTable.test-data.d.ts +36 -0
  47. package/cjs/features/crosswalks/AttributesTable/AttributesTable.test-data.js +288 -0
  48. package/cjs/features/crosswalks/AttributesTable/AttributesTable.test.js +708 -370
  49. package/cjs/features/crosswalks/ColoredBlock/ColoredBlock.test.js +77 -15
  50. package/cjs/features/crosswalks/CopyableValueField/CopyableValueField.test.js +85 -15
  51. package/cjs/features/crosswalks/CrosswalkAttributes/CrosswalkAttributes.test.js +265 -193
  52. package/cjs/features/crosswalks/CrosswalkDateEditor/CrosswalkDateEditor.test.js +106 -12
  53. package/cjs/features/crosswalks/CrosswalkDragLayer/CrosswalkDragLayer.test.js +21 -9
  54. package/cjs/features/crosswalks/CrosswalkEditor/CrosswalkEditor.test.js +190 -90
  55. package/cjs/features/crosswalks/CrosswalkRow/CrosswalkRow.test.js +323 -225
  56. package/cjs/features/crosswalks/ShowDependentLink/ShowDependentLink.test.js +75 -12
  57. package/cjs/features/crosswalks/SourceCrosswalksRow/SourceCrosswalksRow.test.js +171 -138
  58. package/esm/UpSetChart/UpSetChart.d.ts +5 -8
  59. package/esm/UpSetChart/UpSetChart.js +38 -5
  60. package/esm/UpSetChart/UpSetChart.test.js +193 -0
  61. package/esm/UpSetChart/components/IntersectionsChart/IntersectionsChart.d.ts +15 -0
  62. package/esm/UpSetChart/components/IntersectionsChart/IntersectionsChart.js +39 -0
  63. package/esm/UpSetChart/components/IntersectionsChart/index.d.ts +1 -0
  64. package/esm/UpSetChart/components/IntersectionsChart/index.js +1 -0
  65. package/esm/UpSetChart/components/IntersectionsChart/styles.d.ts +1 -0
  66. package/esm/UpSetChart/components/IntersectionsChart/styles.js +29 -0
  67. package/esm/UpSetChart/components/IntersectionsChartAxis/IntersectionsChartAxis.d.ts +10 -0
  68. package/esm/UpSetChart/components/IntersectionsChartAxis/IntersectionsChartAxis.js +34 -0
  69. package/esm/UpSetChart/components/IntersectionsChartAxis/index.d.ts +1 -0
  70. package/esm/UpSetChart/components/IntersectionsChartAxis/index.js +1 -0
  71. package/esm/UpSetChart/components/IntersectionsChartAxis/styles.d.ts +1 -0
  72. package/esm/UpSetChart/components/IntersectionsChartAxis/styles.js +29 -0
  73. package/esm/UpSetChart/components/IntersectionsMatrix/IntersectionsMatrix.d.ts +13 -0
  74. package/esm/UpSetChart/components/IntersectionsMatrix/IntersectionsMatrix.js +26 -0
  75. package/esm/UpSetChart/components/IntersectionsMatrix/index.d.ts +1 -0
  76. package/esm/UpSetChart/components/IntersectionsMatrix/index.js +1 -0
  77. package/esm/UpSetChart/components/IntersectionsMatrix/styles.d.ts +1 -0
  78. package/esm/UpSetChart/components/IntersectionsMatrix/styles.js +24 -0
  79. package/esm/UpSetChart/components/SetsChart/SetsChart.d.ts +15 -0
  80. package/esm/UpSetChart/components/SetsChart/SetsChart.js +31 -0
  81. package/esm/UpSetChart/components/SetsChart/index.d.ts +1 -0
  82. package/esm/UpSetChart/components/SetsChart/index.js +1 -0
  83. package/esm/UpSetChart/components/SetsChart/styles.d.ts +1 -0
  84. package/esm/UpSetChart/components/SetsChart/styles.js +40 -0
  85. package/esm/UpSetChart/components/SetsChartAxis/SetsChartAxis.d.ts +6 -0
  86. package/esm/UpSetChart/components/SetsChartAxis/SetsChartAxis.js +13 -0
  87. package/esm/UpSetChart/components/SetsChartAxis/index.d.ts +1 -0
  88. package/esm/UpSetChart/components/SetsChartAxis/index.js +1 -0
  89. package/esm/UpSetChart/components/SetsChartAxis/styles.d.ts +1 -0
  90. package/esm/UpSetChart/components/SetsChartAxis/styles.js +14 -0
  91. package/esm/UpSetChart/constants.d.ts +16 -3
  92. package/esm/UpSetChart/constants.js +19 -3
  93. package/esm/UpSetChart/gameOfThrones.test-data.d.ts +4 -0
  94. package/esm/UpSetChart/gameOfThrones.test-data.js +23 -0
  95. package/esm/UpSetChart/helpers.d.ts +20 -0
  96. package/esm/UpSetChart/helpers.js +120 -0
  97. package/esm/UpSetChart/styles.d.ts +4 -1
  98. package/esm/UpSetChart/styles.js +11 -12
  99. package/esm/UpSetChart/types.d.ts +16 -0
  100. package/esm/UpSetChart/useUpSetChartSizes.d.ts +20 -0
  101. package/esm/UpSetChart/useUpSetChartSizes.js +30 -0
  102. package/esm/features/crosswalks/AttributesTable/AttributesTable.test-data.d.ts +36 -0
  103. package/esm/features/crosswalks/AttributesTable/AttributesTable.test-data.js +283 -0
  104. package/esm/features/crosswalks/AttributesTable/AttributesTable.test.js +711 -350
  105. package/esm/features/crosswalks/ColoredBlock/ColoredBlock.test.js +77 -15
  106. package/esm/features/crosswalks/CopyableValueField/CopyableValueField.test.js +85 -15
  107. package/esm/features/crosswalks/CrosswalkAttributes/CrosswalkAttributes.test.js +266 -194
  108. package/esm/features/crosswalks/CrosswalkDateEditor/CrosswalkDateEditor.test.js +106 -12
  109. package/esm/features/crosswalks/CrosswalkDragLayer/CrosswalkDragLayer.test.js +21 -9
  110. package/esm/features/crosswalks/CrosswalkEditor/CrosswalkEditor.test.js +190 -90
  111. package/esm/features/crosswalks/CrosswalkRow/CrosswalkRow.test.js +324 -226
  112. package/esm/features/crosswalks/ShowDependentLink/ShowDependentLink.test.js +75 -12
  113. package/esm/features/crosswalks/SourceCrosswalksRow/SourceCrosswalksRow.test.js +171 -138
  114. package/package.json +1 -1
  115. package/cjs/features/crosswalks/AttributesTable/IntegrationAttributesTable.test-data.d.ts +0 -3
  116. package/cjs/features/crosswalks/AttributesTable/IntegrationAttributesTable.test-data.js +0 -52
  117. package/cjs/features/crosswalks/AttributesTable/IntegrationAttributesTable.test.js +0 -323
  118. package/cjs/features/crosswalks/AttributesTable/components/AddAttributesButton/AddAttributesButton.test.js +0 -142
  119. package/cjs/features/crosswalks/AttributesTable/components/AttributeValuesRenderer/AttributeValuesRenderer.test.js +0 -146
  120. package/cjs/features/crosswalks/AttributesTable/components/AttributesHeadCellRenderer/AttributesHeadCellRenderer.test.d.ts +0 -1
  121. package/cjs/features/crosswalks/AttributesTable/components/AttributesHeadCellRenderer/AttributesHeadCellRenderer.test.js +0 -50
  122. package/cjs/features/crosswalks/AttributesTable/components/ConfirmEditIgnoredDialog/ConfirmEditIgnoredDialog.test.d.ts +0 -1
  123. package/cjs/features/crosswalks/AttributesTable/components/ConfirmEditIgnoredDialog/ConfirmEditIgnoredDialog.test.js +0 -58
  124. package/cjs/features/crosswalks/AttributesTable/components/CountRenderer/CountRenderer.test.d.ts +0 -1
  125. package/cjs/features/crosswalks/AttributesTable/components/CountRenderer/CountRenderer.test.js +0 -14
  126. package/cjs/features/crosswalks/AttributesTable/components/ImageAttributesRenderer/ImageAttributesRenderer.test.d.ts +0 -1
  127. package/cjs/features/crosswalks/AttributesTable/components/ImageAttributesRenderer/ImageAttributesRenderer.test.js +0 -110
  128. package/cjs/features/crosswalks/AttributesTable/components/NestedAttributesRenderer/NestedAttributesRenderer.test.d.ts +0 -1
  129. package/cjs/features/crosswalks/AttributesTable/components/NestedAttributesRenderer/NestedAttributesRenderer.test.js +0 -111
  130. package/cjs/features/crosswalks/AttributesTable/components/OvValuesRenderer/OvValuesRenderer.test.d.ts +0 -1
  131. package/cjs/features/crosswalks/AttributesTable/components/OvValuesRenderer/OvValuesRenderer.test.js +0 -67
  132. package/cjs/features/crosswalks/AttributesTable/components/ReferenceAttributesRenderer/ReferenceAttributesRenderer.test.d.ts +0 -1
  133. package/cjs/features/crosswalks/AttributesTable/components/ReferenceAttributesRenderer/ReferenceAttributesRenderer.test.js +0 -193
  134. package/cjs/features/crosswalks/AttributesTable/components/RuleTypeInfoButton/RuleTypeInfoButton.test.d.ts +0 -1
  135. package/cjs/features/crosswalks/AttributesTable/components/RuleTypeInfoButton/RuleTypeInfoButton.test.js +0 -22
  136. package/cjs/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.test.d.ts +0 -1
  137. package/cjs/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.test.js +0 -58
  138. package/cjs/features/crosswalks/AttributesTable/components/SimpleAttributesRenderer/SimpleAttributesRenderer.test.d.ts +0 -1
  139. package/cjs/features/crosswalks/AttributesTable/components/SimpleAttributesRenderer/SimpleAttributesRenderer.test.js +0 -69
  140. package/cjs/features/crosswalks/CrosswalkDateEditor/IntegrationCrosswalkDateEditor.test.d.ts +0 -1
  141. package/cjs/features/crosswalks/CrosswalkDateEditor/IntegrationCrosswalkDateEditor.test.js +0 -137
  142. package/cjs/features/crosswalks/CrosswalkDragLayer/components/CrosswalkDragPreview/CrosswalkDragPreview.test.d.ts +0 -1
  143. package/cjs/features/crosswalks/CrosswalkDragLayer/components/CrosswalkDragPreview/CrosswalkDragPreview.test.js +0 -56
  144. package/esm/features/crosswalks/AttributesTable/IntegrationAttributesTable.test-data.d.ts +0 -3
  145. package/esm/features/crosswalks/AttributesTable/IntegrationAttributesTable.test-data.js +0 -47
  146. package/esm/features/crosswalks/AttributesTable/IntegrationAttributesTable.test.d.ts +0 -1
  147. package/esm/features/crosswalks/AttributesTable/IntegrationAttributesTable.test.js +0 -318
  148. package/esm/features/crosswalks/AttributesTable/components/AddAttributesButton/AddAttributesButton.test.d.ts +0 -1
  149. package/esm/features/crosswalks/AttributesTable/components/AddAttributesButton/AddAttributesButton.test.js +0 -137
  150. package/esm/features/crosswalks/AttributesTable/components/AttributeValuesRenderer/AttributeValuesRenderer.test.d.ts +0 -1
  151. package/esm/features/crosswalks/AttributesTable/components/AttributeValuesRenderer/AttributeValuesRenderer.test.js +0 -141
  152. package/esm/features/crosswalks/AttributesTable/components/AttributesHeadCellRenderer/AttributesHeadCellRenderer.test.d.ts +0 -1
  153. package/esm/features/crosswalks/AttributesTable/components/AttributesHeadCellRenderer/AttributesHeadCellRenderer.test.js +0 -45
  154. package/esm/features/crosswalks/AttributesTable/components/ConfirmEditIgnoredDialog/ConfirmEditIgnoredDialog.test.d.ts +0 -1
  155. package/esm/features/crosswalks/AttributesTable/components/ConfirmEditIgnoredDialog/ConfirmEditIgnoredDialog.test.js +0 -53
  156. package/esm/features/crosswalks/AttributesTable/components/CountRenderer/CountRenderer.test.d.ts +0 -1
  157. package/esm/features/crosswalks/AttributesTable/components/CountRenderer/CountRenderer.test.js +0 -9
  158. package/esm/features/crosswalks/AttributesTable/components/ImageAttributesRenderer/ImageAttributesRenderer.test.d.ts +0 -1
  159. package/esm/features/crosswalks/AttributesTable/components/ImageAttributesRenderer/ImageAttributesRenderer.test.js +0 -105
  160. package/esm/features/crosswalks/AttributesTable/components/NestedAttributesRenderer/NestedAttributesRenderer.test.d.ts +0 -1
  161. package/esm/features/crosswalks/AttributesTable/components/NestedAttributesRenderer/NestedAttributesRenderer.test.js +0 -106
  162. package/esm/features/crosswalks/AttributesTable/components/OvValuesRenderer/OvValuesRenderer.test.d.ts +0 -1
  163. package/esm/features/crosswalks/AttributesTable/components/OvValuesRenderer/OvValuesRenderer.test.js +0 -62
  164. package/esm/features/crosswalks/AttributesTable/components/ReferenceAttributesRenderer/ReferenceAttributesRenderer.test.d.ts +0 -1
  165. package/esm/features/crosswalks/AttributesTable/components/ReferenceAttributesRenderer/ReferenceAttributesRenderer.test.js +0 -188
  166. package/esm/features/crosswalks/AttributesTable/components/RuleTypeInfoButton/RuleTypeInfoButton.test.d.ts +0 -1
  167. package/esm/features/crosswalks/AttributesTable/components/RuleTypeInfoButton/RuleTypeInfoButton.test.js +0 -17
  168. package/esm/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.test.d.ts +0 -1
  169. package/esm/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.test.js +0 -53
  170. package/esm/features/crosswalks/AttributesTable/components/SimpleAttributesRenderer/SimpleAttributesRenderer.test.d.ts +0 -1
  171. package/esm/features/crosswalks/AttributesTable/components/SimpleAttributesRenderer/SimpleAttributesRenderer.test.js +0 -64
  172. package/esm/features/crosswalks/CrosswalkDateEditor/IntegrationCrosswalkDateEditor.test.d.ts +0 -1
  173. package/esm/features/crosswalks/CrosswalkDateEditor/IntegrationCrosswalkDateEditor.test.js +0 -132
  174. package/esm/features/crosswalks/CrosswalkDragLayer/components/CrosswalkDragPreview/CrosswalkDragPreview.test.d.ts +0 -1
  175. package/esm/features/crosswalks/CrosswalkDragLayer/components/CrosswalkDragPreview/CrosswalkDragPreview.test.js +0 -28
  176. /package/cjs/{features/crosswalks/AttributesTable/IntegrationAttributesTable.test.d.ts → UpSetChart/UpSetChart.test.d.ts} +0 -0
  177. /package/{cjs/features/crosswalks/AttributesTable/components/AddAttributesButton/AddAttributesButton.test.d.ts → esm/UpSetChart/UpSetChart.test.d.ts} +0 -0
  178. /package/{cjs/features/crosswalks/AttributesTable/components/AttributeValuesRenderer/AttributeValuesRenderer.test.d.ts → esm/UpSetChart/types.js} +0 -0
@@ -1,58 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- var react_1 = __importDefault(require("react"));
7
- var enzyme_1 = require("enzyme");
8
- var RuleTypeRenderer_1 = require("./RuleTypeRenderer");
9
- var RuleTypeInfoButton_1 = require("../RuleTypeInfoButton");
10
- describe('RuleTypeRenderer tests', function () {
11
- it('should render simple rule correctly', function () {
12
- var value = {
13
- ruleType: {
14
- uri: 'configuration/survivorshipStrategies/LUD',
15
- label: 'Recency'
16
- }
17
- };
18
- var wrapper = (0, enzyme_1.shallow)(react_1.default.createElement(RuleTypeRenderer_1.RuleTypeRenderer, { value: value }));
19
- expect(wrapper.find('.label').text()).toBe('Recency');
20
- expect(wrapper.find(RuleTypeInfoButton_1.RuleTypeInfoButton).length).toBe(0);
21
- });
22
- it('should render correctly if it has sourcesUriOrder prop', function () {
23
- var value = {
24
- ruleType: {
25
- uri: 'configuration/survivorshipStrategies/SRC_SYS',
26
- label: 'Source system'
27
- },
28
- sourcesUriOrder: ['configuration/sources/CGD', 'configuration/sources/DNO']
29
- };
30
- var wrapper = (0, enzyme_1.shallow)(react_1.default.createElement(RuleTypeRenderer_1.RuleTypeRenderer, { value: value }));
31
- expect(wrapper.find('.label').text()).toBe('Source system');
32
- expect(wrapper.find(RuleTypeInfoButton_1.RuleTypeInfoButton).length).toBe(1);
33
- });
34
- it('should render correctly if it has primaryAttributeUri prop', function () {
35
- var value = {
36
- ruleType: {
37
- uri: 'configuration/survivorshipStrategies/OtherAttributeWinnerCrosswalk',
38
- label: 'Other Attribute Winner Crosswalk'
39
- },
40
- primaryAttributeUri: 'configuration/entityTypes/HCP/attributes/CountryCode'
41
- };
42
- var wrapper = (0, enzyme_1.shallow)(react_1.default.createElement(RuleTypeRenderer_1.RuleTypeRenderer, { value: value }));
43
- expect(wrapper.find('.label').text()).toBe('Other Attribute Winner Crosswalk');
44
- expect(wrapper.find(RuleTypeInfoButton_1.RuleTypeInfoButton).length).toBe(1);
45
- });
46
- it('should render correctly if it has comparisonAttributeUri prop', function () {
47
- var value = {
48
- ruleType: {
49
- uri: 'configuration/survivorshipStrategies/MinValue',
50
- label: 'Minimum value'
51
- },
52
- comparisonAttributeUri: 'configuration/relationTypes/HasAddress/attributes/Status'
53
- };
54
- var wrapper = (0, enzyme_1.shallow)(react_1.default.createElement(RuleTypeRenderer_1.RuleTypeRenderer, { value: value }));
55
- expect(wrapper.find('.label').text()).toBe('Minimum value');
56
- expect(wrapper.find(RuleTypeInfoButton_1.RuleTypeInfoButton).length).toBe(1);
57
- });
58
- });
@@ -1,69 +0,0 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __importDefault = (this && this.__importDefault) || function (mod) {
14
- return (mod && mod.__esModule) ? mod : { "default": mod };
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- var react_1 = __importDefault(require("react"));
18
- var enzyme_1 = require("enzyme");
19
- var InlineAttributesPager_1 = require("../../../../../InlineAttributesPager");
20
- var SimpleAttributesRenderer_1 = require("./SimpleAttributesRenderer");
21
- describe('SimpleAttributesRenderer tests', function () {
22
- it('should render correctly', function () {
23
- var crosswalks = [
24
- {
25
- uri: 'entities/j8K1vc9/crosswalks/12jf9nL05',
26
- type: 'configuration/sources/Reltio',
27
- value: 'nQpZyQt',
28
- reltioLoadDate: '2021-06-11T08:24:31.726Z',
29
- createDate: '2018-11-19T12:14:00.735Z',
30
- updateDate: '2018-11-19T12:14:00.735Z',
31
- attributes: ['entities/1/attributes/CountryCode/1', 'entities/1/attributes/Date/1'],
32
- singleAttributeUpdateDates: {
33
- 'entities/1/attributes/Date/1': '2018-11-29T05:39:56.445Z'
34
- }
35
- }
36
- ];
37
- var props = {
38
- attributeValues: [
39
- {
40
- uri: 'entities/1/attributes/CountryCode/1',
41
- type: 'configuration/entityTypes/HCP/attributes/CountryCode',
42
- value: 'Italy',
43
- lookupCode: 'IT',
44
- ov: true
45
- }
46
- ],
47
- attributeType: {
48
- label: 'Country Code',
49
- name: 'CountryCode',
50
- type: 'String',
51
- uri: 'configuration/entityTypes/HCP/attributes/CountryCode'
52
- },
53
- crosswalksMap: {
54
- 'entities/1/attributes/CountryCode/1': [crosswalks[0]],
55
- 'entities/1/attributes/Date/1': [crosswalks[0]]
56
- },
57
- onPin: jest.fn(),
58
- onIgnore: jest.fn(),
59
- onEdit: jest.fn(),
60
- onAdd: jest.fn(),
61
- onDelete: jest.fn(),
62
- parentUri: 'entities/1',
63
- emptyTempAttributeUris: []
64
- };
65
- var wrapper = (0, enzyme_1.shallow)(react_1.default.createElement(SimpleAttributesRenderer_1.SimpleAttributesRenderer, __assign({}, props)));
66
- expect(wrapper.find('.basicCell').length).toBe(1);
67
- expect(wrapper.find(InlineAttributesPager_1.InlineAttributesPager).props()).toEqual(props);
68
- });
69
- });
@@ -1,137 +0,0 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
- return new (P || (P = Promise))(function (resolve, reject) {
16
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
17
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
18
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
19
- step((generator = generator.apply(thisArg, _arguments || [])).next());
20
- });
21
- };
22
- var __generator = (this && this.__generator) || function (thisArg, body) {
23
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
24
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
- function verb(n) { return function (v) { return step([n, v]); }; }
26
- function step(op) {
27
- if (f) throw new TypeError("Generator is already executing.");
28
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
29
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
- if (y = 0, t) op = [op[0] & 2, t.value];
31
- switch (op[0]) {
32
- case 0: case 1: t = op; break;
33
- case 4: _.label++; return { value: op[1], done: false };
34
- case 5: _.label++; y = op[1]; op = [0]; continue;
35
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
36
- default:
37
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
38
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
39
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
40
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
41
- if (t[2]) _.ops.pop();
42
- _.trys.pop(); continue;
43
- }
44
- op = body.call(thisArg, _);
45
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
46
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
47
- }
48
- };
49
- var __importDefault = (this && this.__importDefault) || function (mod) {
50
- return (mod && mod.__esModule) ? mod : { "default": mod };
51
- };
52
- Object.defineProperty(exports, "__esModule", { value: true });
53
- var react_1 = __importDefault(require("react"));
54
- var react_2 = require("@testing-library/react");
55
- var user_event_1 = __importDefault(require("@testing-library/user-event"));
56
- var LocalizationProvider_1 = require("@mui/x-date-pickers/LocalizationProvider");
57
- var AdapterMoment_1 = require("@mui/x-date-pickers/AdapterMoment");
58
- var CrosswalkDateEditor_1 = require("./CrosswalkDateEditor");
59
- describe('CrosswalkDateEditor tests', function () {
60
- afterEach(function () {
61
- jest.clearAllMocks();
62
- });
63
- var date = new Date('01/01/2021').valueOf();
64
- var defaultProps = {
65
- value: date,
66
- classes: { root: 'someClass' },
67
- onChange: jest.fn()
68
- };
69
- var setUp = function (props) {
70
- if (props === void 0) { props = defaultProps; }
71
- var user = user_event_1.default.setup();
72
- var Providers = function (_a) {
73
- var children = _a.children;
74
- return react_1.default.createElement(LocalizationProvider_1.LocalizationProvider, { dateAdapter: AdapterMoment_1.AdapterMoment }, children);
75
- };
76
- return __assign(__assign({}, (0, react_2.render)(react_1.default.createElement(CrosswalkDateEditor_1.CrosswalkDateEditor, __assign({}, props)), { wrapper: Providers })), { user: user });
77
- };
78
- it('new should call props.onChange when calling TimestampEditor onClose prop', function () { return __awaiter(void 0, void 0, void 0, function () {
79
- var user;
80
- return __generator(this, function (_a) {
81
- switch (_a.label) {
82
- case 0:
83
- user = setUp().user;
84
- return [4 /*yield*/, user.click(react_2.screen.getByRole('button'))];
85
- case 1:
86
- _a.sent();
87
- return [4 /*yield*/, user.click(react_2.screen.getByText('5'))];
88
- case 2:
89
- _a.sent();
90
- expect(react_2.screen.getByDisplayValue('01/05/2021 12:00:00 AM')).toBeInTheDocument();
91
- return [4 /*yield*/, user.click(react_2.screen.getAllByRole('button')[0])];
92
- case 3:
93
- _a.sent();
94
- expect(defaultProps.onChange).toHaveBeenCalledWith(new Date('01/05/2021 12:00:00 AM').valueOf());
95
- return [2 /*return*/];
96
- }
97
- });
98
- }); });
99
- it('should call props.onChange when calling TimestampEditor onBlur for input', function () { return __awaiter(void 0, void 0, void 0, function () {
100
- var user, newDate;
101
- return __generator(this, function (_a) {
102
- switch (_a.label) {
103
- case 0:
104
- user = setUp().user;
105
- newDate = '10/10/2021';
106
- return [4 /*yield*/, user.type(react_2.screen.getByRole('textbox'), '01/01/2020')];
107
- case 1:
108
- _a.sent();
109
- expect(react_2.screen.getByDisplayValue('01/01/2020 12:00:00 AM')).toBeInTheDocument();
110
- return [4 /*yield*/, user.type(react_2.screen.getByRole('textbox'), newDate)];
111
- case 2:
112
- _a.sent();
113
- expect(react_2.screen.getByDisplayValue('10/10/2021 12:00:00 AM')).toBeInTheDocument();
114
- expect(defaultProps.onChange).not.toHaveBeenCalled();
115
- return [4 /*yield*/, user.tab()];
116
- case 3:
117
- _a.sent();
118
- expect(defaultProps.onChange).toHaveBeenCalledWith(new Date(newDate).valueOf());
119
- return [2 /*return*/];
120
- }
121
- });
122
- }); });
123
- it('should change value of component when value property updated', function () { return __awaiter(void 0, void 0, void 0, function () {
124
- var rerender;
125
- return __generator(this, function (_a) {
126
- switch (_a.label) {
127
- case 0:
128
- rerender = setUp().rerender;
129
- return [4 /*yield*/, rerender(react_1.default.createElement(CrosswalkDateEditor_1.CrosswalkDateEditor, __assign({}, defaultProps, { value: new Date('10/10/2021').valueOf() })))];
130
- case 1:
131
- _a.sent();
132
- expect(react_2.screen.getByDisplayValue('10/10/2021 12:00:00 AM')).toBeInTheDocument();
133
- return [2 /*return*/];
134
- }
135
- });
136
- }); });
137
- });
@@ -1,56 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __importDefault = (this && this.__importDefault) || function (mod) {
26
- return (mod && mod.__esModule) ? mod : { "default": mod };
27
- };
28
- Object.defineProperty(exports, "__esModule", { value: true });
29
- var react_1 = __importDefault(require("react"));
30
- var enzyme_1 = require("enzyme");
31
- var CrosswalksDisplay = __importStar(require("../../../../../contexts/CrosswalksDisplayContext"));
32
- var MdmModuleContext_1 = require("../../../../../contexts/MdmModuleContext");
33
- var SourceIcon_1 = require("../../../../../SourceIcon");
34
- var ColoredBlock_1 = require("../../../ColoredBlock");
35
- var CrosswalkDragPreview_1 = require("./CrosswalkDragPreview");
36
- describe('CrosswalkDragPreview tests', function () {
37
- beforeAll(function () {
38
- jest.spyOn(CrosswalksDisplay, 'useCrosswalkColor').mockImplementation(function (crosswalks) { return crosswalks === null || crosswalks === void 0 ? void 0 : crosswalks.value; });
39
- });
40
- it('should render correctly', function () {
41
- var metadata = {
42
- sources: [
43
- {
44
- uri: 'configuration/sources/FB',
45
- label: 'Facebook'
46
- }
47
- ]
48
- };
49
- var crosswalk = { uri: 'entities/1/crosswalks/1', type: 'configuration/sources/FB', value: '123' };
50
- var wrapper = (0, enzyme_1.mount)(react_1.default.createElement(MdmModuleContext_1.MdmModuleProvider, { values: { metadata: metadata } },
51
- react_1.default.createElement(CrosswalkDragPreview_1.CrosswalkDragPreview, { crosswalk: crosswalk })));
52
- expect(wrapper.find(ColoredBlock_1.ColoredBlock).prop('color')).toBe('123');
53
- expect(wrapper.find(SourceIcon_1.SourceIcon).prop('sourceType')).toBe(crosswalk.type);
54
- expect(wrapper.find('p.sourceLabel').text()).toBe('Facebook');
55
- });
56
- });
@@ -1,3 +0,0 @@
1
- import { Entity, Metadata } from '@reltio/mdm-sdk';
2
- export declare const createEntity: () => Entity;
3
- export declare const createMetadata: () => Metadata;
@@ -1,47 +0,0 @@
1
- export var createEntity = function () {
2
- return {
3
- uri: 'entities/01L2n5z',
4
- type: 'configuration/entityTypes/HCP',
5
- label: 'entity label',
6
- attributes: {
7
- Boolean: [
8
- {
9
- ov: true,
10
- type: 'configuration/entityTypes/HCP/attributes/Boolean',
11
- uri: 'entities/01L2n5z/attributes/Boolean/5nmc3Cp',
12
- value: 'true'
13
- }
14
- ],
15
- TextField: [
16
- {
17
- ov: true,
18
- type: 'configuration/entityTypes/HCP/attributes/TextField',
19
- uri: 'entities/01L2n5z/attributes/TextField/5noU1aB',
20
- value: 'text field value'
21
- }
22
- ]
23
- },
24
- crosswalks: [
25
- {
26
- attributes: [
27
- 'entities/01L2n5z/attributes/TextField/5noU1aB',
28
- 'entities/01L2n5z/attributes/Boolean/5nmc3Cp'
29
- ],
30
- type: 'configuration/sources/Reltio',
31
- uri: 'entities/01L2n5z/crosswalks/7F10sMx',
32
- value: '01L2n5z'
33
- }
34
- ]
35
- };
36
- };
37
- export var createMetadata = function () {
38
- return {
39
- entityTypes: [],
40
- sources: [
41
- {
42
- uri: 'configuration/sources/Reltio',
43
- label: 'Reltio'
44
- }
45
- ]
46
- };
47
- };