@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,35 +10,129 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
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
|
+
};
|
|
13
49
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
50
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
51
|
};
|
|
16
52
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
53
|
var react_1 = __importDefault(require("react"));
|
|
18
|
-
var
|
|
19
|
-
var
|
|
54
|
+
var react_2 = require("@testing-library/react");
|
|
55
|
+
var user_event_1 = __importDefault(require("@testing-library/user-event"));
|
|
56
|
+
var LocalizationProvider_1 = require("@mui/x-date-pickers/LocalizationProvider");
|
|
57
|
+
var AdapterMoment_1 = require("@mui/x-date-pickers/AdapterMoment");
|
|
20
58
|
var CrosswalkDateEditor_1 = require("./CrosswalkDateEditor");
|
|
21
59
|
describe('CrosswalkDateEditor tests', function () {
|
|
22
60
|
afterEach(function () {
|
|
23
61
|
jest.clearAllMocks();
|
|
24
62
|
});
|
|
25
63
|
var date = new Date('01/01/2021').valueOf();
|
|
26
|
-
var
|
|
64
|
+
var defaultProps = {
|
|
27
65
|
value: date,
|
|
28
66
|
classes: { root: 'someClass' },
|
|
29
67
|
onChange: jest.fn()
|
|
30
68
|
};
|
|
69
|
+
var setUp = function (props) {
|
|
70
|
+
if (props === void 0) { props = defaultProps; }
|
|
71
|
+
var user = user_event_1.default.setup();
|
|
72
|
+
var Providers = function (_a) {
|
|
73
|
+
var children = _a.children;
|
|
74
|
+
return react_1.default.createElement(LocalizationProvider_1.LocalizationProvider, { dateAdapter: AdapterMoment_1.AdapterMoment }, children);
|
|
75
|
+
};
|
|
76
|
+
return __assign(__assign({}, (0, react_2.render)(react_1.default.createElement(CrosswalkDateEditor_1.CrosswalkDateEditor, __assign({}, props)), { wrapper: Providers })), { user: user });
|
|
77
|
+
};
|
|
31
78
|
it('should render CrosswalkDateEditor correctly', function () {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
expect(dateEditor.prop('disabled')).toBeFalsy();
|
|
36
|
-
expect(dateEditor.prop('value')).toEqual(date);
|
|
37
|
-
expect(((_a = dateEditor.prop('slotProps')) === null || _a === void 0 ? void 0 : _a.textField).InputProps.classes.root).toContain('someClass');
|
|
79
|
+
setUp();
|
|
80
|
+
expect(react_2.screen.getByDisplayValue('01/01/2021 12:00:00 AM')).toBeInTheDocument();
|
|
81
|
+
expect(react_2.screen.getByDisplayValue('01/01/2021 12:00:00 AM').parentElement).toHaveClass('someClass');
|
|
38
82
|
});
|
|
39
83
|
it('should disable TimestampEditor if props.disabled = true', function () {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
expect(
|
|
84
|
+
setUp(__assign(__assign({}, defaultProps), { disabled: true }));
|
|
85
|
+
expect(react_2.screen.getByRole('button')).toBeDisabled();
|
|
86
|
+
expect(react_2.screen.getByRole('textbox')).toBeDisabled();
|
|
87
|
+
});
|
|
88
|
+
it('new should call props.onChange when calling TimestampEditor onClose prop', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
89
|
+
var user;
|
|
90
|
+
return __generator(this, function (_a) {
|
|
91
|
+
switch (_a.label) {
|
|
92
|
+
case 0:
|
|
93
|
+
user = setUp().user;
|
|
94
|
+
return [4 /*yield*/, user.click(react_2.screen.getByRole('button'))];
|
|
95
|
+
case 1:
|
|
96
|
+
_a.sent();
|
|
97
|
+
return [4 /*yield*/, user.click(react_2.screen.getByText('5'))];
|
|
98
|
+
case 2:
|
|
99
|
+
_a.sent();
|
|
100
|
+
expect(react_2.screen.getByDisplayValue('01/05/2021 12:00:00 AM')).toBeInTheDocument();
|
|
101
|
+
return [4 /*yield*/, user.click(react_2.screen.getAllByRole('button')[0])];
|
|
102
|
+
case 3:
|
|
103
|
+
_a.sent();
|
|
104
|
+
expect(defaultProps.onChange).toHaveBeenCalledWith(new Date('01/05/2021 12:00:00 AM').valueOf());
|
|
105
|
+
return [2 /*return*/];
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
}); });
|
|
109
|
+
it('should call props.onChange when calling TimestampEditor onBlur for input', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
110
|
+
var user, newDate;
|
|
111
|
+
return __generator(this, function (_a) {
|
|
112
|
+
switch (_a.label) {
|
|
113
|
+
case 0:
|
|
114
|
+
user = setUp().user;
|
|
115
|
+
newDate = '10/10/2021';
|
|
116
|
+
return [4 /*yield*/, user.type(react_2.screen.getByRole('textbox'), '01/01/2020')];
|
|
117
|
+
case 1:
|
|
118
|
+
_a.sent();
|
|
119
|
+
expect(react_2.screen.getByDisplayValue('01/01/2020 12:00:00 AM')).toBeInTheDocument();
|
|
120
|
+
return [4 /*yield*/, user.type(react_2.screen.getByRole('textbox'), newDate)];
|
|
121
|
+
case 2:
|
|
122
|
+
_a.sent();
|
|
123
|
+
expect(react_2.screen.getByDisplayValue('10/10/2021 12:00:00 AM')).toBeInTheDocument();
|
|
124
|
+
expect(defaultProps.onChange).not.toHaveBeenCalled();
|
|
125
|
+
return [4 /*yield*/, user.tab()];
|
|
126
|
+
case 3:
|
|
127
|
+
_a.sent();
|
|
128
|
+
expect(defaultProps.onChange).toHaveBeenCalledWith(new Date(newDate).valueOf());
|
|
129
|
+
return [2 /*return*/];
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
}); });
|
|
133
|
+
it('should change value of component when value property updated', function () {
|
|
134
|
+
var rerender = setUp().rerender;
|
|
135
|
+
rerender(react_1.default.createElement(CrosswalkDateEditor_1.CrosswalkDateEditor, __assign({}, defaultProps, { value: new Date('10/10/2021').valueOf() })));
|
|
136
|
+
expect(react_2.screen.getByDisplayValue('10/10/2021 12:00:00 AM')).toBeInTheDocument();
|
|
43
137
|
});
|
|
44
138
|
});
|
|
@@ -38,11 +38,21 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
38
38
|
};
|
|
39
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
40
|
var react_1 = __importDefault(require("react"));
|
|
41
|
-
var
|
|
41
|
+
var react_2 = require("@testing-library/react");
|
|
42
42
|
var reactDnd = __importStar(require("react-dnd"));
|
|
43
|
-
var CrosswalkDragPreview_1 = require("./components/CrosswalkDragPreview");
|
|
44
43
|
var CrosswalkDragLayer_1 = require("./CrosswalkDragLayer");
|
|
44
|
+
var MdmModuleContext_1 = require("../../../contexts/MdmModuleContext");
|
|
45
45
|
jest.mock('react-dnd', function () { return (__assign(__assign({}, jest.requireActual('react-dnd')), { useDragLayer: jest.fn() })); });
|
|
46
|
+
var metadata = {
|
|
47
|
+
sources: [
|
|
48
|
+
{
|
|
49
|
+
uri: 'configuration/sources/FB',
|
|
50
|
+
label: 'Facebook',
|
|
51
|
+
icon: 'images/source/fb.png',
|
|
52
|
+
abbreviation: 'Facebook'
|
|
53
|
+
}
|
|
54
|
+
]
|
|
55
|
+
};
|
|
46
56
|
describe('CrosswalkDragLayer tests', function () {
|
|
47
57
|
var monitor = {};
|
|
48
58
|
jest.spyOn(reactDnd, 'useDragLayer').mockImplementation(function (fn) { return fn(monitor); });
|
|
@@ -52,8 +62,8 @@ describe('CrosswalkDragLayer tests', function () {
|
|
|
52
62
|
getClientOffset: function () { return null; },
|
|
53
63
|
getItem: function () { return null; }
|
|
54
64
|
};
|
|
55
|
-
var
|
|
56
|
-
expect(
|
|
65
|
+
var container = (0, react_2.render)(react_1.default.createElement(CrosswalkDragLayer_1.CrosswalkDragLayer, null)).container;
|
|
66
|
+
expect(container.querySelector('.dragLayer')).toBeNull();
|
|
57
67
|
});
|
|
58
68
|
it('should render drag item with correct offset', function () {
|
|
59
69
|
monitor = {
|
|
@@ -61,9 +71,9 @@ describe('CrosswalkDragLayer tests', function () {
|
|
|
61
71
|
getClientOffset: function () { return ({ x: 100, y: 200 }); },
|
|
62
72
|
getItem: function () { return ({ type: 'Some Item' }); }
|
|
63
73
|
};
|
|
64
|
-
var
|
|
65
|
-
expect(
|
|
66
|
-
expect(
|
|
74
|
+
var container = (0, react_2.render)(react_1.default.createElement(CrosswalkDragLayer_1.CrosswalkDragLayer, null)).container;
|
|
75
|
+
expect(container.querySelector('.dragLayer')).toBeInTheDocument();
|
|
76
|
+
expect(container.querySelector('.dragLayer > div')).toHaveStyle('transform: translate(100px, 200px');
|
|
67
77
|
});
|
|
68
78
|
it('should render CrosswalkDragPreview for crosswalk item', function () {
|
|
69
79
|
var crosswalk = { uri: 'entities/1/crosswalks/1', type: 'configuration/sources/FB', value: '123' };
|
|
@@ -75,7 +85,9 @@ describe('CrosswalkDragLayer tests', function () {
|
|
|
75
85
|
crosswalk: crosswalk
|
|
76
86
|
}); }
|
|
77
87
|
};
|
|
78
|
-
|
|
79
|
-
|
|
88
|
+
(0, react_2.render)(react_1.default.createElement(MdmModuleContext_1.MdmModuleProvider, { values: { metadata: metadata } },
|
|
89
|
+
react_1.default.createElement(CrosswalkDragLayer_1.CrosswalkDragLayer, null)));
|
|
90
|
+
expect(react_2.screen.getByTestId('cw-colored-block')).toBeInTheDocument();
|
|
91
|
+
expect(react_2.screen.getByText('Facebook')).toBeInTheDocument();
|
|
80
92
|
});
|
|
81
93
|
});
|
|
@@ -10,107 +10,207 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
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
|
+
};
|
|
13
49
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
50
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
51
|
};
|
|
16
52
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
53
|
var react_1 = __importDefault(require("react"));
|
|
18
|
-
var
|
|
19
|
-
var
|
|
20
|
-
var
|
|
21
|
-
var
|
|
22
|
-
var CrosswalkAttributes_1 = require("../CrosswalkAttributes");
|
|
54
|
+
var react_2 = require("@testing-library/react");
|
|
55
|
+
var user_event_1 = __importDefault(require("@testing-library/user-event"));
|
|
56
|
+
var LocalizationProvider_1 = require("@mui/x-date-pickers/LocalizationProvider");
|
|
57
|
+
var AdapterMoment_1 = require("@mui/x-date-pickers/AdapterMoment");
|
|
23
58
|
var CrosswalkEditor_1 = require("./CrosswalkEditor");
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
59
|
+
var MdmModuleContext_1 = require("../../../contexts/MdmModuleContext");
|
|
60
|
+
var metadata = {
|
|
61
|
+
sources: [
|
|
62
|
+
{
|
|
63
|
+
uri: 'configuration/sources/Reltio',
|
|
64
|
+
label: 'Reltio',
|
|
65
|
+
icon: 'images/source/reltio.png',
|
|
66
|
+
abbreviation: 'Reltio'
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
uri: 'configuration/sources/AHA',
|
|
70
|
+
label: 'AHA',
|
|
71
|
+
icon: 'images/source/source_s.png',
|
|
72
|
+
abbreviation: 'AHA'
|
|
73
|
+
}
|
|
74
|
+
]
|
|
75
|
+
};
|
|
76
|
+
var defaultProps = {
|
|
77
|
+
onAdd: jest.fn(),
|
|
78
|
+
onClose: jest.fn()
|
|
79
|
+
};
|
|
80
|
+
var setUp = function (props) {
|
|
81
|
+
if (props === void 0) { props = defaultProps; }
|
|
82
|
+
var user = user_event_1.default.setup({ delay: null });
|
|
83
|
+
var Providers = function (_a) {
|
|
84
|
+
var children = _a.children;
|
|
85
|
+
return (react_1.default.createElement(MdmModuleContext_1.MdmModuleProvider, { values: { metadata: metadata } },
|
|
86
|
+
react_1.default.createElement(LocalizationProvider_1.LocalizationProvider, { dateAdapter: AdapterMoment_1.AdapterMoment }, children)));
|
|
28
87
|
};
|
|
88
|
+
var renderer = (0, react_2.render)(react_1.default.createElement(CrosswalkEditor_1.CrosswalkEditor, __assign({}, props)), { wrapper: Providers });
|
|
89
|
+
return __assign(__assign({}, renderer), { user: user });
|
|
90
|
+
};
|
|
91
|
+
describe('CrosswalkEditor tests', function () {
|
|
29
92
|
it('should render correctly', function () {
|
|
30
|
-
|
|
31
|
-
expect(
|
|
32
|
-
expect(
|
|
33
|
-
expect(
|
|
34
|
-
|
|
35
|
-
expect(
|
|
36
|
-
expect(
|
|
37
|
-
});
|
|
38
|
-
it('should modify crosswalk when calling CrosswalkAttributes prop onEditAttribute', function () {
|
|
39
|
-
var wrapper = (0, enzyme_1.shallow)(react_1.default.createElement(CrosswalkEditor_1.CrosswalkEditor, __assign({}, props)));
|
|
40
|
-
var crosswalkAttributes = wrapper.find(CrosswalkAttributes_1.CrosswalkAttributes);
|
|
41
|
-
expect(crosswalkAttributes.prop('crosswalk')).toEqual({ type: '', value: '' });
|
|
42
|
-
(0, test_utils_1.act)(function () {
|
|
43
|
-
crosswalkAttributes.prop('onEditAttribute')('type', 'configuration/sources/Reltio');
|
|
44
|
-
});
|
|
45
|
-
wrapper.update();
|
|
46
|
-
expect(wrapper.find(CrosswalkAttributes_1.CrosswalkAttributes).prop('crosswalk')).toEqual({
|
|
47
|
-
type: 'configuration/sources/Reltio',
|
|
48
|
-
value: ''
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
it('should enable "Add" button when source system and id value are filled', function () {
|
|
52
|
-
var wrapper = (0, enzyme_1.shallow)(react_1.default.createElement(CrosswalkEditor_1.CrosswalkEditor, __assign({}, props)));
|
|
53
|
-
expect(wrapper.find(Button_1.default).at(1).prop('disabled')).toBe(true);
|
|
54
|
-
(0, test_utils_1.act)(function () {
|
|
55
|
-
wrapper.find(CrosswalkAttributes_1.CrosswalkAttributes).prop('onEditAttribute')('type', 'configuration/sources/Reltio');
|
|
56
|
-
});
|
|
57
|
-
wrapper.update();
|
|
58
|
-
(0, test_utils_1.act)(function () {
|
|
59
|
-
wrapper.find(CrosswalkAttributes_1.CrosswalkAttributes).prop('onEditAttribute')('value', 'new id value');
|
|
60
|
-
});
|
|
61
|
-
wrapper.update();
|
|
62
|
-
expect(wrapper.find(Button_1.default).at(1).prop('disabled')).toBe(false);
|
|
93
|
+
setUp();
|
|
94
|
+
expect(react_2.screen.getByText('Add crosswalk')).toBeInTheDocument();
|
|
95
|
+
expect(react_2.screen.getByText('Add attributes')).toBeInTheDocument();
|
|
96
|
+
expect(react_2.screen.getByText('Source System Name:')).toBeInTheDocument();
|
|
97
|
+
expect(react_2.screen.getByText('ID Value:')).toBeInTheDocument();
|
|
98
|
+
expect(react_2.screen.getByText('Cancel')).toBeInTheDocument();
|
|
99
|
+
expect(react_2.screen.getByText('Add')).toBeDisabled();
|
|
63
100
|
});
|
|
64
|
-
it('should
|
|
65
|
-
var
|
|
66
|
-
(
|
|
67
|
-
|
|
101
|
+
it('should enable "Add" button when source system and id value are filled', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
102
|
+
var user;
|
|
103
|
+
return __generator(this, function (_a) {
|
|
104
|
+
switch (_a.label) {
|
|
105
|
+
case 0:
|
|
106
|
+
user = setUp().user;
|
|
107
|
+
return [4 /*yield*/, user.click(react_2.screen.getByRole('combobox'))];
|
|
108
|
+
case 1:
|
|
109
|
+
_a.sent();
|
|
110
|
+
return [4 /*yield*/, user.click(react_2.screen.getByText('Reltio'))];
|
|
111
|
+
case 2:
|
|
112
|
+
_a.sent();
|
|
113
|
+
return [4 /*yield*/, user.type(react_2.screen.getByRole('textbox'), 'v')];
|
|
114
|
+
case 3:
|
|
115
|
+
_a.sent();
|
|
116
|
+
expect(react_2.screen.getByText('Add')).not.toBeDisabled();
|
|
117
|
+
return [2 /*return*/];
|
|
118
|
+
}
|
|
68
119
|
});
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
120
|
+
}); });
|
|
121
|
+
it('should call onAdd and onClose when calling "Add" button "onClick" prop', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
122
|
+
var user;
|
|
123
|
+
return __generator(this, function (_a) {
|
|
124
|
+
switch (_a.label) {
|
|
125
|
+
case 0:
|
|
126
|
+
user = setUp().user;
|
|
127
|
+
return [4 /*yield*/, user.click(react_2.screen.getByRole('combobox'))];
|
|
128
|
+
case 1:
|
|
129
|
+
_a.sent();
|
|
130
|
+
return [4 /*yield*/, user.click(react_2.screen.getByText('Reltio'))];
|
|
131
|
+
case 2:
|
|
132
|
+
_a.sent();
|
|
133
|
+
return [4 /*yield*/, user.type(react_2.screen.getByRole('textbox'), 'v')];
|
|
134
|
+
case 3:
|
|
135
|
+
_a.sent();
|
|
136
|
+
return [4 /*yield*/, user.click(react_2.screen.getByText('Add'))];
|
|
137
|
+
case 4:
|
|
138
|
+
_a.sent();
|
|
139
|
+
expect(defaultProps.onAdd).toHaveBeenCalledWith({
|
|
140
|
+
type: 'configuration/sources/Reltio',
|
|
141
|
+
value: 'v'
|
|
142
|
+
});
|
|
143
|
+
expect(defaultProps.onClose).toHaveBeenCalled();
|
|
144
|
+
return [2 /*return*/];
|
|
145
|
+
}
|
|
72
146
|
});
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
147
|
+
}); });
|
|
148
|
+
it('should call onClose when calling "Cancel" button "onClick" prop', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
149
|
+
var user;
|
|
150
|
+
return __generator(this, function (_a) {
|
|
151
|
+
switch (_a.label) {
|
|
152
|
+
case 0:
|
|
153
|
+
user = setUp().user;
|
|
154
|
+
return [4 /*yield*/, user.click(react_2.screen.getByText('Cancel'))];
|
|
155
|
+
case 1:
|
|
156
|
+
_a.sent();
|
|
157
|
+
expect(defaultProps.onClose).toHaveBeenCalled();
|
|
158
|
+
return [2 /*return*/];
|
|
159
|
+
}
|
|
79
160
|
});
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
161
|
+
}); });
|
|
162
|
+
it('should call onAdd with correct params if deleteDate and sourceTable params are filled', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
163
|
+
var user;
|
|
164
|
+
return __generator(this, function (_a) {
|
|
165
|
+
switch (_a.label) {
|
|
166
|
+
case 0:
|
|
167
|
+
user = setUp().user;
|
|
168
|
+
return [4 /*yield*/, user.click(react_2.screen.getByText('Add attributes'))];
|
|
169
|
+
case 1:
|
|
170
|
+
_a.sent();
|
|
171
|
+
return [4 /*yield*/, user.click(react_2.screen.getByText('Delete Date'))];
|
|
172
|
+
case 2:
|
|
173
|
+
_a.sent();
|
|
174
|
+
return [4 /*yield*/, user.click(react_2.screen.getByText('Source Table'))];
|
|
175
|
+
case 3:
|
|
176
|
+
_a.sent();
|
|
177
|
+
return [4 /*yield*/, user.keyboard('{Escape}')];
|
|
178
|
+
case 4:
|
|
179
|
+
_a.sent();
|
|
180
|
+
return [4 /*yield*/, (0, react_2.waitFor)(function () {
|
|
181
|
+
expect(react_2.screen.getByText('Delete Date:')).toBeInTheDocument();
|
|
182
|
+
})];
|
|
183
|
+
case 5:
|
|
184
|
+
_a.sent();
|
|
185
|
+
return [4 /*yield*/, user.type(react_2.screen.getAllByRole('textbox')[1], 's')];
|
|
186
|
+
case 6:
|
|
187
|
+
_a.sent();
|
|
188
|
+
return [4 /*yield*/, user.type(react_2.screen.getAllByRole('textbox')[2], '01/01/2025 01:01:00 A')];
|
|
189
|
+
case 7:
|
|
190
|
+
_a.sent();
|
|
191
|
+
return [4 /*yield*/, user.tab()];
|
|
192
|
+
case 8:
|
|
193
|
+
_a.sent();
|
|
194
|
+
return [4 /*yield*/, user.click(react_2.screen.getByRole('combobox'))];
|
|
195
|
+
case 9:
|
|
196
|
+
_a.sent();
|
|
197
|
+
return [4 /*yield*/, user.click(react_2.screen.getByText('AHA'))];
|
|
198
|
+
case 10:
|
|
199
|
+
_a.sent();
|
|
200
|
+
return [4 /*yield*/, user.type(react_2.screen.getAllByRole('textbox')[0], 'v')];
|
|
201
|
+
case 11:
|
|
202
|
+
_a.sent();
|
|
203
|
+
return [4 /*yield*/, user.click(react_2.screen.getByText('Add'))];
|
|
204
|
+
case 12:
|
|
205
|
+
_a.sent();
|
|
206
|
+
expect(defaultProps.onAdd).toHaveBeenCalledWith({
|
|
207
|
+
type: 'configuration/sources/AHA',
|
|
208
|
+
value: 'v',
|
|
209
|
+
deleteDate: new Date('01/01/2025 01:01:00').valueOf().toString(),
|
|
210
|
+
sourceTable: 's'
|
|
211
|
+
});
|
|
212
|
+
return [2 /*return*/];
|
|
213
|
+
}
|
|
92
214
|
});
|
|
93
|
-
|
|
94
|
-
(0, test_utils_1.act)(function () {
|
|
95
|
-
wrapper.find(CrosswalkAttributes_1.CrosswalkAttributes).prop('onEditAttribute')('value', 'new id value');
|
|
96
|
-
});
|
|
97
|
-
wrapper.update();
|
|
98
|
-
var deleteDate = new Date('2021-01-01').valueOf().toString();
|
|
99
|
-
(0, test_utils_1.act)(function () {
|
|
100
|
-
wrapper.find(CrosswalkAttributes_1.CrosswalkAttributes).prop('onEditAttribute')('deleteDate', deleteDate);
|
|
101
|
-
});
|
|
102
|
-
wrapper.update();
|
|
103
|
-
(0, test_utils_1.act)(function () {
|
|
104
|
-
wrapper.find(CrosswalkAttributes_1.CrosswalkAttributes).prop('onEditAttribute')('sourceTable', 'new sourceTable');
|
|
105
|
-
});
|
|
106
|
-
wrapper.update();
|
|
107
|
-
var onClick = wrapper.find(Button_1.default).at(1).prop('onClick');
|
|
108
|
-
onClick();
|
|
109
|
-
expect(props.onAdd).toHaveBeenCalledWith({
|
|
110
|
-
type: 'configuration/sources/Reltio',
|
|
111
|
-
value: 'new id value',
|
|
112
|
-
deleteDate: deleteDate,
|
|
113
|
-
sourceTable: 'new sourceTable'
|
|
114
|
-
});
|
|
115
|
-
});
|
|
215
|
+
}); });
|
|
116
216
|
});
|