@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
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
import React from 'react';
|
|
13
|
-
import { shallow } from 'enzyme';
|
|
14
|
-
import { InlineAttributesPager } from '../../../../../InlineAttributesPager';
|
|
15
|
-
import { SimpleAttributesRenderer } from './SimpleAttributesRenderer';
|
|
16
|
-
describe('SimpleAttributesRenderer tests', function () {
|
|
17
|
-
it('should render correctly', function () {
|
|
18
|
-
var crosswalks = [
|
|
19
|
-
{
|
|
20
|
-
uri: 'entities/j8K1vc9/crosswalks/12jf9nL05',
|
|
21
|
-
type: 'configuration/sources/Reltio',
|
|
22
|
-
value: 'nQpZyQt',
|
|
23
|
-
reltioLoadDate: '2021-06-11T08:24:31.726Z',
|
|
24
|
-
createDate: '2018-11-19T12:14:00.735Z',
|
|
25
|
-
updateDate: '2018-11-19T12:14:00.735Z',
|
|
26
|
-
attributes: ['entities/1/attributes/CountryCode/1', 'entities/1/attributes/Date/1'],
|
|
27
|
-
singleAttributeUpdateDates: {
|
|
28
|
-
'entities/1/attributes/Date/1': '2018-11-29T05:39:56.445Z'
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
];
|
|
32
|
-
var props = {
|
|
33
|
-
attributeValues: [
|
|
34
|
-
{
|
|
35
|
-
uri: 'entities/1/attributes/CountryCode/1',
|
|
36
|
-
type: 'configuration/entityTypes/HCP/attributes/CountryCode',
|
|
37
|
-
value: 'Italy',
|
|
38
|
-
lookupCode: 'IT',
|
|
39
|
-
ov: true
|
|
40
|
-
}
|
|
41
|
-
],
|
|
42
|
-
attributeType: {
|
|
43
|
-
label: 'Country Code',
|
|
44
|
-
name: 'CountryCode',
|
|
45
|
-
type: 'String',
|
|
46
|
-
uri: 'configuration/entityTypes/HCP/attributes/CountryCode'
|
|
47
|
-
},
|
|
48
|
-
crosswalksMap: {
|
|
49
|
-
'entities/1/attributes/CountryCode/1': [crosswalks[0]],
|
|
50
|
-
'entities/1/attributes/Date/1': [crosswalks[0]]
|
|
51
|
-
},
|
|
52
|
-
onPin: jest.fn(),
|
|
53
|
-
onIgnore: jest.fn(),
|
|
54
|
-
onEdit: jest.fn(),
|
|
55
|
-
onAdd: jest.fn(),
|
|
56
|
-
onDelete: jest.fn(),
|
|
57
|
-
parentUri: 'entities/1',
|
|
58
|
-
emptyTempAttributeUris: []
|
|
59
|
-
};
|
|
60
|
-
var wrapper = shallow(React.createElement(SimpleAttributesRenderer, __assign({}, props)));
|
|
61
|
-
expect(wrapper.find('.basicCell').length).toBe(1);
|
|
62
|
-
expect(wrapper.find(InlineAttributesPager).props()).toEqual(props);
|
|
63
|
-
});
|
|
64
|
-
});
|
package/esm/features/crosswalks/CrosswalkDateEditor/IntegrationCrosswalkDateEditor.test.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
-
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);
|
|
23
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
-
function step(op) {
|
|
26
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
28
|
-
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;
|
|
29
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
-
switch (op[0]) {
|
|
31
|
-
case 0: case 1: t = op; break;
|
|
32
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
-
default:
|
|
36
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
-
if (t[2]) _.ops.pop();
|
|
41
|
-
_.trys.pop(); continue;
|
|
42
|
-
}
|
|
43
|
-
op = body.call(thisArg, _);
|
|
44
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
import React from 'react';
|
|
49
|
-
import { render, screen } from '@testing-library/react';
|
|
50
|
-
import userEvent from '@testing-library/user-event';
|
|
51
|
-
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
|
|
52
|
-
import { AdapterMoment } from '@mui/x-date-pickers/AdapterMoment';
|
|
53
|
-
import { CrosswalkDateEditor } from './CrosswalkDateEditor';
|
|
54
|
-
describe('CrosswalkDateEditor tests', function () {
|
|
55
|
-
afterEach(function () {
|
|
56
|
-
jest.clearAllMocks();
|
|
57
|
-
});
|
|
58
|
-
var date = new Date('01/01/2021').valueOf();
|
|
59
|
-
var defaultProps = {
|
|
60
|
-
value: date,
|
|
61
|
-
classes: { root: 'someClass' },
|
|
62
|
-
onChange: jest.fn()
|
|
63
|
-
};
|
|
64
|
-
var setUp = function (props) {
|
|
65
|
-
if (props === void 0) { props = defaultProps; }
|
|
66
|
-
var user = userEvent.setup();
|
|
67
|
-
var Providers = function (_a) {
|
|
68
|
-
var children = _a.children;
|
|
69
|
-
return React.createElement(LocalizationProvider, { dateAdapter: AdapterMoment }, children);
|
|
70
|
-
};
|
|
71
|
-
return __assign(__assign({}, render(React.createElement(CrosswalkDateEditor, __assign({}, props)), { wrapper: Providers })), { user: user });
|
|
72
|
-
};
|
|
73
|
-
it('new should call props.onChange when calling TimestampEditor onClose prop', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
74
|
-
var user;
|
|
75
|
-
return __generator(this, function (_a) {
|
|
76
|
-
switch (_a.label) {
|
|
77
|
-
case 0:
|
|
78
|
-
user = setUp().user;
|
|
79
|
-
return [4 /*yield*/, user.click(screen.getByRole('button'))];
|
|
80
|
-
case 1:
|
|
81
|
-
_a.sent();
|
|
82
|
-
return [4 /*yield*/, user.click(screen.getByText('5'))];
|
|
83
|
-
case 2:
|
|
84
|
-
_a.sent();
|
|
85
|
-
expect(screen.getByDisplayValue('01/05/2021 12:00:00 AM')).toBeInTheDocument();
|
|
86
|
-
return [4 /*yield*/, user.click(screen.getAllByRole('button')[0])];
|
|
87
|
-
case 3:
|
|
88
|
-
_a.sent();
|
|
89
|
-
expect(defaultProps.onChange).toHaveBeenCalledWith(new Date('01/05/2021 12:00:00 AM').valueOf());
|
|
90
|
-
return [2 /*return*/];
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
}); });
|
|
94
|
-
it('should call props.onChange when calling TimestampEditor onBlur for input', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
95
|
-
var user, newDate;
|
|
96
|
-
return __generator(this, function (_a) {
|
|
97
|
-
switch (_a.label) {
|
|
98
|
-
case 0:
|
|
99
|
-
user = setUp().user;
|
|
100
|
-
newDate = '10/10/2021';
|
|
101
|
-
return [4 /*yield*/, user.type(screen.getByRole('textbox'), '01/01/2020')];
|
|
102
|
-
case 1:
|
|
103
|
-
_a.sent();
|
|
104
|
-
expect(screen.getByDisplayValue('01/01/2020 12:00:00 AM')).toBeInTheDocument();
|
|
105
|
-
return [4 /*yield*/, user.type(screen.getByRole('textbox'), newDate)];
|
|
106
|
-
case 2:
|
|
107
|
-
_a.sent();
|
|
108
|
-
expect(screen.getByDisplayValue('10/10/2021 12:00:00 AM')).toBeInTheDocument();
|
|
109
|
-
expect(defaultProps.onChange).not.toHaveBeenCalled();
|
|
110
|
-
return [4 /*yield*/, user.tab()];
|
|
111
|
-
case 3:
|
|
112
|
-
_a.sent();
|
|
113
|
-
expect(defaultProps.onChange).toHaveBeenCalledWith(new Date(newDate).valueOf());
|
|
114
|
-
return [2 /*return*/];
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
}); });
|
|
118
|
-
it('should change value of component when value property updated', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
119
|
-
var rerender;
|
|
120
|
-
return __generator(this, function (_a) {
|
|
121
|
-
switch (_a.label) {
|
|
122
|
-
case 0:
|
|
123
|
-
rerender = setUp().rerender;
|
|
124
|
-
return [4 /*yield*/, rerender(React.createElement(CrosswalkDateEditor, __assign({}, defaultProps, { value: new Date('10/10/2021').valueOf() })))];
|
|
125
|
-
case 1:
|
|
126
|
-
_a.sent();
|
|
127
|
-
expect(screen.getByDisplayValue('10/10/2021 12:00:00 AM')).toBeInTheDocument();
|
|
128
|
-
return [2 /*return*/];
|
|
129
|
-
}
|
|
130
|
-
});
|
|
131
|
-
}); });
|
|
132
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { mount } from 'enzyme';
|
|
3
|
-
import * as CrosswalksDisplay from '../../../../../contexts/CrosswalksDisplayContext';
|
|
4
|
-
import { MdmModuleProvider } from '../../../../../contexts/MdmModuleContext';
|
|
5
|
-
import { SourceIcon } from '../../../../../SourceIcon';
|
|
6
|
-
import { ColoredBlock } from '../../../ColoredBlock';
|
|
7
|
-
import { CrosswalkDragPreview } from './CrosswalkDragPreview';
|
|
8
|
-
describe('CrosswalkDragPreview tests', function () {
|
|
9
|
-
beforeAll(function () {
|
|
10
|
-
jest.spyOn(CrosswalksDisplay, 'useCrosswalkColor').mockImplementation(function (crosswalks) { return crosswalks === null || crosswalks === void 0 ? void 0 : crosswalks.value; });
|
|
11
|
-
});
|
|
12
|
-
it('should render correctly', function () {
|
|
13
|
-
var metadata = {
|
|
14
|
-
sources: [
|
|
15
|
-
{
|
|
16
|
-
uri: 'configuration/sources/FB',
|
|
17
|
-
label: 'Facebook'
|
|
18
|
-
}
|
|
19
|
-
]
|
|
20
|
-
};
|
|
21
|
-
var crosswalk = { uri: 'entities/1/crosswalks/1', type: 'configuration/sources/FB', value: '123' };
|
|
22
|
-
var wrapper = mount(React.createElement(MdmModuleProvider, { values: { metadata: metadata } },
|
|
23
|
-
React.createElement(CrosswalkDragPreview, { crosswalk: crosswalk })));
|
|
24
|
-
expect(wrapper.find(ColoredBlock).prop('color')).toBe('123');
|
|
25
|
-
expect(wrapper.find(SourceIcon).prop('sourceType')).toBe(crosswalk.type);
|
|
26
|
-
expect(wrapper.find('p.sourceLabel').text()).toBe('Facebook');
|
|
27
|
-
});
|
|
28
|
-
});
|
|
File without changes
|
|
File without changes
|