@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,323 +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 react_dnd_1 = require("react-dnd");
57
- var react_dnd_html5_backend_1 = __importDefault(require("react-dnd-html5-backend"));
58
- var test_utils_1 = require("../../../test-utils");
59
- var MdmModuleContext_1 = require("../../../contexts/MdmModuleContext");
60
- var IntegrationAttributesTable_test_data_1 = require("./IntegrationAttributesTable.test-data");
61
- var AttributesTable_1 = __importDefault(require("./AttributesTable"));
62
- jest.mock('@reltio/mdm-sdk', function () { return (__assign(__assign({}, jest.requireActual('@reltio/mdm-sdk')), { debounce: function (x) { return x; } })); });
63
- var visibleColumns = ['ovValues', 'values'];
64
- var selectedAttributeTypes = [
65
- {
66
- description: 'String Attribute',
67
- label: '<h1>String</h1>',
68
- name: 'TextField',
69
- type: 'String',
70
- uri: 'configuration/entityTypes/HCP/attributes/TextField'
71
- },
72
- {
73
- description: 'Yes or No',
74
- label: 'Boolean',
75
- name: 'Boolean',
76
- type: 'Boolean',
77
- uri: 'configuration/entityTypes/HCP/attributes/Boolean'
78
- }
79
- ];
80
- var crosswalksMap = {
81
- entity: {
82
- 'entities/01L2n5z/attributes/Boolean/5nmc3Cp': [
83
- {
84
- attributes: [
85
- 'entities/01L2n5z/attributes/TextField/5noU1aB',
86
- 'entities/01L2n5z/attributes/Boolean/5nmc3Cp'
87
- ],
88
- type: 'configuration/sources/Reltio',
89
- uri: 'entities/01L2n5z/crosswalks/7F10sMx',
90
- value: '01L2n5z'
91
- }
92
- ],
93
- 'entities/01L2n5z/attributes/TextField/5noU1aB': [
94
- {
95
- attributes: [
96
- 'entities/01L2n5z/attributes/TextField/5noU1aB',
97
- 'entities/01L2n5z/attributes/Boolean/5nmc3Cp'
98
- ],
99
- type: 'configuration/sources/Reltio',
100
- uri: 'entities/01L2n5z/crosswalks/7F10sMx',
101
- value: '01L2n5z'
102
- }
103
- ]
104
- },
105
- relation: {}
106
- };
107
- var metadata = (0, IntegrationAttributesTable_test_data_1.createMetadata)();
108
- var defaultProps = {
109
- entity: (0, IntegrationAttributesTable_test_data_1.createEntity)(),
110
- isLoading: false,
111
- crosswalksMap: crosswalksMap,
112
- visibleColumns: visibleColumns,
113
- onChangeVisibleColumns: function () { },
114
- readOnly: false,
115
- onDelete: function () { },
116
- onPin: function () { },
117
- onIgnore: function () { },
118
- onEdit: function () { },
119
- onAdd: function () { },
120
- selectedAttributeTypes: selectedAttributeTypes,
121
- onSelectAttributeTypes: function () { },
122
- additionalHeaderItems: null,
123
- className: 'className',
124
- emptyTempAttributeUris: []
125
- };
126
- var setUp = function (props) {
127
- var user = user_event_1.default.setup({ delay: null, skipHover: true });
128
- var Providers = function (_a) {
129
- var children = _a.children;
130
- return (react_1.default.createElement(react_dnd_1.DndProvider, { backend: react_dnd_html5_backend_1.default },
131
- react_1.default.createElement(MdmModuleContext_1.MdmModuleProvider, { values: { metadata: metadata } }, children)));
132
- };
133
- var renderer = (0, react_2.render)(react_1.default.createElement(AttributesTable_1.default, __assign({}, props)), { wrapper: Providers });
134
- return __assign(__assign({}, renderer), { user: user });
135
- };
136
- describe('attribute table tests', function () {
137
- var getRowByIndex = function (index) {
138
- var fixHeadAndFirstColumnContainer = react_2.screen.queryByTestId('fix-head-and-fix-column-container');
139
- return (0, react_2.within)(fixHeadAndFirstColumnContainer).queryAllByTestId("base-cell-".concat(index));
140
- };
141
- var getCellByIndexes = function (rowIndex, columnIndex) {
142
- var row = getRowByIndex(rowIndex);
143
- return row[columnIndex];
144
- };
145
- var editTextFieldAttribute = function (user) { return __awaiter(void 0, void 0, void 0, function () {
146
- var attribute;
147
- return __generator(this, function (_a) {
148
- switch (_a.label) {
149
- case 0:
150
- attribute = (0, react_2.within)(getCellByIndexes(0, 1)).getByTestId('value-index-0');
151
- return [4 /*yield*/, user.hover(attribute)];
152
- case 1:
153
- _a.sent();
154
- return [4 /*yield*/, user.click((0, react_2.within)(attribute).queryByRole('button', { name: 'More actions' }))];
155
- case 2:
156
- _a.sent();
157
- return [4 /*yield*/, user.click(react_2.screen.getByText('Edit'))];
158
- case 3:
159
- _a.sent();
160
- return [4 /*yield*/, user.type(react_2.screen.getByRole('textbox'), 'newValue')];
161
- case 4:
162
- _a.sent();
163
- return [4 /*yield*/, user.keyboard('[Enter]')];
164
- case 5:
165
- _a.sent();
166
- return [2 /*return*/];
167
- }
168
- });
169
- }); };
170
- afterEach(function () {
171
- jest.clearAllMocks();
172
- });
173
- it.skip('should drag and drop rows correctly', function () {
174
- jest.useFakeTimers();
175
- var unmockTableSizing = (0, test_utils_1.mockBasicTableSizing)();
176
- var onSelectAttributeTypes = jest.fn();
177
- var props = __assign(__assign({}, defaultProps), { onSelectAttributeTypes: onSelectAttributeTypes });
178
- setUp(props);
179
- expect((0, react_2.within)(getCellByIndexes(1, 0)).queryByText('Yes')).toBeInTheDocument();
180
- expect((0, react_2.within)(getCellByIndexes(1, 0)).queryByText('Boolean')).toBeInTheDocument();
181
- expect((0, react_2.within)(getCellByIndexes(1, 1)).queryByText('Yes')).toBeInTheDocument();
182
- expect((0, react_2.within)(getCellByIndexes(0, 0)).queryByText('text field value')).toBeInTheDocument();
183
- expect((0, react_2.within)(getCellByIndexes(0, 0)).queryByText('<h1>String</h1>')).toBeInTheDocument();
184
- expect((0, react_2.within)(getCellByIndexes(0, 1)).queryByText('text field value')).toBeInTheDocument();
185
- var dragIndicator = getCellByIndexes(0, 0).querySelector('.dragIndicator');
186
- react_2.fireEvent.dragStart(dragIndicator);
187
- jest.runAllTimers();
188
- expect((0, react_2.within)(getCellByIndexes(1, 0)).queryByText('Yes')).not.toBeInTheDocument();
189
- expect((0, react_2.within)(getCellByIndexes(1, 0)).queryByText('Boolean')).toBeInTheDocument();
190
- expect((0, react_2.within)(getCellByIndexes(1, 1)).queryByText('Yes')).not.toBeInTheDocument();
191
- expect((0, react_2.within)(getCellByIndexes(0, 0)).queryByText('text field value')).not.toBeInTheDocument();
192
- expect((0, react_2.within)(getCellByIndexes(0, 0)).queryByText('<h1>String</h1>')).toBeInTheDocument();
193
- expect((0, react_2.within)(getCellByIndexes(0, 1)).queryByText('text field value')).not.toBeInTheDocument();
194
- var dropRow = getCellByIndexes(1, 0);
195
- react_2.fireEvent.dragEnter(dropRow);
196
- expect((0, react_2.within)(getCellByIndexes(0, 0)).queryByText('Boolean')).toBeInTheDocument();
197
- expect((0, react_2.within)(getCellByIndexes(1, 0)).queryByText('<h1>String</h1>')).toBeInTheDocument();
198
- react_2.fireEvent.dragEnd(dropRow);
199
- expect(onSelectAttributeTypes).toHaveBeenCalledWith([selectedAttributeTypes[1], selectedAttributeTypes[0]]);
200
- unmockTableSizing();
201
- });
202
- it('should not call onDelete when user clicks No and then Yes in confirmation dialog on deleting attribute', function () { return __awaiter(void 0, void 0, void 0, function () {
203
- var unmockTableSizing, onDelete, props, user, attribute, moreButton, deleteButton, dialog, declineButton, confirmButton;
204
- return __generator(this, function (_a) {
205
- switch (_a.label) {
206
- case 0:
207
- unmockTableSizing = (0, test_utils_1.mockBasicTableSizing)();
208
- onDelete = jest.fn();
209
- props = __assign(__assign({}, defaultProps), { onDelete: onDelete });
210
- user = setUp(props).user;
211
- attribute = (0, react_2.within)(getCellByIndexes(1, 1)).getByTestId('value-index-0');
212
- return [4 /*yield*/, user.hover(attribute)];
213
- case 1:
214
- _a.sent();
215
- moreButton = (0, react_2.within)(attribute).getByRole('button', { name: 'More actions' });
216
- return [4 /*yield*/, user.click(moreButton)];
217
- case 2:
218
- _a.sent();
219
- deleteButton = react_2.screen.getByText('Delete');
220
- return [4 /*yield*/, user.click(deleteButton)];
221
- case 3:
222
- _a.sent();
223
- dialog = react_2.screen.getByRole('dialog');
224
- declineButton = (0, react_2.within)(dialog).getByText('No');
225
- confirmButton = (0, react_2.within)(dialog).getByText('Yes');
226
- react_2.fireEvent.click(declineButton);
227
- react_2.fireEvent.click(confirmButton);
228
- expect(onDelete).not.toHaveBeenCalled();
229
- unmockTableSizing();
230
- return [2 /*return*/];
231
- }
232
- });
233
- }); });
234
- it('should pin and ignore auto generated attributes', function () { return __awaiter(void 0, void 0, void 0, function () {
235
- var unmockTableSizing, onPin, onIgnore, selectedAttributeTypes, props, user, attribute, pinButton, ignoreButton;
236
- return __generator(this, function (_a) {
237
- switch (_a.label) {
238
- case 0:
239
- unmockTableSizing = (0, test_utils_1.mockBasicTableSizing)();
240
- onPin = jest.fn();
241
- onIgnore = jest.fn();
242
- selectedAttributeTypes = [
243
- {
244
- description: 'Yes or No',
245
- label: 'Boolean',
246
- name: 'Boolean',
247
- type: 'Boolean',
248
- uri: 'configuration/entityTypes/HCP/attributes/Boolean',
249
- autoGenerated: true
250
- }
251
- ];
252
- props = __assign(__assign({}, defaultProps), { selectedAttributeTypes: selectedAttributeTypes, onPin: onPin, onIgnore: onIgnore });
253
- user = setUp(props).user;
254
- attribute = (0, react_2.within)(getCellByIndexes(0, 1)).getByTestId('value-index-0');
255
- return [4 /*yield*/, user.hover(attribute)];
256
- case 1:
257
- _a.sent();
258
- pinButton = (0, react_2.within)(attribute).getByLabelText('Pin').querySelector('button');
259
- ignoreButton = (0, react_2.within)(attribute).getByLabelText('Ignore').querySelector('button');
260
- expect((0, react_2.within)(attribute).queryByRole('button', { name: 'More actions' })).not.toBeInTheDocument();
261
- return [4 /*yield*/, user.click(pinButton)];
262
- case 2:
263
- _a.sent();
264
- expect(onPin).toHaveBeenCalled();
265
- return [4 /*yield*/, user.click(ignoreButton)];
266
- case 3:
267
- _a.sent();
268
- expect(onIgnore).toHaveBeenCalled();
269
- unmockTableSizing();
270
- return [2 /*return*/];
271
- }
272
- });
273
- }); });
274
- it('should call on edit only once in case of dblClick on "Safe without ignore"', function () { return __awaiter(void 0, void 0, void 0, function () {
275
- var onEdit, unmockTableSizing, entity, props, user;
276
- return __generator(this, function (_a) {
277
- switch (_a.label) {
278
- case 0:
279
- onEdit = jest.fn();
280
- unmockTableSizing = (0, test_utils_1.mockBasicTableSizing)();
281
- entity = (0, IntegrationAttributesTable_test_data_1.createEntity)();
282
- entity.attributes.TextField[0].ignored = true;
283
- props = __assign(__assign({}, defaultProps), { entity: entity, onEdit: onEdit });
284
- user = setUp(props).user;
285
- return [4 /*yield*/, editTextFieldAttribute(user)];
286
- case 1:
287
- _a.sent();
288
- return [4 /*yield*/, user.dblClick(react_2.screen.getByText('Ok'))];
289
- case 2:
290
- _a.sent();
291
- expect(onEdit).toHaveBeenCalledTimes(1);
292
- unmockTableSizing();
293
- return [2 /*return*/];
294
- }
295
- });
296
- }); });
297
- it('should call on edit only once in case of dblClick on "Save and apply Ignore to new value"', function () { return __awaiter(void 0, void 0, void 0, function () {
298
- var onEdit, unmockTableSizing, entity, props, user;
299
- return __generator(this, function (_a) {
300
- switch (_a.label) {
301
- case 0:
302
- onEdit = jest.fn();
303
- unmockTableSizing = (0, test_utils_1.mockBasicTableSizing)();
304
- entity = (0, IntegrationAttributesTable_test_data_1.createEntity)();
305
- entity.attributes.TextField[0].ignored = true;
306
- props = __assign(__assign({}, defaultProps), { entity: entity, onEdit: onEdit });
307
- user = setUp(props).user;
308
- return [4 /*yield*/, editTextFieldAttribute(user)];
309
- case 1:
310
- _a.sent();
311
- return [4 /*yield*/, user.dblClick(react_2.screen.getByText('Save and apply Ignore to new value'))];
312
- case 2:
313
- _a.sent();
314
- return [4 /*yield*/, user.dblClick(react_2.screen.getByText('Ok'))];
315
- case 3:
316
- _a.sent();
317
- expect(onEdit).toHaveBeenCalledTimes(1);
318
- unmockTableSizing();
319
- return [2 /*return*/];
320
- }
321
- });
322
- }); });
323
- });
@@ -1,142 +0,0 @@
1
- "use strict";
2
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
3
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
4
- if (ar || !(i in from)) {
5
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
6
- ar[i] = from[i];
7
- }
8
- }
9
- return to.concat(ar || Array.prototype.slice.call(from));
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- var react_1 = __importDefault(require("react"));
16
- var enzyme_1 = require("enzyme");
17
- var mdm_sdk_1 = require("@reltio/mdm-sdk");
18
- var MdmModuleContext_1 = require("../../../../../contexts/MdmModuleContext");
19
- var BasicTableContext_1 = require("../../../../../contexts/BasicTableContext");
20
- var AddAttributesButton_1 = __importDefault(require("./AddAttributesButton"));
21
- var metadata = {
22
- entityTypes: [
23
- {
24
- uri: 'configuration/entityTypes/HCP',
25
- label: 'HCP',
26
- attributes: [
27
- {
28
- label: 'Country Code',
29
- name: 'CountryCode',
30
- type: 'String',
31
- uri: 'configuration/entityTypes/HCP/attributes/CountryCode'
32
- },
33
- {
34
- label: 'Date',
35
- name: 'Date',
36
- type: 'Date',
37
- uri: 'configuration/entityTypes/HCP/attributes/Date'
38
- },
39
- {
40
- label: 'Hidden',
41
- name: 'Hidden',
42
- type: 'String',
43
- uri: 'configuration/entityTypes/HCP/attributes/Hidden',
44
- hidden: true
45
- },
46
- {
47
- label: 'Nested',
48
- name: 'Nested',
49
- type: 'Nested',
50
- uri: 'configuration/entityTypes/HCP/attributes/Nested'
51
- },
52
- {
53
- label: 'Reference',
54
- name: 'Reference',
55
- type: 'Reference',
56
- uri: 'configuration/entityTypes/HCP/attributes/Reference'
57
- },
58
- {
59
- label: 'Image',
60
- name: 'Image',
61
- type: 'Image',
62
- uri: 'configuration/entityTypes/HCP/attributes/Image'
63
- }
64
- ]
65
- }
66
- ]
67
- };
68
- var attributesSortingStrategy = mdm_sdk_1.SortingStrategy.ASC_BY_NAME;
69
- var defaultProps = {
70
- parentUri: 'entities/1',
71
- parentTypeUri: 'configuration/entityTypes/HCP',
72
- onAdd: jest.fn(),
73
- selectedAttributeTypes: [
74
- {
75
- label: 'Country Code',
76
- name: 'CountryCode',
77
- type: 'String',
78
- uri: 'configuration/entityTypes/HCP/attributes/CountryCode'
79
- }
80
- ],
81
- onSelectAttributeTypes: jest.fn()
82
- };
83
- var setUp = function (props) {
84
- if (props === void 0) { props = defaultProps; }
85
- return (0, enzyme_1.mount)(react_1.default.createElement(BasicTableContext_1.BasicTableContext.Provider, { value: props },
86
- react_1.default.createElement(MdmModuleContext_1.MdmModuleProvider, { values: { metadata: metadata, attributesSortingStrategy: attributesSortingStrategy } },
87
- react_1.default.createElement(AddAttributesButton_1.default, null))));
88
- };
89
- describe('AddAttributesButton tests', function () {
90
- it('should render attribute button with nested and non-selected simple attributes', function () {
91
- var wrapper = setUp();
92
- expect(wrapper.find('MoreAttributesButton').props()).toMatchObject({
93
- label: 'Attribute',
94
- popupTitle: 'Add attributes',
95
- data: [
96
- {
97
- label: 'Date',
98
- name: 'Date',
99
- type: 'Date',
100
- uri: 'configuration/entityTypes/HCP/attributes/Date'
101
- },
102
- {
103
- label: 'Nested',
104
- name: 'Nested',
105
- type: 'Nested',
106
- uri: 'configuration/entityTypes/HCP/attributes/Nested'
107
- }
108
- ]
109
- });
110
- });
111
- it('should add attribute to beginning on simple attribute select', function () {
112
- var onSelectAttributeTypes = defaultProps.onSelectAttributeTypes, selectedAttributeTypes = defaultProps.selectedAttributeTypes, onAdd = defaultProps.onAdd;
113
- var wrapper = setUp();
114
- var onApply = wrapper.find('MoreAttributesButton').prop('onApply');
115
- var selectedSimple = {
116
- label: 'Date',
117
- name: 'Date',
118
- type: 'Date',
119
- uri: 'configuration/entityTypes/HCP/attributes/Date'
120
- };
121
- onApply([selectedSimple]);
122
- expect(onSelectAttributeTypes).toHaveBeenCalledWith(__spreadArray([selectedSimple], selectedAttributeTypes, true));
123
- expect(onAdd).not.toHaveBeenCalled();
124
- });
125
- it('should add attribute to beginning on nested attribute select', function () {
126
- var onSelectAttributeTypes = defaultProps.onSelectAttributeTypes, selectedAttributeTypes = defaultProps.selectedAttributeTypes, onAdd = defaultProps.onAdd, parentUri = defaultProps.parentUri;
127
- var wrapper = setUp();
128
- var onApply = wrapper.find('MoreAttributesButton').prop('onApply');
129
- var selectedNested = {
130
- label: 'Nested',
131
- name: 'Nested',
132
- type: 'Nested',
133
- uri: 'configuration/entityTypes/HCP/attributes/Nested'
134
- };
135
- onApply([selectedNested]);
136
- expect(onSelectAttributeTypes).toHaveBeenCalledWith(__spreadArray([selectedNested], selectedAttributeTypes, true));
137
- expect(onAdd).toHaveBeenCalledWith({
138
- attributeType: selectedNested,
139
- parentUri: parentUri
140
- });
141
- });
142
- });
@@ -1,146 +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 SimpleAttributesRenderer_1 = require("../SimpleAttributesRenderer");
20
- var NestedAttributesRenderer_1 = require("../NestedAttributesRenderer");
21
- var ReferenceAttributesRenderer_1 = require("../ReferenceAttributesRenderer");
22
- var AttributeValuesRenderer_1 = require("./AttributeValuesRenderer");
23
- describe('AttributeValuesRenderer tests', function () {
24
- var contextProps = {
25
- onPin: jest.fn(),
26
- onIgnore: jest.fn(),
27
- onAdd: jest.fn(),
28
- onEdit: jest.fn(),
29
- onDelete: jest.fn(),
30
- parentUri: 'entities/1',
31
- emptyTempAttributeUris: []
32
- };
33
- it('should render simple attributes correctly', function () {
34
- var value = {
35
- attributeValues: [
36
- {
37
- uri: 'entities/1/attributes/CountryCode/1',
38
- type: 'configuration/entityTypes/HCP/attributes/CountryCode',
39
- value: 'Italy',
40
- lookupCode: 'IT',
41
- ov: true
42
- }
43
- ],
44
- attributeType: {
45
- label: 'Country Code',
46
- name: 'CountryCode',
47
- type: 'String',
48
- uri: 'configuration/entityTypes/HCP/attributes/CountryCode'
49
- },
50
- crosswalksMap: {}
51
- };
52
- var wrapper = (0, enzyme_1.shallow)(react_1.default.createElement(AttributeValuesRenderer_1.AttributeValuesRenderer, __assign({ value: value }, contextProps)));
53
- expect(wrapper.find(SimpleAttributesRenderer_1.SimpleAttributesRenderer).props()).toEqual(__assign(__assign({}, value), contextProps));
54
- });
55
- it('should render nested attributes correctly', function () {
56
- var value = {
57
- attributeValues: [
58
- {
59
- uri: 'entities/1/attributes/Nested/1',
60
- value: {
61
- SubNested: [
62
- {
63
- uri: 'entities/1/attributes/Nested/1/SubNested/1',
64
- type: 'String',
65
- value: '1'
66
- }
67
- ]
68
- },
69
- ov: true
70
- }
71
- ],
72
- attributeType: {
73
- uri: 'configuration/entityTypes/HCP/attributes/Nested',
74
- label: 'Nested',
75
- name: 'Nested',
76
- type: 'Nested',
77
- attributes: [
78
- {
79
- label: 'SubNested',
80
- name: 'SubNested',
81
- type: 'String',
82
- uri: 'configuration/entityTypes/HCP/attributes/Nested/attributes/SubNested'
83
- }
84
- ]
85
- },
86
- crosswalksMap: {}
87
- };
88
- var wrapper = (0, enzyme_1.shallow)(react_1.default.createElement(AttributeValuesRenderer_1.AttributeValuesRenderer, __assign({ value: value }, contextProps)));
89
- expect(wrapper.find(NestedAttributesRenderer_1.NestedAttributesRenderer).props()).toEqual(__assign(__assign({}, value), contextProps));
90
- });
91
- it('should render reference attributes correctly', function () {
92
- var value = {
93
- attributeValues: [
94
- {
95
- label: '3588 Granada Aveue Santa Clara',
96
- relationshipLabel: 'Office',
97
- value: {
98
- AddressLine1: [
99
- {
100
- type: 'configuration/entityTypes/Location/attributes/AddressLine1',
101
- ov: true,
102
- value: '3588 Granada Aveue',
103
- uri: 'entities/1/attributes/Address/1/AddressLine1/1'
104
- }
105
- ]
106
- },
107
- ov: true,
108
- uri: 'entities/1/attributes/Address/1',
109
- refEntity: {},
110
- refRelation: {}
111
- }
112
- ],
113
- attributeType: {
114
- label: 'Address',
115
- name: 'Address',
116
- type: 'Reference',
117
- uri: 'configuration/entityTypes/HCP/attributes/Address'
118
- },
119
- crosswalksMap: {}
120
- };
121
- var wrapper = (0, enzyme_1.shallow)(react_1.default.createElement(AttributeValuesRenderer_1.AttributeValuesRenderer, __assign({ value: value }, contextProps)));
122
- expect(wrapper.find(ReferenceAttributesRenderer_1.ReferenceAttributesRenderer).props()).toEqual(__assign(__assign({}, value), contextProps));
123
- });
124
- it('should disable edit and delete for attributes if table is read only', function () {
125
- var value = {
126
- attributeValues: [
127
- {
128
- uri: 'entities/1/attributes/CountryCode/1',
129
- type: 'configuration/entityTypes/HCP/attributes/CountryCode',
130
- value: 'Italy',
131
- lookupCode: 'IT',
132
- ov: true
133
- }
134
- ],
135
- attributeType: {
136
- label: 'Country Code',
137
- name: 'CountryCode',
138
- type: 'String',
139
- uri: 'configuration/entityTypes/HCP/attributes/CountryCode'
140
- },
141
- crosswalksMap: {}
142
- };
143
- var wrapper = (0, enzyme_1.shallow)(react_1.default.createElement(AttributeValuesRenderer_1.AttributeValuesRenderer, __assign({ value: value }, contextProps, { readOnly: true })));
144
- expect(wrapper.find(SimpleAttributesRenderer_1.SimpleAttributesRenderer).props()).toEqual(__assign(__assign(__assign({}, value), contextProps), { disableEdit: true, disableDelete: true }));
145
- });
146
- });
@@ -1,50 +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 Spacer_1 = require("../../../../../Spacer");
20
- var AddAttributesButton_1 = require("../AddAttributesButton");
21
- var AttributesHeadCellRenderer_1 = require("./AttributesHeadCellRenderer");
22
- describe('AttributesHeadCellRenderer tests', function () {
23
- it('should render correctly', function () {
24
- var props = {
25
- headCellData: {
26
- id: 'ovValues',
27
- label: 'Attribute & OvValues'
28
- }
29
- };
30
- var wrapper = (0, enzyme_1.shallow)(react_1.default.createElement(AttributesHeadCellRenderer_1.AttributesHeadCellRenderer, __assign({}, props)));
31
- expect(wrapper.find('HeadCellRenderer').props()).toEqual(__assign(__assign({}, props), { children: [react_1.default.createElement(Spacer_1.Spacer, null), react_1.default.createElement(AddAttributesButton_1.AddAttributesButton, null)] }));
32
- });
33
- it('should not render AddAttributesButton if table is read only', function () {
34
- var props = {
35
- headCellData: {
36
- id: 'ovValues',
37
- label: 'Attribute & OvValues'
38
- },
39
- readOnly: true
40
- };
41
- var wrapper = (0, enzyme_1.shallow)(react_1.default.createElement(AttributesHeadCellRenderer_1.AttributesHeadCellRenderer, __assign({}, props)));
42
- expect(wrapper.find('HeadCellRenderer').props()).toEqual({
43
- headCellData: {
44
- id: 'ovValues',
45
- label: 'Attribute & OvValues'
46
- },
47
- children: undefined
48
- });
49
- });
50
- });