@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.
- package/cjs/UpSetChart/UpSetChart.d.ts +5 -8
- package/cjs/UpSetChart/UpSetChart.js +61 -5
- package/cjs/UpSetChart/UpSetChart.test.js +198 -0
- package/cjs/UpSetChart/components/IntersectionsChart/IntersectionsChart.d.ts +15 -0
- package/cjs/UpSetChart/components/IntersectionsChart/IntersectionsChart.js +66 -0
- package/cjs/UpSetChart/components/IntersectionsChart/index.d.ts +1 -0
- package/cjs/UpSetChart/components/IntersectionsChart/index.js +5 -0
- package/cjs/UpSetChart/components/IntersectionsChart/styles.d.ts +1 -0
- package/cjs/UpSetChart/components/IntersectionsChart/styles.js +32 -0
- package/cjs/UpSetChart/components/IntersectionsChartAxis/IntersectionsChartAxis.d.ts +10 -0
- package/cjs/UpSetChart/components/IntersectionsChartAxis/IntersectionsChartAxis.js +64 -0
- package/cjs/UpSetChart/components/IntersectionsChartAxis/index.d.ts +1 -0
- package/cjs/UpSetChart/components/IntersectionsChartAxis/index.js +5 -0
- package/cjs/UpSetChart/components/IntersectionsChartAxis/styles.d.ts +1 -0
- package/cjs/UpSetChart/components/IntersectionsChartAxis/styles.js +32 -0
- package/cjs/UpSetChart/components/IntersectionsMatrix/IntersectionsMatrix.d.ts +13 -0
- package/cjs/UpSetChart/components/IntersectionsMatrix/IntersectionsMatrix.js +56 -0
- package/cjs/UpSetChart/components/IntersectionsMatrix/index.d.ts +1 -0
- package/cjs/UpSetChart/components/IntersectionsMatrix/index.js +5 -0
- package/cjs/UpSetChart/components/IntersectionsMatrix/styles.d.ts +1 -0
- package/cjs/UpSetChart/components/IntersectionsMatrix/styles.js +27 -0
- package/cjs/UpSetChart/components/SetsChart/SetsChart.d.ts +15 -0
- package/cjs/UpSetChart/components/SetsChart/SetsChart.js +58 -0
- package/cjs/UpSetChart/components/SetsChart/index.d.ts +1 -0
- package/cjs/UpSetChart/components/SetsChart/index.js +5 -0
- package/cjs/UpSetChart/components/SetsChart/styles.d.ts +1 -0
- package/cjs/UpSetChart/components/SetsChart/styles.js +43 -0
- package/cjs/UpSetChart/components/SetsChartAxis/SetsChartAxis.d.ts +6 -0
- package/cjs/UpSetChart/components/SetsChartAxis/SetsChartAxis.js +20 -0
- package/cjs/UpSetChart/components/SetsChartAxis/index.d.ts +1 -0
- package/cjs/UpSetChart/components/SetsChartAxis/index.js +5 -0
- package/cjs/UpSetChart/components/SetsChartAxis/styles.d.ts +1 -0
- package/cjs/UpSetChart/components/SetsChartAxis/styles.js +17 -0
- package/cjs/UpSetChart/constants.d.ts +16 -3
- package/cjs/UpSetChart/constants.js +20 -4
- package/cjs/UpSetChart/gameOfThrones.test-data.d.ts +4 -0
- package/cjs/UpSetChart/gameOfThrones.test-data.js +26 -0
- package/cjs/UpSetChart/helpers.d.ts +20 -0
- package/cjs/UpSetChart/helpers.js +127 -0
- package/cjs/UpSetChart/styles.d.ts +4 -1
- package/cjs/UpSetChart/styles.js +11 -12
- package/cjs/UpSetChart/types.d.ts +16 -0
- package/cjs/UpSetChart/types.js +2 -0
- package/cjs/UpSetChart/useUpSetChartSizes.d.ts +20 -0
- package/cjs/UpSetChart/useUpSetChartSizes.js +34 -0
- package/cjs/features/crosswalks/AttributesTable/AttributesTable.test-data.d.ts +36 -0
- package/cjs/features/crosswalks/AttributesTable/AttributesTable.test-data.js +288 -0
- package/cjs/features/crosswalks/AttributesTable/AttributesTable.test.js +708 -370
- package/cjs/features/crosswalks/ColoredBlock/ColoredBlock.test.js +77 -15
- package/cjs/features/crosswalks/CopyableValueField/CopyableValueField.test.js +85 -15
- package/cjs/features/crosswalks/CrosswalkAttributes/CrosswalkAttributes.test.js +265 -193
- package/cjs/features/crosswalks/CrosswalkDateEditor/CrosswalkDateEditor.test.js +106 -12
- package/cjs/features/crosswalks/CrosswalkDragLayer/CrosswalkDragLayer.test.js +21 -9
- package/cjs/features/crosswalks/CrosswalkEditor/CrosswalkEditor.test.js +190 -90
- package/cjs/features/crosswalks/CrosswalkRow/CrosswalkRow.test.js +323 -225
- package/cjs/features/crosswalks/ShowDependentLink/ShowDependentLink.test.js +75 -12
- package/cjs/features/crosswalks/SourceCrosswalksRow/SourceCrosswalksRow.test.js +171 -138
- package/esm/UpSetChart/UpSetChart.d.ts +5 -8
- package/esm/UpSetChart/UpSetChart.js +38 -5
- package/esm/UpSetChart/UpSetChart.test.js +193 -0
- package/esm/UpSetChart/components/IntersectionsChart/IntersectionsChart.d.ts +15 -0
- package/esm/UpSetChart/components/IntersectionsChart/IntersectionsChart.js +39 -0
- package/esm/UpSetChart/components/IntersectionsChart/index.d.ts +1 -0
- package/esm/UpSetChart/components/IntersectionsChart/index.js +1 -0
- package/esm/UpSetChart/components/IntersectionsChart/styles.d.ts +1 -0
- package/esm/UpSetChart/components/IntersectionsChart/styles.js +29 -0
- package/esm/UpSetChart/components/IntersectionsChartAxis/IntersectionsChartAxis.d.ts +10 -0
- package/esm/UpSetChart/components/IntersectionsChartAxis/IntersectionsChartAxis.js +34 -0
- package/esm/UpSetChart/components/IntersectionsChartAxis/index.d.ts +1 -0
- package/esm/UpSetChart/components/IntersectionsChartAxis/index.js +1 -0
- package/esm/UpSetChart/components/IntersectionsChartAxis/styles.d.ts +1 -0
- package/esm/UpSetChart/components/IntersectionsChartAxis/styles.js +29 -0
- package/esm/UpSetChart/components/IntersectionsMatrix/IntersectionsMatrix.d.ts +13 -0
- package/esm/UpSetChart/components/IntersectionsMatrix/IntersectionsMatrix.js +26 -0
- package/esm/UpSetChart/components/IntersectionsMatrix/index.d.ts +1 -0
- package/esm/UpSetChart/components/IntersectionsMatrix/index.js +1 -0
- package/esm/UpSetChart/components/IntersectionsMatrix/styles.d.ts +1 -0
- package/esm/UpSetChart/components/IntersectionsMatrix/styles.js +24 -0
- package/esm/UpSetChart/components/SetsChart/SetsChart.d.ts +15 -0
- package/esm/UpSetChart/components/SetsChart/SetsChart.js +31 -0
- package/esm/UpSetChart/components/SetsChart/index.d.ts +1 -0
- package/esm/UpSetChart/components/SetsChart/index.js +1 -0
- package/esm/UpSetChart/components/SetsChart/styles.d.ts +1 -0
- package/esm/UpSetChart/components/SetsChart/styles.js +40 -0
- package/esm/UpSetChart/components/SetsChartAxis/SetsChartAxis.d.ts +6 -0
- package/esm/UpSetChart/components/SetsChartAxis/SetsChartAxis.js +13 -0
- package/esm/UpSetChart/components/SetsChartAxis/index.d.ts +1 -0
- package/esm/UpSetChart/components/SetsChartAxis/index.js +1 -0
- package/esm/UpSetChart/components/SetsChartAxis/styles.d.ts +1 -0
- package/esm/UpSetChart/components/SetsChartAxis/styles.js +14 -0
- package/esm/UpSetChart/constants.d.ts +16 -3
- package/esm/UpSetChart/constants.js +19 -3
- package/esm/UpSetChart/gameOfThrones.test-data.d.ts +4 -0
- package/esm/UpSetChart/gameOfThrones.test-data.js +23 -0
- package/esm/UpSetChart/helpers.d.ts +20 -0
- package/esm/UpSetChart/helpers.js +120 -0
- package/esm/UpSetChart/styles.d.ts +4 -1
- package/esm/UpSetChart/styles.js +11 -12
- package/esm/UpSetChart/types.d.ts +16 -0
- package/esm/UpSetChart/useUpSetChartSizes.d.ts +20 -0
- package/esm/UpSetChart/useUpSetChartSizes.js +30 -0
- package/esm/features/crosswalks/AttributesTable/AttributesTable.test-data.d.ts +36 -0
- package/esm/features/crosswalks/AttributesTable/AttributesTable.test-data.js +283 -0
- package/esm/features/crosswalks/AttributesTable/AttributesTable.test.js +711 -350
- package/esm/features/crosswalks/ColoredBlock/ColoredBlock.test.js +77 -15
- package/esm/features/crosswalks/CopyableValueField/CopyableValueField.test.js +85 -15
- package/esm/features/crosswalks/CrosswalkAttributes/CrosswalkAttributes.test.js +266 -194
- package/esm/features/crosswalks/CrosswalkDateEditor/CrosswalkDateEditor.test.js +106 -12
- package/esm/features/crosswalks/CrosswalkDragLayer/CrosswalkDragLayer.test.js +21 -9
- package/esm/features/crosswalks/CrosswalkEditor/CrosswalkEditor.test.js +190 -90
- package/esm/features/crosswalks/CrosswalkRow/CrosswalkRow.test.js +324 -226
- package/esm/features/crosswalks/ShowDependentLink/ShowDependentLink.test.js +75 -12
- package/esm/features/crosswalks/SourceCrosswalksRow/SourceCrosswalksRow.test.js +171 -138
- package/package.json +1 -1
- package/cjs/features/crosswalks/AttributesTable/IntegrationAttributesTable.test-data.d.ts +0 -3
- package/cjs/features/crosswalks/AttributesTable/IntegrationAttributesTable.test-data.js +0 -52
- package/cjs/features/crosswalks/AttributesTable/IntegrationAttributesTable.test.js +0 -323
- package/cjs/features/crosswalks/AttributesTable/components/AddAttributesButton/AddAttributesButton.test.js +0 -142
- package/cjs/features/crosswalks/AttributesTable/components/AttributeValuesRenderer/AttributeValuesRenderer.test.js +0 -146
- package/cjs/features/crosswalks/AttributesTable/components/AttributesHeadCellRenderer/AttributesHeadCellRenderer.test.d.ts +0 -1
- package/cjs/features/crosswalks/AttributesTable/components/AttributesHeadCellRenderer/AttributesHeadCellRenderer.test.js +0 -50
- package/cjs/features/crosswalks/AttributesTable/components/ConfirmEditIgnoredDialog/ConfirmEditIgnoredDialog.test.d.ts +0 -1
- package/cjs/features/crosswalks/AttributesTable/components/ConfirmEditIgnoredDialog/ConfirmEditIgnoredDialog.test.js +0 -58
- package/cjs/features/crosswalks/AttributesTable/components/CountRenderer/CountRenderer.test.d.ts +0 -1
- package/cjs/features/crosswalks/AttributesTable/components/CountRenderer/CountRenderer.test.js +0 -14
- package/cjs/features/crosswalks/AttributesTable/components/ImageAttributesRenderer/ImageAttributesRenderer.test.d.ts +0 -1
- package/cjs/features/crosswalks/AttributesTable/components/ImageAttributesRenderer/ImageAttributesRenderer.test.js +0 -110
- package/cjs/features/crosswalks/AttributesTable/components/NestedAttributesRenderer/NestedAttributesRenderer.test.d.ts +0 -1
- package/cjs/features/crosswalks/AttributesTable/components/NestedAttributesRenderer/NestedAttributesRenderer.test.js +0 -111
- package/cjs/features/crosswalks/AttributesTable/components/OvValuesRenderer/OvValuesRenderer.test.d.ts +0 -1
- package/cjs/features/crosswalks/AttributesTable/components/OvValuesRenderer/OvValuesRenderer.test.js +0 -67
- package/cjs/features/crosswalks/AttributesTable/components/ReferenceAttributesRenderer/ReferenceAttributesRenderer.test.d.ts +0 -1
- package/cjs/features/crosswalks/AttributesTable/components/ReferenceAttributesRenderer/ReferenceAttributesRenderer.test.js +0 -193
- package/cjs/features/crosswalks/AttributesTable/components/RuleTypeInfoButton/RuleTypeInfoButton.test.d.ts +0 -1
- package/cjs/features/crosswalks/AttributesTable/components/RuleTypeInfoButton/RuleTypeInfoButton.test.js +0 -22
- package/cjs/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.test.d.ts +0 -1
- package/cjs/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.test.js +0 -58
- package/cjs/features/crosswalks/AttributesTable/components/SimpleAttributesRenderer/SimpleAttributesRenderer.test.d.ts +0 -1
- package/cjs/features/crosswalks/AttributesTable/components/SimpleAttributesRenderer/SimpleAttributesRenderer.test.js +0 -69
- package/cjs/features/crosswalks/CrosswalkDateEditor/IntegrationCrosswalkDateEditor.test.d.ts +0 -1
- package/cjs/features/crosswalks/CrosswalkDateEditor/IntegrationCrosswalkDateEditor.test.js +0 -137
- package/cjs/features/crosswalks/CrosswalkDragLayer/components/CrosswalkDragPreview/CrosswalkDragPreview.test.d.ts +0 -1
- package/cjs/features/crosswalks/CrosswalkDragLayer/components/CrosswalkDragPreview/CrosswalkDragPreview.test.js +0 -56
- package/esm/features/crosswalks/AttributesTable/IntegrationAttributesTable.test-data.d.ts +0 -3
- package/esm/features/crosswalks/AttributesTable/IntegrationAttributesTable.test-data.js +0 -47
- package/esm/features/crosswalks/AttributesTable/IntegrationAttributesTable.test.d.ts +0 -1
- package/esm/features/crosswalks/AttributesTable/IntegrationAttributesTable.test.js +0 -318
- package/esm/features/crosswalks/AttributesTable/components/AddAttributesButton/AddAttributesButton.test.d.ts +0 -1
- package/esm/features/crosswalks/AttributesTable/components/AddAttributesButton/AddAttributesButton.test.js +0 -137
- package/esm/features/crosswalks/AttributesTable/components/AttributeValuesRenderer/AttributeValuesRenderer.test.d.ts +0 -1
- package/esm/features/crosswalks/AttributesTable/components/AttributeValuesRenderer/AttributeValuesRenderer.test.js +0 -141
- package/esm/features/crosswalks/AttributesTable/components/AttributesHeadCellRenderer/AttributesHeadCellRenderer.test.d.ts +0 -1
- package/esm/features/crosswalks/AttributesTable/components/AttributesHeadCellRenderer/AttributesHeadCellRenderer.test.js +0 -45
- package/esm/features/crosswalks/AttributesTable/components/ConfirmEditIgnoredDialog/ConfirmEditIgnoredDialog.test.d.ts +0 -1
- package/esm/features/crosswalks/AttributesTable/components/ConfirmEditIgnoredDialog/ConfirmEditIgnoredDialog.test.js +0 -53
- package/esm/features/crosswalks/AttributesTable/components/CountRenderer/CountRenderer.test.d.ts +0 -1
- package/esm/features/crosswalks/AttributesTable/components/CountRenderer/CountRenderer.test.js +0 -9
- package/esm/features/crosswalks/AttributesTable/components/ImageAttributesRenderer/ImageAttributesRenderer.test.d.ts +0 -1
- package/esm/features/crosswalks/AttributesTable/components/ImageAttributesRenderer/ImageAttributesRenderer.test.js +0 -105
- package/esm/features/crosswalks/AttributesTable/components/NestedAttributesRenderer/NestedAttributesRenderer.test.d.ts +0 -1
- package/esm/features/crosswalks/AttributesTable/components/NestedAttributesRenderer/NestedAttributesRenderer.test.js +0 -106
- package/esm/features/crosswalks/AttributesTable/components/OvValuesRenderer/OvValuesRenderer.test.d.ts +0 -1
- package/esm/features/crosswalks/AttributesTable/components/OvValuesRenderer/OvValuesRenderer.test.js +0 -62
- package/esm/features/crosswalks/AttributesTable/components/ReferenceAttributesRenderer/ReferenceAttributesRenderer.test.d.ts +0 -1
- package/esm/features/crosswalks/AttributesTable/components/ReferenceAttributesRenderer/ReferenceAttributesRenderer.test.js +0 -188
- package/esm/features/crosswalks/AttributesTable/components/RuleTypeInfoButton/RuleTypeInfoButton.test.d.ts +0 -1
- package/esm/features/crosswalks/AttributesTable/components/RuleTypeInfoButton/RuleTypeInfoButton.test.js +0 -17
- package/esm/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.test.d.ts +0 -1
- package/esm/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.test.js +0 -53
- package/esm/features/crosswalks/AttributesTable/components/SimpleAttributesRenderer/SimpleAttributesRenderer.test.d.ts +0 -1
- package/esm/features/crosswalks/AttributesTable/components/SimpleAttributesRenderer/SimpleAttributesRenderer.test.js +0 -64
- package/esm/features/crosswalks/CrosswalkDateEditor/IntegrationCrosswalkDateEditor.test.d.ts +0 -1
- package/esm/features/crosswalks/CrosswalkDateEditor/IntegrationCrosswalkDateEditor.test.js +0 -132
- package/esm/features/crosswalks/CrosswalkDragLayer/components/CrosswalkDragPreview/CrosswalkDragPreview.test.d.ts +0 -1
- package/esm/features/crosswalks/CrosswalkDragLayer/components/CrosswalkDragPreview/CrosswalkDragPreview.test.js +0 -28
- /package/cjs/{features/crosswalks/AttributesTable/IntegrationAttributesTable.test.d.ts → UpSetChart/UpSetChart.test.d.ts} +0 -0
- /package/{cjs/features/crosswalks/AttributesTable/components/AddAttributesButton/AddAttributesButton.test.d.ts → esm/UpSetChart/UpSetChart.test.d.ts} +0 -0
- /package/{cjs/features/crosswalks/AttributesTable/components/AttributeValuesRenderer/AttributeValuesRenderer.test.d.ts → esm/UpSetChart/types.js} +0 -0
|
@@ -10,421 +10,759 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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 };
|
|
18
47
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
if (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
});
|
|
29
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
-
if (mod && mod.__esModule) return mod;
|
|
31
|
-
var result = {};
|
|
32
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
-
__setModuleDefault(result, mod);
|
|
34
|
-
return result;
|
|
48
|
+
};
|
|
49
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
50
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
51
|
+
if (ar || !(i in from)) {
|
|
52
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
53
|
+
ar[i] = from[i];
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
35
57
|
};
|
|
36
58
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
59
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
60
|
};
|
|
39
61
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
62
|
var react_1 = __importDefault(require("react"));
|
|
41
|
-
var
|
|
42
|
-
var
|
|
43
|
-
var
|
|
44
|
-
var
|
|
45
|
-
var
|
|
46
|
-
var
|
|
47
|
-
var BasicViewHeader_1 = require("../../../BasicViewHeader");
|
|
48
|
-
var LinearLoadIndicator_1 = require("../../../LinearLoadIndicator");
|
|
49
|
-
var EmptyStub_1 = require("../../../EmptyStub");
|
|
63
|
+
var react_2 = require("@testing-library/react");
|
|
64
|
+
var user_event_1 = __importDefault(require("@testing-library/user-event"));
|
|
65
|
+
var react_dnd_1 = require("react-dnd");
|
|
66
|
+
var react_dnd_html5_backend_1 = __importDefault(require("react-dnd-html5-backend"));
|
|
67
|
+
var react_transition_group_1 = require("react-transition-group");
|
|
68
|
+
var test_utils_1 = require("../../../test-utils");
|
|
50
69
|
var MdmModuleContext_1 = require("../../../contexts/MdmModuleContext");
|
|
51
|
-
var
|
|
52
|
-
var helpers_1 = require("./helpers");
|
|
53
|
-
var AttributesFactory_1 = require("./components/AttributesFactory");
|
|
54
|
-
var OvValuesRenderer_1 = require("./components/OvValuesRenderer");
|
|
55
|
-
var RuleTypeRenderer_1 = require("./components/RuleTypeRenderer");
|
|
56
|
-
var ConfirmEditIgnoredDialog_1 = require("./components/ConfirmEditIgnoredDialog");
|
|
70
|
+
var AttributesTable_test_data_1 = require("./AttributesTable.test-data");
|
|
57
71
|
var AttributesTable_1 = __importDefault(require("./AttributesTable"));
|
|
58
|
-
jest.mock('
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
});
|
|
64
|
-
jest.mock('./components/OvValuesRenderer', function () { return ({
|
|
65
|
-
OvValuesRenderer: jest.fn()
|
|
66
|
-
}); });
|
|
67
|
-
jest.mock('./components/RuleTypeRenderer', function () { return ({
|
|
68
|
-
RuleTypeRenderer: jest.fn()
|
|
69
|
-
}); });
|
|
70
|
-
jest.mock('./components/ConfirmEditIgnoredDialog', function () { return ({
|
|
71
|
-
ConfirmEditIgnoredDialog: jest.fn()
|
|
72
|
-
}); });
|
|
73
|
-
jest.mock('../../../contexts/MdmModuleContext', function () { return (__assign(__assign({}, jest.requireActual('../../../contexts/MdmModuleContext')), { useMdmMetadata: jest.fn() })); });
|
|
74
|
-
describe('AttributesTable tests', function () {
|
|
75
|
-
var metadata = {
|
|
76
|
-
entityTypes: [
|
|
72
|
+
jest.mock('@reltio/mdm-sdk', function () { return (__assign(__assign({}, jest.requireActual('@reltio/mdm-sdk')), { debounce: function (x) { return x; } })); });
|
|
73
|
+
var visibleColumns = ['ovValues', 'values'];
|
|
74
|
+
var crosswalksMap = {
|
|
75
|
+
entity: {
|
|
76
|
+
'entities/01L2n5z/attributes/Boolean/5nmc3Cp': [
|
|
77
77
|
{
|
|
78
|
-
uri: 'configuration/entityTypes/HCP',
|
|
79
|
-
label: 'HCP',
|
|
80
78
|
attributes: [
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
hidden: true
|
|
99
|
-
}
|
|
100
|
-
]
|
|
79
|
+
'entities/01L2n5z/attributes/TextField/5noU1aB',
|
|
80
|
+
'entities/01L2n5z/attributes/Boolean/5nmc3Cp'
|
|
81
|
+
],
|
|
82
|
+
type: 'configuration/sources/Reltio',
|
|
83
|
+
uri: 'entities/01L2n5z/crosswalks/7F10sMx',
|
|
84
|
+
value: '01L2n5z'
|
|
85
|
+
}
|
|
86
|
+
],
|
|
87
|
+
'entities/01L2n5z/attributes/TextField/5noU1aB': [
|
|
88
|
+
{
|
|
89
|
+
attributes: [
|
|
90
|
+
'entities/01L2n5z/attributes/TextField/5noU1aB',
|
|
91
|
+
'entities/01L2n5z/attributes/Boolean/5nmc3Cp'
|
|
92
|
+
],
|
|
93
|
+
type: 'configuration/sources/Reltio',
|
|
94
|
+
uri: 'entities/01L2n5z/crosswalks/7F10sMx',
|
|
95
|
+
value: '01L2n5z'
|
|
101
96
|
}
|
|
102
97
|
]
|
|
98
|
+
},
|
|
99
|
+
relation: {}
|
|
100
|
+
};
|
|
101
|
+
var metadata = (0, AttributesTable_test_data_1.createMetadata)();
|
|
102
|
+
var defaultProps = {
|
|
103
|
+
entity: (0, AttributesTable_test_data_1.createEntity)(),
|
|
104
|
+
isLoading: false,
|
|
105
|
+
crosswalksMap: crosswalksMap,
|
|
106
|
+
visibleColumns: visibleColumns,
|
|
107
|
+
onChangeVisibleColumns: function () { },
|
|
108
|
+
readOnly: false,
|
|
109
|
+
onDelete: function () { },
|
|
110
|
+
onPin: function () { },
|
|
111
|
+
onIgnore: function () { },
|
|
112
|
+
onEdit: function () { },
|
|
113
|
+
onAdd: function () { },
|
|
114
|
+
selectedAttributeTypes: AttributesTable_test_data_1.selectedAttributeTypes,
|
|
115
|
+
onSelectAttributeTypes: function () { },
|
|
116
|
+
additionalHeaderItems: null,
|
|
117
|
+
className: 'className',
|
|
118
|
+
emptyTempAttributeUris: []
|
|
119
|
+
};
|
|
120
|
+
var setUp = function (props) {
|
|
121
|
+
var user = user_event_1.default.setup({ delay: null, skipHover: true });
|
|
122
|
+
var Providers = function (_a) {
|
|
123
|
+
var children = _a.children;
|
|
124
|
+
return (react_1.default.createElement(react_dnd_1.DndProvider, { backend: react_dnd_html5_backend_1.default },
|
|
125
|
+
react_1.default.createElement(MdmModuleContext_1.MdmModuleProvider, { values: { metadata: metadata } }, children)));
|
|
103
126
|
};
|
|
104
|
-
var
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
}
|
|
127
|
+
var renderer = (0, react_2.render)(react_1.default.createElement(AttributesTable_1.default, __assign({}, props)), { wrapper: Providers });
|
|
128
|
+
return __assign(__assign({}, renderer), { user: user });
|
|
129
|
+
};
|
|
130
|
+
describe('attribute table tests', function () {
|
|
131
|
+
var getRowByIndex = function (index) {
|
|
132
|
+
var fixHeadAndFirstColumnContainer = react_2.screen.queryByTestId('fix-head-and-fix-column-container');
|
|
133
|
+
return (0, react_2.within)(fixHeadAndFirstColumnContainer).queryAllByTestId("base-cell-".concat(index));
|
|
134
|
+
};
|
|
135
|
+
var getCellByIndexes = function (rowIndex, columnIndex) {
|
|
136
|
+
var row = getRowByIndex(rowIndex);
|
|
137
|
+
return row[columnIndex];
|
|
138
|
+
};
|
|
139
|
+
var editTextFieldAttribute = function (user_1) {
|
|
140
|
+
var args_1 = [];
|
|
141
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
142
|
+
args_1[_i - 1] = arguments[_i];
|
|
143
|
+
}
|
|
144
|
+
return __awaiter(void 0, __spreadArray([user_1], args_1, true), void 0, function (user, valueIndex) {
|
|
145
|
+
var attribute;
|
|
146
|
+
if (valueIndex === void 0) { valueIndex = 0; }
|
|
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-".concat(valueIndex));
|
|
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*/];
|
|
145
167
|
}
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
};
|
|
171
|
+
var checkBasicTableElements = function () {
|
|
172
|
+
expect(react_2.screen.getByText('Sources')).toBeInTheDocument();
|
|
173
|
+
expect(react_2.screen.getByLabelText('Show/hide columns')).toBeInTheDocument();
|
|
174
|
+
expect(react_2.screen.getByText('Attributes & OV')).toBeInTheDocument();
|
|
175
|
+
expect(react_2.screen.getByText('Attribute values')).toBeInTheDocument();
|
|
176
|
+
expect(react_2.screen.getByText('Winner source systems')).toBeInTheDocument();
|
|
177
|
+
expect(react_2.screen.getByText('Rule type')).toBeInTheDocument();
|
|
178
|
+
expect(react_2.screen.getByText('Count')).toBeInTheDocument();
|
|
179
|
+
expect(react_2.screen.getByText('Count')).toBeInTheDocument();
|
|
180
|
+
expect(react_2.screen.getByText('Attribute values')).toBeInTheDocument();
|
|
181
|
+
};
|
|
182
|
+
var checkDefaultAttributes = function () {
|
|
183
|
+
expect((0, react_2.within)(getCellByIndexes(0, 0)).getByText('String Label')).toBeInTheDocument();
|
|
184
|
+
expect((0, react_2.within)(getCellByIndexes(0, 0)).getByText('text field value')).toBeInTheDocument();
|
|
185
|
+
expect((0, react_2.within)(getCellByIndexes(0, 0)).queryByText('another text value')).not.toBeInTheDocument();
|
|
186
|
+
expect((0, react_2.within)(getCellByIndexes(0, 1)).getByText('Reltio')).toBeInTheDocument();
|
|
187
|
+
expect((0, react_2.within)(getCellByIndexes(0, 2)).getByText('Recency')).toBeInTheDocument();
|
|
188
|
+
expect((0, react_2.within)(getCellByIndexes(0, 3)).getByText('2')).toBeInTheDocument();
|
|
189
|
+
expect((0, react_2.within)(getCellByIndexes(0, 4)).getByText('text field value')).toBeInTheDocument();
|
|
190
|
+
expect((0, react_2.within)(getCellByIndexes(0, 4)).getByText('another text value')).toBeInTheDocument();
|
|
191
|
+
expect((0, react_2.within)((0, react_2.within)(getCellByIndexes(0, 4)).getByTestId('value-index-1')).getByTestId('SvgIgnored')).toBeInTheDocument();
|
|
192
|
+
expect((0, react_2.within)(getCellByIndexes(1, 0)).getByText('Boolean')).toBeInTheDocument();
|
|
193
|
+
expect((0, react_2.within)(getCellByIndexes(1, 0)).getByText('Yes')).toBeInTheDocument();
|
|
194
|
+
expect((0, react_2.within)(getCellByIndexes(1, 1)).getByText('Reltio')).toBeInTheDocument();
|
|
195
|
+
expect((0, react_2.within)(getCellByIndexes(1, 2)).getByText('Frequency')).toBeInTheDocument();
|
|
196
|
+
expect((0, react_2.within)(getCellByIndexes(1, 3)).getByText('1')).toBeInTheDocument();
|
|
197
|
+
expect((0, react_2.within)(getCellByIndexes(1, 4)).getByText('Yes')).toBeInTheDocument();
|
|
198
|
+
expect((0, react_2.within)(getCellByIndexes(2, 0)).getByText('Nested attribute')).toBeInTheDocument();
|
|
199
|
+
expect((0, react_2.within)(getCellByIndexes(2, 0)).getByText('Nested Label')).toBeInTheDocument();
|
|
200
|
+
expect((0, react_2.within)(getCellByIndexes(2, 1)).queryByText(/./)).not.toBeInTheDocument();
|
|
201
|
+
expect((0, react_2.within)(getCellByIndexes(2, 2)).getByText('Source system')).toBeInTheDocument();
|
|
202
|
+
expect((0, react_2.within)(getCellByIndexes(2, 3)).getByText('1')).toBeInTheDocument();
|
|
203
|
+
expect((0, react_2.within)(getCellByIndexes(2, 4)).getByText('Nested Label')).toBeInTheDocument();
|
|
204
|
+
expect((0, react_2.within)(getCellByIndexes(3, 0)).getByText('Address')).toBeInTheDocument();
|
|
205
|
+
expect((0, react_2.within)(getCellByIndexes(3, 0)).getByText('Reference Address')).toBeInTheDocument();
|
|
206
|
+
expect((0, react_2.within)(getCellByIndexes(3, 0)).getByText('new address')).toBeInTheDocument();
|
|
207
|
+
expect((0, react_2.within)(getCellByIndexes(3, 1)).queryByText(/./)).not.toBeInTheDocument();
|
|
208
|
+
expect((0, react_2.within)(getCellByIndexes(3, 2)).getByText('Minimum value')).toBeInTheDocument();
|
|
209
|
+
expect((0, react_2.within)(getCellByIndexes(3, 3)).getByText('1')).toBeInTheDocument();
|
|
210
|
+
expect((0, react_2.within)(getCellByIndexes(3, 4)).getByText('Reference Address')).toBeInTheDocument();
|
|
211
|
+
expect((0, react_2.within)(getCellByIndexes(3, 4)).getByText('new address')).toBeInTheDocument();
|
|
212
|
+
expect((0, react_2.within)(getCellByIndexes(4, 0)).getByText('Image Gallery')).toBeInTheDocument();
|
|
213
|
+
expect((0, react_2.within)(getCellByIndexes(4, 1)).queryByText(/./)).not.toBeInTheDocument();
|
|
214
|
+
expect((0, react_2.within)(getCellByIndexes(4, 2)).getByText('Other Attribute Winner Crosswalk')).toBeInTheDocument();
|
|
215
|
+
expect((0, react_2.within)(getCellByIndexes(4, 3)).getByText('1')).toBeInTheDocument();
|
|
216
|
+
expect((0, react_2.within)(getCellByIndexes(4, 4)).getByRole('img')).toHaveAttribute('src', 'https://s3.amazonaws.com/reltio.qa.ih/thumbnailInew/5iWrjreLxiT2avDKoX3fQmqCu.png');
|
|
178
217
|
};
|
|
179
|
-
var COLUMNS_DATA_MOCK = [
|
|
180
|
-
{ id: '1', label: 'col 1' },
|
|
181
|
-
{ id: '2', label: 'col 2' }
|
|
182
|
-
];
|
|
183
|
-
var ROWS_DATA_MOCK = [{ 1: 'col 1 row 1', 2: 'col 2 row 2' }];
|
|
184
218
|
beforeAll(function () {
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
jest.spyOn(AttributesFactory_1.AttributesFactory, 'build').mockReturnValue(null);
|
|
219
|
+
react_transition_group_1.config.disabled = true;
|
|
220
|
+
});
|
|
221
|
+
afterAll(function () {
|
|
222
|
+
react_transition_group_1.config.disabled = false;
|
|
190
223
|
});
|
|
191
224
|
afterEach(function () {
|
|
192
225
|
jest.clearAllMocks();
|
|
193
226
|
});
|
|
194
|
-
it('should render basic table correctly', function () {
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
227
|
+
it('should render basic table correctly', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
228
|
+
var unmockTableSizing;
|
|
229
|
+
return __generator(this, function (_a) {
|
|
230
|
+
unmockTableSizing = (0, test_utils_1.mockBasicTableSizing)();
|
|
231
|
+
setUp(__assign(__assign({}, defaultProps), { visibleColumns: ['ovValues', 'values', 'ruleType', 'count', 'winnerSources'] }));
|
|
232
|
+
expect(react_2.screen.getByText('Attribute')).toBeInTheDocument();
|
|
233
|
+
expect(react_2.screen.queryByTestId('reltio-linear-load-indicator')).not.toBeInTheDocument();
|
|
234
|
+
checkBasicTableElements();
|
|
235
|
+
checkDefaultAttributes();
|
|
236
|
+
unmockTableSizing();
|
|
237
|
+
return [2 /*return*/];
|
|
202
238
|
});
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
239
|
+
}); });
|
|
240
|
+
it('should render basic table correctly in readOnly mode', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
241
|
+
var unmockTableSizing, user, attribute;
|
|
242
|
+
return __generator(this, function (_a) {
|
|
243
|
+
switch (_a.label) {
|
|
244
|
+
case 0:
|
|
245
|
+
unmockTableSizing = (0, test_utils_1.mockBasicTableSizing)();
|
|
246
|
+
user = setUp(__assign(__assign({}, defaultProps), { visibleColumns: ['ovValues', 'values', 'ruleType', 'count', 'winnerSources'], readOnly: true })).user;
|
|
247
|
+
expect(react_2.screen.queryByText('Attribute')).not.toBeInTheDocument();
|
|
248
|
+
checkBasicTableElements();
|
|
249
|
+
checkDefaultAttributes();
|
|
250
|
+
attribute = (0, react_2.within)(getCellByIndexes(0, 4)).getByTestId('value-index-0');
|
|
251
|
+
return [4 /*yield*/, user.hover(attribute)];
|
|
252
|
+
case 1:
|
|
253
|
+
_a.sent();
|
|
254
|
+
return [4 /*yield*/, user.click((0, react_2.within)(attribute).queryByRole('button', { name: 'More actions' }))];
|
|
255
|
+
case 2:
|
|
256
|
+
_a.sent();
|
|
257
|
+
expect(react_2.screen.getByRole('menuitem', { name: 'Edit' })).toHaveClass('Mui-disabled');
|
|
258
|
+
expect(react_2.screen.getByRole('menuitem', { name: 'Delete' })).toHaveClass('Mui-disabled');
|
|
259
|
+
unmockTableSizing();
|
|
260
|
+
return [2 /*return*/];
|
|
261
|
+
}
|
|
262
|
+
});
|
|
263
|
+
}); });
|
|
210
264
|
it('should show linear loader correctly', function () {
|
|
211
|
-
|
|
212
|
-
expect(
|
|
213
|
-
wrapper.setProps({ isLoading: true });
|
|
214
|
-
expect(wrapper.find(LinearLoadIndicator_1.LinearLoadIndicator).length).toBe(1);
|
|
265
|
+
setUp(__assign(__assign({}, defaultProps), { isLoading: true }));
|
|
266
|
+
expect(react_2.screen.getByTestId('reltio-linear-load-indicator')).toBeInTheDocument();
|
|
215
267
|
});
|
|
216
268
|
it('should select initial attribute types when props.selectedAttributeTypes is nil', function () {
|
|
217
|
-
var
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
expect(props.onSelectAttributeTypes).toHaveBeenCalledTimes(1);
|
|
221
|
-
expect(props.onSelectAttributeTypes).toHaveBeenCalledWith([
|
|
269
|
+
var onSelectAttributeTypes = jest.fn();
|
|
270
|
+
setUp(__assign(__assign({}, defaultProps), { onSelectAttributeTypes: onSelectAttributeTypes, selectedAttributeTypes: undefined }));
|
|
271
|
+
expect(onSelectAttributeTypes).toHaveBeenCalledWith([
|
|
222
272
|
{
|
|
223
|
-
label: '
|
|
224
|
-
name: '
|
|
273
|
+
label: 'Boolean',
|
|
274
|
+
name: 'Boolean',
|
|
275
|
+
type: 'Boolean',
|
|
276
|
+
uri: 'configuration/entityTypes/HCP/attributes/Boolean'
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
label: 'String Label',
|
|
280
|
+
name: 'TextField',
|
|
225
281
|
type: 'String',
|
|
226
|
-
uri: 'configuration/entityTypes/HCP/attributes/
|
|
282
|
+
uri: 'configuration/entityTypes/HCP/attributes/TextField'
|
|
227
283
|
},
|
|
228
284
|
{
|
|
229
|
-
label: '
|
|
230
|
-
name: '
|
|
231
|
-
type: '
|
|
232
|
-
uri: 'configuration/entityTypes/HCP/attributes/
|
|
285
|
+
label: 'Nested attribute',
|
|
286
|
+
name: 'DeepNested',
|
|
287
|
+
type: 'Nested',
|
|
288
|
+
uri: 'configuration/entityTypes/HCP/attributes/DeepNested'
|
|
233
289
|
}
|
|
234
290
|
]);
|
|
235
291
|
});
|
|
236
292
|
it('should not render rows if entity is undefined', function () {
|
|
237
|
-
var
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
expect(columnsSettings.prop('columnsData')).toEqual(helpers_1.COLUMNS_DATA);
|
|
245
|
-
var nextVisibleColumns = helpers_1.DEFAULT_VISIBLE_COLUMNS.slice(0, -1);
|
|
246
|
-
(0, test_utils_1.act)(function () {
|
|
247
|
-
columnsSettings.prop('onChangeColumns')(nextVisibleColumns);
|
|
248
|
-
});
|
|
249
|
-
expect(props.onChangeVisibleColumns).toHaveBeenCalledWith(nextVisibleColumns);
|
|
250
|
-
wrapper.setProps({ visibleColumns: nextVisibleColumns });
|
|
251
|
-
expect(wrapper.find(ColumnsSettings_1.ColumnsSettings).prop('selectedColumns')).toEqual(nextVisibleColumns);
|
|
252
|
-
expect(wrapper
|
|
253
|
-
.find(BasicTable_1.BasicTable)
|
|
254
|
-
.prop('columnsData')
|
|
255
|
-
.map(function (_a) {
|
|
256
|
-
var id = _a.id;
|
|
257
|
-
return id;
|
|
258
|
-
})).toEqual(nextVisibleColumns);
|
|
259
|
-
});
|
|
260
|
-
it('should pass props.onPin to AttributeValuesRenderer', function () {
|
|
261
|
-
var wrapper = (0, enzyme_1.mount)(react_1.default.createElement(AttributesTable_1.default, __assign({}, props)));
|
|
262
|
-
var onPin = wrapper.find('AttributeValuesRenderer').at(0).prop('onPin');
|
|
263
|
-
expect(onPin).toBe(props.onPin);
|
|
293
|
+
var unmockTableSizing = (0, test_utils_1.mockBasicTableSizing)();
|
|
294
|
+
setUp(__assign(__assign({}, defaultProps), { entity: undefined }));
|
|
295
|
+
expect(react_2.screen.queryByText(AttributesTable_test_data_1.selectedAttributeTypes[0].label)).not.toBeInTheDocument();
|
|
296
|
+
expect(react_2.screen.queryByText(AttributesTable_test_data_1.selectedAttributeTypes[1].label)).not.toBeInTheDocument();
|
|
297
|
+
expect(react_2.screen.queryByText('text field value')).not.toBeInTheDocument();
|
|
298
|
+
expect(react_2.screen.queryByText('Yes')).not.toBeInTheDocument();
|
|
299
|
+
unmockTableSizing();
|
|
264
300
|
});
|
|
265
|
-
it('should
|
|
266
|
-
var
|
|
267
|
-
|
|
268
|
-
expect(
|
|
301
|
+
it('should render default columns', function () {
|
|
302
|
+
var unmockTableSizing = (0, test_utils_1.mockBasicTableSizing)();
|
|
303
|
+
setUp(__assign(__assign({}, defaultProps), { visibleColumns: undefined }));
|
|
304
|
+
expect(react_2.screen.getByText('Rule type')).toBeInTheDocument();
|
|
305
|
+
expect((0, react_2.within)(react_2.screen.getAllByTestId('column-name-ruleType')[0]).getByText('Recency')).toBeInTheDocument();
|
|
306
|
+
expect((0, react_2.within)(react_2.screen.getAllByTestId('column-name-ruleType')[1]).getByText('Frequency')).toBeInTheDocument();
|
|
307
|
+
expect((0, react_2.within)(react_2.screen.getAllByTestId('column-name-ruleType')[2]).getByText('Source system')).toBeInTheDocument();
|
|
308
|
+
unmockTableSizing();
|
|
269
309
|
});
|
|
270
|
-
it('should
|
|
271
|
-
var
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
.find(Button_1.default)
|
|
289
|
-
.filterWhere(function (button) { return button.text() === 'Yes'; })
|
|
290
|
-
.find('button')
|
|
291
|
-
.simulate('click');
|
|
292
|
-
});
|
|
293
|
-
wrapper.update();
|
|
294
|
-
expect(wrapper.find('ConfirmDeleteDialog').prop('open')).toBe(false);
|
|
295
|
-
expect(props.onDelete).toHaveBeenCalledWith(deleteEvent);
|
|
296
|
-
});
|
|
297
|
-
it('should not call props.onDelete without confirmation on attribute delete', function () {
|
|
298
|
-
var _a, _b;
|
|
299
|
-
var wrapper = (0, enzyme_1.mount)(react_1.default.createElement(AttributesTable_1.default, __assign({}, props)));
|
|
300
|
-
expect(wrapper.find('ConfirmDeleteDialog').prop('open')).toBe(false);
|
|
301
|
-
var onDelete = wrapper.find('AttributeValuesRenderer').at(0).prop('onDelete');
|
|
302
|
-
var deleteEvent = {
|
|
303
|
-
attributeValue: (_b = (_a = props.entity) === null || _a === void 0 ? void 0 : _a.attributes) === null || _b === void 0 ? void 0 : _b['CountryCode'][0],
|
|
304
|
-
attributeType: metadata.entityTypes[0].attributes[0],
|
|
305
|
-
crosswalks: []
|
|
306
|
-
};
|
|
307
|
-
(0, test_utils_1.act)(function () {
|
|
308
|
-
onDelete(deleteEvent);
|
|
309
|
-
});
|
|
310
|
-
wrapper.update();
|
|
311
|
-
expect(wrapper.find('ConfirmDeleteDialog').prop('open')).toBe(true);
|
|
312
|
-
(0, test_utils_1.act)(function () {
|
|
313
|
-
wrapper
|
|
314
|
-
.find('ConfirmDeleteDialog')
|
|
315
|
-
.find(Button_1.default)
|
|
316
|
-
.filterWhere(function (button) { return button.text() === 'No'; })
|
|
317
|
-
.find('button')
|
|
318
|
-
.simulate('click');
|
|
319
|
-
});
|
|
320
|
-
wrapper.update();
|
|
321
|
-
expect(wrapper.find('ConfirmDeleteDialog').prop('open')).toBe(false);
|
|
322
|
-
expect(props.onDelete).not.toHaveBeenCalled();
|
|
323
|
-
});
|
|
324
|
-
it('should call props.onEdit on not ignored attribute edit', function () {
|
|
325
|
-
var _a, _b;
|
|
326
|
-
var wrapper = (0, enzyme_1.mount)(react_1.default.createElement(AttributesTable_1.default, __assign({}, props)));
|
|
327
|
-
var onEdit = wrapper.find('AttributeValuesRenderer').at(0).prop('onEdit');
|
|
328
|
-
var editEvent = {
|
|
329
|
-
attributeValue: __assign(__assign({}, (_b = (_a = props.entity) === null || _a === void 0 ? void 0 : _a.attributes) === null || _b === void 0 ? void 0 : _b['CountryCode'][0]), { value: 'Russisa', lookupCode: 'RU' }),
|
|
330
|
-
attributeType: metadata.entityTypes[0].attributes[0],
|
|
331
|
-
crosswalk: {
|
|
332
|
-
uri: 'entities/1/crosswalks/1',
|
|
333
|
-
type: 'configuration/sources/Reltio',
|
|
334
|
-
value: 'cw1'
|
|
310
|
+
it('should render Source sequence after clicking view details button', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
311
|
+
var unmockTableSizing, user;
|
|
312
|
+
return __generator(this, function (_a) {
|
|
313
|
+
switch (_a.label) {
|
|
314
|
+
case 0:
|
|
315
|
+
unmockTableSizing = (0, test_utils_1.mockBasicTableSizing)();
|
|
316
|
+
user = setUp(__assign(__assign({}, defaultProps), { visibleColumns: undefined })).user;
|
|
317
|
+
return [4 /*yield*/, user.click(react_2.screen.getAllByRole('button', { name: 'View details' })[0])];
|
|
318
|
+
case 1:
|
|
319
|
+
_a.sent();
|
|
320
|
+
expect((0, react_2.within)(react_2.screen.getByRole('presentation')).getByText('Source sequence')).toBeInTheDocument();
|
|
321
|
+
expect((0, react_2.within)(react_2.screen.getByRole('presentation')).getByText('Reltio')).toBeInTheDocument();
|
|
322
|
+
return [4 /*yield*/, user.click((0, react_2.within)(react_2.screen.getByRole('presentation')).getByRole('button'))];
|
|
323
|
+
case 2:
|
|
324
|
+
_a.sent();
|
|
325
|
+
expect(react_2.screen.queryByText('Source sequence')).not.toBeInTheDocument();
|
|
326
|
+
unmockTableSizing();
|
|
327
|
+
return [2 /*return*/];
|
|
335
328
|
}
|
|
336
|
-
};
|
|
337
|
-
(0, test_utils_1.act)(function () {
|
|
338
|
-
onEdit(editEvent);
|
|
339
329
|
});
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
330
|
+
}); });
|
|
331
|
+
it('should call onChangeVisibleColumns on change columns', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
332
|
+
var onChangeVisibleColumns, user;
|
|
333
|
+
return __generator(this, function (_a) {
|
|
334
|
+
switch (_a.label) {
|
|
335
|
+
case 0:
|
|
336
|
+
onChangeVisibleColumns = jest.fn();
|
|
337
|
+
user = setUp(__assign(__assign({}, defaultProps), { onChangeVisibleColumns: onChangeVisibleColumns })).user;
|
|
338
|
+
return [4 /*yield*/, user.click(react_2.screen.getByLabelText('Show/hide columns'))];
|
|
339
|
+
case 1:
|
|
340
|
+
_a.sent();
|
|
341
|
+
return [4 /*yield*/, user.click(react_2.screen.getByText('Winner source systems'))];
|
|
342
|
+
case 2:
|
|
343
|
+
_a.sent();
|
|
344
|
+
expect(onChangeVisibleColumns).toHaveBeenCalledWith(['ovValues', 'values', 'winnerSources']);
|
|
345
|
+
return [2 /*return*/];
|
|
354
346
|
}
|
|
355
|
-
};
|
|
356
|
-
(0, test_utils_1.act)(function () {
|
|
357
|
-
onEdit(editEvent);
|
|
358
347
|
});
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
348
|
+
}); });
|
|
349
|
+
it.skip('should drag and drop rows correctly', function () {
|
|
350
|
+
jest.useFakeTimers();
|
|
351
|
+
var unmockTableSizing = (0, test_utils_1.mockBasicTableSizing)();
|
|
352
|
+
var onSelectAttributeTypes = jest.fn();
|
|
353
|
+
var props = __assign(__assign({}, defaultProps), { onSelectAttributeTypes: onSelectAttributeTypes });
|
|
354
|
+
setUp(props);
|
|
355
|
+
expect((0, react_2.within)(getCellByIndexes(1, 0)).queryByText('Yes')).toBeInTheDocument();
|
|
356
|
+
expect((0, react_2.within)(getCellByIndexes(1, 0)).queryByText('Boolean')).toBeInTheDocument();
|
|
357
|
+
expect((0, react_2.within)(getCellByIndexes(1, 1)).queryByText('Yes')).toBeInTheDocument();
|
|
358
|
+
expect((0, react_2.within)(getCellByIndexes(0, 0)).queryByText('text field value')).toBeInTheDocument();
|
|
359
|
+
expect((0, react_2.within)(getCellByIndexes(0, 0)).queryByText('<h1>String</h1>')).toBeInTheDocument();
|
|
360
|
+
expect((0, react_2.within)(getCellByIndexes(0, 1)).queryByText('text field value')).toBeInTheDocument();
|
|
361
|
+
var dragIndicator = getCellByIndexes(0, 0).querySelector('.dragIndicator');
|
|
362
|
+
react_2.fireEvent.dragStart(dragIndicator);
|
|
363
|
+
jest.runAllTimers();
|
|
364
|
+
expect((0, react_2.within)(getCellByIndexes(1, 0)).queryByText('Yes')).not.toBeInTheDocument();
|
|
365
|
+
expect((0, react_2.within)(getCellByIndexes(1, 0)).queryByText('Boolean')).toBeInTheDocument();
|
|
366
|
+
expect((0, react_2.within)(getCellByIndexes(1, 1)).queryByText('Yes')).not.toBeInTheDocument();
|
|
367
|
+
expect((0, react_2.within)(getCellByIndexes(0, 0)).queryByText('text field value')).not.toBeInTheDocument();
|
|
368
|
+
expect((0, react_2.within)(getCellByIndexes(0, 0)).queryByText('<h1>String</h1>')).toBeInTheDocument();
|
|
369
|
+
expect((0, react_2.within)(getCellByIndexes(0, 1)).queryByText('text field value')).not.toBeInTheDocument();
|
|
370
|
+
var dropRow = getCellByIndexes(1, 0);
|
|
371
|
+
react_2.fireEvent.dragEnter(dropRow);
|
|
372
|
+
expect((0, react_2.within)(getCellByIndexes(0, 0)).queryByText('Boolean')).toBeInTheDocument();
|
|
373
|
+
expect((0, react_2.within)(getCellByIndexes(1, 0)).queryByText('<h1>String</h1>')).toBeInTheDocument();
|
|
374
|
+
react_2.fireEvent.dragEnd(dropRow);
|
|
375
|
+
expect(onSelectAttributeTypes).toHaveBeenCalledWith([AttributesTable_test_data_1.selectedAttributeTypes[1], AttributesTable_test_data_1.selectedAttributeTypes[0]]);
|
|
376
|
+
unmockTableSizing();
|
|
362
377
|
});
|
|
363
|
-
it('should
|
|
364
|
-
var
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
378
|
+
it('should pin and ignore attributes', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
379
|
+
var unmockTableSizing, onPin, onIgnore, props, user, attribute, pinButton, ignoreButton;
|
|
380
|
+
return __generator(this, function (_a) {
|
|
381
|
+
switch (_a.label) {
|
|
382
|
+
case 0:
|
|
383
|
+
unmockTableSizing = (0, test_utils_1.mockBasicTableSizing)();
|
|
384
|
+
onPin = jest.fn();
|
|
385
|
+
onIgnore = jest.fn();
|
|
386
|
+
props = __assign(__assign({}, defaultProps), { onPin: onPin, onIgnore: onIgnore });
|
|
387
|
+
user = setUp(props).user;
|
|
388
|
+
attribute = (0, react_2.within)(getCellByIndexes(0, 1)).getByTestId('value-index-0');
|
|
389
|
+
return [4 /*yield*/, user.hover(attribute)];
|
|
390
|
+
case 1:
|
|
391
|
+
_a.sent();
|
|
392
|
+
pinButton = (0, react_2.within)(attribute).getByLabelText('Pin').querySelector('button');
|
|
393
|
+
ignoreButton = (0, react_2.within)(attribute).getByLabelText('Ignore').querySelector('button');
|
|
394
|
+
return [4 /*yield*/, user.click(pinButton)];
|
|
395
|
+
case 2:
|
|
396
|
+
_a.sent();
|
|
397
|
+
expect(onPin).toHaveBeenCalled();
|
|
398
|
+
return [4 /*yield*/, user.click(ignoreButton)];
|
|
399
|
+
case 3:
|
|
400
|
+
_a.sent();
|
|
401
|
+
expect(onIgnore).toHaveBeenCalled();
|
|
402
|
+
unmockTableSizing();
|
|
403
|
+
return [2 /*return*/];
|
|
374
404
|
}
|
|
375
|
-
};
|
|
376
|
-
(0, test_utils_1.act)(function () {
|
|
377
|
-
onEdit(editEvent);
|
|
378
405
|
});
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
406
|
+
}); });
|
|
407
|
+
it('should pin and ignore auto generated attributes', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
408
|
+
var unmockTableSizing, onPin, onIgnore, selectedAttributeTypes, props, user, attribute, pinButton, ignoreButton;
|
|
409
|
+
return __generator(this, function (_a) {
|
|
410
|
+
switch (_a.label) {
|
|
411
|
+
case 0:
|
|
412
|
+
unmockTableSizing = (0, test_utils_1.mockBasicTableSizing)();
|
|
413
|
+
onPin = jest.fn();
|
|
414
|
+
onIgnore = jest.fn();
|
|
415
|
+
selectedAttributeTypes = [
|
|
416
|
+
{
|
|
417
|
+
description: 'Yes or No',
|
|
418
|
+
label: 'Boolean',
|
|
419
|
+
name: 'Boolean',
|
|
420
|
+
type: 'Boolean',
|
|
421
|
+
uri: 'configuration/entityTypes/HCP/attributes/Boolean',
|
|
422
|
+
autoGenerated: true
|
|
423
|
+
}
|
|
424
|
+
];
|
|
425
|
+
props = __assign(__assign({}, defaultProps), { selectedAttributeTypes: selectedAttributeTypes, onPin: onPin, onIgnore: onIgnore });
|
|
426
|
+
user = setUp(props).user;
|
|
427
|
+
attribute = (0, react_2.within)(getCellByIndexes(0, 1)).getByTestId('value-index-0');
|
|
428
|
+
return [4 /*yield*/, user.hover(attribute)];
|
|
429
|
+
case 1:
|
|
430
|
+
_a.sent();
|
|
431
|
+
pinButton = (0, react_2.within)(attribute).getByLabelText('Pin').querySelector('button');
|
|
432
|
+
ignoreButton = (0, react_2.within)(attribute).getByLabelText('Ignore').querySelector('button');
|
|
433
|
+
expect((0, react_2.within)(attribute).queryByRole('button', { name: 'More actions' })).not.toBeInTheDocument();
|
|
434
|
+
return [4 /*yield*/, user.click(pinButton)];
|
|
435
|
+
case 2:
|
|
436
|
+
_a.sent();
|
|
437
|
+
expect(onPin).toHaveBeenCalled();
|
|
438
|
+
return [4 /*yield*/, user.click(ignoreButton)];
|
|
439
|
+
case 3:
|
|
440
|
+
_a.sent();
|
|
441
|
+
expect(onIgnore).toHaveBeenCalled();
|
|
442
|
+
unmockTableSizing();
|
|
443
|
+
return [2 /*return*/];
|
|
395
444
|
}
|
|
396
|
-
};
|
|
397
|
-
(0, test_utils_1.act)(function () {
|
|
398
|
-
onEdit(editEvent);
|
|
399
445
|
});
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
446
|
+
}); });
|
|
447
|
+
describe('Edit attributes', function () {
|
|
448
|
+
it('should edit attributes', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
449
|
+
var unmockTableSizing, entity, onEdit, props, user;
|
|
450
|
+
return __generator(this, function (_a) {
|
|
451
|
+
switch (_a.label) {
|
|
452
|
+
case 0:
|
|
453
|
+
unmockTableSizing = (0, test_utils_1.mockBasicTableSizing)();
|
|
454
|
+
entity = (0, AttributesTable_test_data_1.createEntity)();
|
|
455
|
+
onEdit = jest.fn();
|
|
456
|
+
props = __assign(__assign({}, defaultProps), { onEdit: onEdit });
|
|
457
|
+
user = setUp(props).user;
|
|
458
|
+
return [4 /*yield*/, editTextFieldAttribute(user)];
|
|
459
|
+
case 1:
|
|
460
|
+
_a.sent();
|
|
461
|
+
expect(onEdit).toHaveBeenCalledWith({
|
|
462
|
+
attributeType: AttributesTable_test_data_1.selectedAttributeTypes[0],
|
|
463
|
+
attributeValue: __assign(__assign({}, entity.attributes.TextField[0]), { value: 'text field value newValue' }),
|
|
464
|
+
crosswalk: crosswalksMap.entity['entities/01L2n5z/attributes/TextField/5noU1aB'][0]
|
|
465
|
+
});
|
|
466
|
+
unmockTableSizing();
|
|
467
|
+
return [2 /*return*/];
|
|
468
|
+
}
|
|
469
|
+
});
|
|
470
|
+
}); });
|
|
471
|
+
it('should show confirmation dialog on edit ignored attributes', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
472
|
+
var unmockTableSizing, props, user;
|
|
473
|
+
return __generator(this, function (_a) {
|
|
474
|
+
switch (_a.label) {
|
|
475
|
+
case 0:
|
|
476
|
+
unmockTableSizing = (0, test_utils_1.mockBasicTableSizing)();
|
|
477
|
+
props = __assign({}, defaultProps);
|
|
478
|
+
user = setUp(props).user;
|
|
479
|
+
return [4 /*yield*/, editTextFieldAttribute(user, 1)];
|
|
480
|
+
case 1:
|
|
481
|
+
_a.sent();
|
|
482
|
+
expect(react_2.screen.getByText('You are attempting to change a value that is presently ignored.')).toBeInTheDocument();
|
|
483
|
+
expect(react_2.screen.getByText('Please choose an option:')).toBeInTheDocument();
|
|
484
|
+
expect(react_2.screen.getByText('Save without Ignore')).toBeInTheDocument();
|
|
485
|
+
expect(react_2.screen.getByText('Save and apply Ignore to new value')).toBeInTheDocument();
|
|
486
|
+
expect(react_2.screen.getByText('Ok')).toBeInTheDocument();
|
|
487
|
+
expect(react_2.screen.getByText('Cancel')).toBeInTheDocument();
|
|
488
|
+
return [4 /*yield*/, user.click(react_2.screen.getByText('Cancel'))];
|
|
489
|
+
case 2:
|
|
490
|
+
_a.sent();
|
|
491
|
+
expect(react_2.screen.queryByText('You are attempting to change a value that is presently ignored.')).not.toBeInTheDocument();
|
|
492
|
+
unmockTableSizing();
|
|
493
|
+
return [2 /*return*/];
|
|
494
|
+
}
|
|
495
|
+
});
|
|
496
|
+
}); });
|
|
497
|
+
it('should call onEdit in case of applying ignore to new value', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
498
|
+
var unmockTableSizing, entity, onEdit, props, user;
|
|
499
|
+
return __generator(this, function (_a) {
|
|
500
|
+
switch (_a.label) {
|
|
501
|
+
case 0:
|
|
502
|
+
unmockTableSizing = (0, test_utils_1.mockBasicTableSizing)();
|
|
503
|
+
entity = (0, AttributesTable_test_data_1.createEntity)();
|
|
504
|
+
onEdit = jest.fn();
|
|
505
|
+
props = __assign(__assign({}, defaultProps), { onEdit: onEdit });
|
|
506
|
+
user = setUp(props).user;
|
|
507
|
+
return [4 /*yield*/, editTextFieldAttribute(user, 1)];
|
|
508
|
+
case 1:
|
|
509
|
+
_a.sent();
|
|
510
|
+
return [4 /*yield*/, user.click(react_2.screen.getByText('Save and apply Ignore to new value'))];
|
|
511
|
+
case 2:
|
|
512
|
+
_a.sent();
|
|
513
|
+
return [4 /*yield*/, user.click(react_2.screen.getByText('Ok'))];
|
|
514
|
+
case 3:
|
|
515
|
+
_a.sent();
|
|
516
|
+
expect(onEdit).toHaveBeenCalledWith({
|
|
517
|
+
attributeType: AttributesTable_test_data_1.selectedAttributeTypes[0],
|
|
518
|
+
attributeValue: __assign(__assign({}, entity.attributes.TextField[1]), { value: 'another text value newValue' }),
|
|
519
|
+
crosswalk: crosswalksMap.entity['entities/01L2n5z/attributes/TextField/5noU1aB'][0]
|
|
520
|
+
});
|
|
521
|
+
unmockTableSizing();
|
|
522
|
+
return [2 /*return*/];
|
|
523
|
+
}
|
|
524
|
+
});
|
|
525
|
+
}); });
|
|
526
|
+
it('should call onEdit in without applying ignore to new value', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
527
|
+
var unmockTableSizing, entity, onEdit, props, user;
|
|
528
|
+
return __generator(this, function (_a) {
|
|
529
|
+
switch (_a.label) {
|
|
530
|
+
case 0:
|
|
531
|
+
unmockTableSizing = (0, test_utils_1.mockBasicTableSizing)();
|
|
532
|
+
entity = (0, AttributesTable_test_data_1.createEntity)();
|
|
533
|
+
onEdit = jest.fn();
|
|
534
|
+
props = __assign(__assign({}, defaultProps), { onEdit: onEdit });
|
|
535
|
+
user = setUp(props).user;
|
|
536
|
+
return [4 /*yield*/, editTextFieldAttribute(user, 1)];
|
|
537
|
+
case 1:
|
|
538
|
+
_a.sent();
|
|
539
|
+
return [4 /*yield*/, user.click(react_2.screen.getByText('Save without Ignore'))];
|
|
540
|
+
case 2:
|
|
541
|
+
_a.sent();
|
|
542
|
+
return [4 /*yield*/, user.click(react_2.screen.getByText('Ok'))];
|
|
543
|
+
case 3:
|
|
544
|
+
_a.sent();
|
|
545
|
+
expect(onEdit).toHaveBeenCalledWith({
|
|
546
|
+
attributeType: AttributesTable_test_data_1.selectedAttributeTypes[0],
|
|
547
|
+
attributeValue: __assign(__assign({}, entity.attributes.TextField[1]), { value: 'another text value newValue' }),
|
|
548
|
+
crosswalk: crosswalksMap.entity['entities/01L2n5z/attributes/TextField/5noU1aB'][0],
|
|
549
|
+
clearAttributeFlags: true
|
|
550
|
+
});
|
|
551
|
+
unmockTableSizing();
|
|
552
|
+
return [2 /*return*/];
|
|
553
|
+
}
|
|
554
|
+
});
|
|
555
|
+
}); });
|
|
556
|
+
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 () {
|
|
557
|
+
var onEdit, unmockTableSizing, entity, props, user;
|
|
558
|
+
return __generator(this, function (_a) {
|
|
559
|
+
switch (_a.label) {
|
|
560
|
+
case 0:
|
|
561
|
+
onEdit = jest.fn();
|
|
562
|
+
unmockTableSizing = (0, test_utils_1.mockBasicTableSizing)();
|
|
563
|
+
entity = (0, AttributesTable_test_data_1.createEntity)();
|
|
564
|
+
entity.attributes.TextField[0].ignored = true;
|
|
565
|
+
props = __assign(__assign({}, defaultProps), { entity: entity, onEdit: onEdit });
|
|
566
|
+
user = setUp(props).user;
|
|
567
|
+
return [4 /*yield*/, editTextFieldAttribute(user)];
|
|
568
|
+
case 1:
|
|
569
|
+
_a.sent();
|
|
570
|
+
return [4 /*yield*/, user.dblClick(react_2.screen.getByText('Ok'))];
|
|
571
|
+
case 2:
|
|
572
|
+
_a.sent();
|
|
573
|
+
expect(onEdit).toHaveBeenCalledTimes(1);
|
|
574
|
+
unmockTableSizing();
|
|
575
|
+
return [2 /*return*/];
|
|
576
|
+
}
|
|
577
|
+
});
|
|
578
|
+
}); });
|
|
579
|
+
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 () {
|
|
580
|
+
var onEdit, unmockTableSizing, entity, props, user;
|
|
581
|
+
return __generator(this, function (_a) {
|
|
582
|
+
switch (_a.label) {
|
|
583
|
+
case 0:
|
|
584
|
+
onEdit = jest.fn();
|
|
585
|
+
unmockTableSizing = (0, test_utils_1.mockBasicTableSizing)();
|
|
586
|
+
entity = (0, AttributesTable_test_data_1.createEntity)();
|
|
587
|
+
entity.attributes.TextField[0].ignored = true;
|
|
588
|
+
props = __assign(__assign({}, defaultProps), { entity: entity, onEdit: onEdit });
|
|
589
|
+
user = setUp(props).user;
|
|
590
|
+
return [4 /*yield*/, editTextFieldAttribute(user)];
|
|
591
|
+
case 1:
|
|
592
|
+
_a.sent();
|
|
593
|
+
return [4 /*yield*/, user.dblClick(react_2.screen.getByText('Save and apply Ignore to new value'))];
|
|
594
|
+
case 2:
|
|
595
|
+
_a.sent();
|
|
596
|
+
return [4 /*yield*/, user.dblClick(react_2.screen.getByText('Ok'))];
|
|
597
|
+
case 3:
|
|
598
|
+
_a.sent();
|
|
599
|
+
expect(onEdit).toHaveBeenCalledTimes(1);
|
|
600
|
+
unmockTableSizing();
|
|
601
|
+
return [2 /*return*/];
|
|
602
|
+
}
|
|
603
|
+
});
|
|
604
|
+
}); });
|
|
409
605
|
});
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
606
|
+
describe('Delete attributes', function () {
|
|
607
|
+
it('should show confirmation dialog', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
608
|
+
var unmockTableSizing, onDelete, props, user, attribute;
|
|
609
|
+
return __generator(this, function (_a) {
|
|
610
|
+
switch (_a.label) {
|
|
611
|
+
case 0:
|
|
612
|
+
unmockTableSizing = (0, test_utils_1.mockBasicTableSizing)();
|
|
613
|
+
onDelete = jest.fn();
|
|
614
|
+
props = __assign(__assign({}, defaultProps), { onDelete: onDelete });
|
|
615
|
+
user = setUp(props).user;
|
|
616
|
+
attribute = (0, react_2.within)(getCellByIndexes(0, 1)).getByTestId('value-index-0');
|
|
617
|
+
return [4 /*yield*/, user.hover(attribute)];
|
|
618
|
+
case 1:
|
|
619
|
+
_a.sent();
|
|
620
|
+
return [4 /*yield*/, user.click((0, react_2.within)(attribute).queryByRole('button', { name: 'More actions' }))];
|
|
621
|
+
case 2:
|
|
622
|
+
_a.sent();
|
|
623
|
+
return [4 /*yield*/, user.click(react_2.screen.getByText('Delete'))];
|
|
624
|
+
case 3:
|
|
625
|
+
_a.sent();
|
|
626
|
+
expect(react_2.screen.getByText('Are you sure you want to delete this?')).toBeInTheDocument();
|
|
627
|
+
expect((0, react_2.within)(react_2.screen.getByRole('dialog')).getByText('Yes')).toBeInTheDocument();
|
|
628
|
+
expect((0, react_2.within)(react_2.screen.getByRole('dialog')).getByText('No')).toBeInTheDocument();
|
|
629
|
+
return [4 /*yield*/, user.click((0, react_2.within)(react_2.screen.getByRole('dialog')).getByText('No'))];
|
|
630
|
+
case 4:
|
|
631
|
+
_a.sent();
|
|
632
|
+
expect(react_2.screen.queryByText('Are you sure you want to delete this?')).not.toBeInTheDocument();
|
|
633
|
+
unmockTableSizing();
|
|
634
|
+
return [2 /*return*/];
|
|
635
|
+
}
|
|
636
|
+
});
|
|
637
|
+
}); });
|
|
638
|
+
it('should delete attribute', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
639
|
+
var unmockTableSizing, entity, onDelete, props, user, attribute;
|
|
640
|
+
return __generator(this, function (_a) {
|
|
641
|
+
switch (_a.label) {
|
|
642
|
+
case 0:
|
|
643
|
+
unmockTableSizing = (0, test_utils_1.mockBasicTableSizing)();
|
|
644
|
+
entity = (0, AttributesTable_test_data_1.createEntity)();
|
|
645
|
+
onDelete = jest.fn();
|
|
646
|
+
props = __assign(__assign({}, defaultProps), { onDelete: onDelete });
|
|
647
|
+
user = setUp(props).user;
|
|
648
|
+
attribute = (0, react_2.within)(getCellByIndexes(0, 1)).getByTestId('value-index-0');
|
|
649
|
+
return [4 /*yield*/, user.hover(attribute)];
|
|
650
|
+
case 1:
|
|
651
|
+
_a.sent();
|
|
652
|
+
return [4 /*yield*/, user.click((0, react_2.within)(attribute).queryByRole('button', { name: 'More actions' }))];
|
|
653
|
+
case 2:
|
|
654
|
+
_a.sent();
|
|
655
|
+
return [4 /*yield*/, user.click(react_2.screen.getByText('Delete'))];
|
|
656
|
+
case 3:
|
|
657
|
+
_a.sent();
|
|
658
|
+
return [4 /*yield*/, user.click((0, react_2.within)(react_2.screen.getByRole('dialog')).getByText('Yes'))];
|
|
659
|
+
case 4:
|
|
660
|
+
_a.sent();
|
|
661
|
+
expect(onDelete).toHaveBeenCalledWith({
|
|
662
|
+
attributeType: AttributesTable_test_data_1.selectedAttributeTypes[0],
|
|
663
|
+
attributeValue: entity.attributes.TextField[0],
|
|
664
|
+
crosswalks: crosswalksMap.entity['entities/01L2n5z/attributes/TextField/5noU1aB']
|
|
665
|
+
});
|
|
666
|
+
unmockTableSizing();
|
|
667
|
+
return [2 /*return*/];
|
|
668
|
+
}
|
|
669
|
+
});
|
|
670
|
+
}); });
|
|
671
|
+
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 () {
|
|
672
|
+
var unmockTableSizing, onDelete, props, user, attribute, moreButton, deleteButton, dialog, declineButton, confirmButton;
|
|
673
|
+
return __generator(this, function (_a) {
|
|
674
|
+
switch (_a.label) {
|
|
675
|
+
case 0:
|
|
676
|
+
unmockTableSizing = (0, test_utils_1.mockBasicTableSizing)();
|
|
677
|
+
onDelete = jest.fn();
|
|
678
|
+
props = __assign(__assign({}, defaultProps), { onDelete: onDelete });
|
|
679
|
+
user = setUp(props).user;
|
|
680
|
+
attribute = (0, react_2.within)(getCellByIndexes(1, 1)).getByTestId('value-index-0');
|
|
681
|
+
return [4 /*yield*/, user.hover(attribute)];
|
|
682
|
+
case 1:
|
|
683
|
+
_a.sent();
|
|
684
|
+
moreButton = (0, react_2.within)(attribute).getByRole('button', { name: 'More actions' });
|
|
685
|
+
return [4 /*yield*/, user.click(moreButton)];
|
|
686
|
+
case 2:
|
|
687
|
+
_a.sent();
|
|
688
|
+
deleteButton = react_2.screen.getByText('Delete');
|
|
689
|
+
return [4 /*yield*/, user.click(deleteButton)];
|
|
690
|
+
case 3:
|
|
691
|
+
_a.sent();
|
|
692
|
+
dialog = react_2.screen.getByRole('dialog');
|
|
693
|
+
declineButton = (0, react_2.within)(dialog).getByText('No');
|
|
694
|
+
confirmButton = (0, react_2.within)(dialog).getByText('Yes');
|
|
695
|
+
react_2.fireEvent.click(declineButton);
|
|
696
|
+
react_2.fireEvent.click(confirmButton);
|
|
697
|
+
expect(onDelete).not.toHaveBeenCalled();
|
|
698
|
+
unmockTableSizing();
|
|
699
|
+
return [2 /*return*/];
|
|
700
|
+
}
|
|
701
|
+
});
|
|
702
|
+
}); });
|
|
414
703
|
});
|
|
415
|
-
it('should
|
|
416
|
-
var
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
704
|
+
it('should add attribute to beginning on simple attribute select', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
705
|
+
var onAdd, onSelectAttributeTypes, user;
|
|
706
|
+
return __generator(this, function (_a) {
|
|
707
|
+
switch (_a.label) {
|
|
708
|
+
case 0:
|
|
709
|
+
onAdd = jest.fn();
|
|
710
|
+
onSelectAttributeTypes = jest.fn();
|
|
711
|
+
user = setUp(__assign(__assign({}, defaultProps), { onAdd: onAdd, onSelectAttributeTypes: onSelectAttributeTypes })).user;
|
|
712
|
+
return [4 /*yield*/, user.click(react_2.screen.getByText('Attribute'))];
|
|
713
|
+
case 1:
|
|
714
|
+
_a.sent();
|
|
715
|
+
expect(react_2.screen.queryByText('Image')).not.toBeInTheDocument();
|
|
716
|
+
expect(react_2.screen.queryByText('Address')).not.toBeInTheDocument();
|
|
717
|
+
return [4 /*yield*/, user.click(react_2.screen.getByText('String Label 2'))];
|
|
718
|
+
case 2:
|
|
719
|
+
_a.sent();
|
|
720
|
+
return [4 /*yield*/, user.keyboard('{Escape}')];
|
|
721
|
+
case 3:
|
|
722
|
+
_a.sent();
|
|
723
|
+
expect(onSelectAttributeTypes).toHaveBeenCalledWith(__spreadArray([
|
|
724
|
+
{
|
|
725
|
+
label: 'String Label 2',
|
|
726
|
+
name: 'TextField 2',
|
|
727
|
+
type: 'String',
|
|
728
|
+
uri: 'configuration/entityTypes/HCP/attributes/TextField2'
|
|
729
|
+
}
|
|
730
|
+
], AttributesTable_test_data_1.selectedAttributeTypes, true));
|
|
731
|
+
expect(onAdd).not.toHaveBeenCalled();
|
|
732
|
+
return [2 /*return*/];
|
|
733
|
+
}
|
|
424
734
|
});
|
|
425
|
-
});
|
|
426
|
-
it('should
|
|
427
|
-
var
|
|
428
|
-
|
|
429
|
-
|
|
735
|
+
}); });
|
|
736
|
+
it('should add attribute to beginning on nested attribute select', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
737
|
+
var onAdd, onSelectAttributeTypes, user, selectedNested;
|
|
738
|
+
return __generator(this, function (_a) {
|
|
739
|
+
switch (_a.label) {
|
|
740
|
+
case 0:
|
|
741
|
+
onAdd = jest.fn();
|
|
742
|
+
onSelectAttributeTypes = jest.fn();
|
|
743
|
+
user = setUp(__assign(__assign({}, defaultProps), { onAdd: onAdd, onSelectAttributeTypes: onSelectAttributeTypes })).user;
|
|
744
|
+
return [4 /*yield*/, user.click(react_2.screen.getByText('Attribute'))];
|
|
745
|
+
case 1:
|
|
746
|
+
_a.sent();
|
|
747
|
+
return [4 /*yield*/, user.click(react_2.screen.getByText('Nested'))];
|
|
748
|
+
case 2:
|
|
749
|
+
_a.sent();
|
|
750
|
+
return [4 /*yield*/, user.keyboard('{Escape}')];
|
|
751
|
+
case 3:
|
|
752
|
+
_a.sent();
|
|
753
|
+
selectedNested = {
|
|
754
|
+
label: 'Nested',
|
|
755
|
+
name: 'Nested',
|
|
756
|
+
type: 'Nested',
|
|
757
|
+
uri: 'configuration/entityTypes/HCP/attributes/Nested'
|
|
758
|
+
};
|
|
759
|
+
expect(onSelectAttributeTypes).toHaveBeenCalledWith(__spreadArray([selectedNested], AttributesTable_test_data_1.selectedAttributeTypes, true));
|
|
760
|
+
expect(onAdd).toHaveBeenCalledWith({
|
|
761
|
+
attributeType: selectedNested,
|
|
762
|
+
parentUri: 'entities/01L2n5z'
|
|
763
|
+
});
|
|
764
|
+
return [2 /*return*/];
|
|
765
|
+
}
|
|
766
|
+
});
|
|
767
|
+
}); });
|
|
430
768
|
});
|