@reltio/components 1.4.2044 → 1.4.2046
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/AttributesFiltersBuilder/AttributesFiltersBuilder.test.js +72 -50
- package/BasicTable/BasicTable.test.js +232 -278
- package/BlobRenderer/BlobRenderer.js +1 -1
- package/ConnectionRelationTypeSelector/ConnectionRelationTypeSelector.test.js +125 -111
- package/DateIntervalSelector/DateIntervalSelector.test.js +87 -65
- package/DefaultCellValueRenderer/DefaultCellValueRenderer.js +1 -1
- package/DefaultCellValueRenderer/DefaultCellValueRenderer.test.js +16 -46
- package/DeleteButton/DeleteButton.spec.js +53 -15
- package/DependentLookupEditor/DependentLookupEditor.test.js +555 -807
- package/Drawer/Drawer.test.js +9 -20
- package/DropDownEditor/DropDownEditor.test.js +81 -29
- package/DropDownMenuButton/DropDownMenuButton.spec.js +101 -70
- package/DropDownSelector/DropDownSelector.test.js +159 -30
- package/EditModeAttributesFactory/EditModeAttributesFactory.test.js +143 -0
- package/EditModeAttributesList/EditModeAttributesList.test.js +277 -224
- package/EditModeAttributesList/attributes.test-data.d.ts +0 -11
- package/EditModeAttributesList/attributes.test-data.js +1 -1
- package/EditModeAttributesPager/EditModeAttributesPager.test.js +698 -234
- package/EditModeAttributesPager/helpers.test.js +2 -12
- package/EditModeAttributesView/EditModeAttributesView.test.js +263 -157
- package/EditModeComplexAttribute/EditModeComplexAttribute.js +1 -1
- package/EditModeComplexAttribute/EditModeComplexAttribute.test.js +313 -298
- package/EditModeComplexAttribute/nestedAttrType.test-data.d.ts +0 -5
- package/EditModeComplexAttribute/nestedAttrType.test-data.js +3 -44
- package/EmptyState/EmptyState.test.js +99 -38
- package/EntityCreator/EntityCreator.test.js +68 -35
- package/EntitySelector/EntitySelector.js +1 -1
- package/EntitySelector/EntitySelector.test.js +275 -422
- package/EntityTypeIcon/EntityTypeIcon.test.js +16 -16
- package/EntityTypesSelector/EntityTypesSelector.test.js +62 -21
- package/ErrorBoundary/ErrorBoundary.test.js +19 -17
- package/ErrorMessage/ErrorMessage.js +1 -1
- package/ErrorPopup/ErrorPopup.test.js +72 -25
- package/ErrorWrapper/ErrorWrapper.test.js +10 -9
- package/ExpandedValueTooltip/ExpandedValueTooltip.test.js +111 -37
- package/FileTypeEditor/FileTypeEditor.test.js +95 -64
- package/FilterValueEditor/FilterValueEditor.test.js +183 -157
- package/FilterValueEditor/components/RangeDataTypeValueEditor/RangeDataTypeValueEditor.js +2 -2
- package/HierarchicalAttributeTooltip/HierarchicalAttributeTooltip.test.js +114 -24
- package/HierarchyNodeTitle/HierarchyNodeTitle.test.js +61 -100
- package/OvIcon/OvIcon.js +2 -2
- package/ProfileCard/components/ProfileCardPlaceholder/ProfileCardPlaceholder.js +2 -2
- package/ShowLess/ShowLess.js +1 -1
- package/SimpleAttributeEditor/SimpleAttributeEditor.js +2 -2
- package/UploadFileButton/components/UploadMode/UploadMode.js +1 -1
- package/cjs/AttributesFiltersBuilder/AttributesFiltersBuilder.test.js +72 -50
- package/cjs/BasicTable/BasicTable.test.js +230 -299
- package/cjs/BlobRenderer/BlobRenderer.js +1 -1
- package/cjs/ConnectionRelationTypeSelector/ConnectionRelationTypeSelector.test.js +125 -111
- package/cjs/DateIntervalSelector/DateIntervalSelector.test.js +87 -65
- package/cjs/DefaultCellValueRenderer/DefaultCellValueRenderer.js +1 -1
- package/cjs/DefaultCellValueRenderer/DefaultCellValueRenderer.test.js +16 -46
- package/cjs/DeleteButton/DeleteButton.spec.js +53 -15
- package/cjs/DependentLookupEditor/DependentLookupEditor.test.js +569 -821
- package/cjs/Drawer/Drawer.test.js +10 -21
- package/cjs/DropDownEditor/DropDownEditor.test.js +81 -29
- package/cjs/DropDownMenuButton/DropDownMenuButton.spec.js +102 -71
- package/cjs/DropDownSelector/DropDownSelector.test.js +159 -30
- package/cjs/EditModeAttributesFactory/EditModeAttributesFactory.test.js +148 -0
- package/cjs/EditModeAttributesList/EditModeAttributesList.test.js +277 -224
- package/cjs/EditModeAttributesList/attributes.test-data.d.ts +0 -11
- package/cjs/EditModeAttributesList/attributes.test-data.js +1 -1
- package/cjs/EditModeAttributesPager/EditModeAttributesPager.test.js +696 -232
- package/cjs/EditModeAttributesPager/helpers.test.js +2 -12
- package/cjs/EditModeAttributesView/EditModeAttributesView.test.js +262 -156
- package/cjs/EditModeComplexAttribute/EditModeComplexAttribute.js +1 -1
- package/cjs/EditModeComplexAttribute/EditModeComplexAttribute.test.js +312 -297
- package/cjs/EditModeComplexAttribute/nestedAttrType.test-data.d.ts +0 -5
- package/cjs/EditModeComplexAttribute/nestedAttrType.test-data.js +3 -44
- package/cjs/EmptyState/EmptyState.test.js +98 -37
- package/cjs/EntityCreator/EntityCreator.test.js +69 -36
- package/cjs/EntitySelector/EntitySelector.js +1 -1
- package/cjs/EntitySelector/EntitySelector.test.js +274 -421
- package/cjs/EntityTypeIcon/EntityTypeIcon.test.js +17 -17
- package/cjs/EntityTypesSelector/EntityTypesSelector.test.js +62 -21
- package/cjs/ErrorBoundary/ErrorBoundary.test.js +19 -17
- package/cjs/ErrorMessage/ErrorMessage.js +1 -1
- package/cjs/ErrorPopup/ErrorPopup.test.js +71 -24
- package/cjs/ErrorWrapper/ErrorWrapper.test.js +10 -9
- package/cjs/ExpandedValueTooltip/ExpandedValueTooltip.test.js +111 -37
- package/cjs/FileTypeEditor/FileTypeEditor.test.js +95 -64
- package/cjs/FilterValueEditor/FilterValueEditor.test.js +182 -156
- package/cjs/FilterValueEditor/components/RangeDataTypeValueEditor/RangeDataTypeValueEditor.js +2 -2
- package/cjs/HierarchicalAttributeTooltip/HierarchicalAttributeTooltip.test.js +114 -24
- package/cjs/HierarchyNodeTitle/HierarchyNodeTitle.test.js +61 -100
- package/cjs/OvIcon/OvIcon.js +2 -2
- package/cjs/ProfileCard/components/ProfileCardPlaceholder/ProfileCardPlaceholder.js +2 -2
- package/cjs/ShowLess/ShowLess.js +1 -1
- package/cjs/SimpleAttributeEditor/SimpleAttributeEditor.js +2 -2
- package/cjs/UploadFileButton/components/UploadMode/UploadMode.js +1 -1
- package/cjs/contexts/ExpandedAttributesContext/useAttributeExpanded.test.js +25 -18
- package/cjs/contexts/MdmModuleContext/hooks.d.ts +2 -2
- package/cjs/contexts/ReloadDataContext/ReloadDataContext.spec.js +16 -53
- package/cjs/test-utils/TestStylesProvider.js +6 -5
- package/contexts/ExpandedAttributesContext/useAttributeExpanded.test.js +25 -18
- package/contexts/MdmModuleContext/hooks.d.ts +2 -2
- package/contexts/ReloadDataContext/ReloadDataContext.spec.js +16 -30
- package/package.json +2 -2
- package/test-utils/TestStylesProvider.js +3 -2
- package/AttributesFiltersBuilder/components/AttributeSelector/AttributeSelector.test.js +0 -101
- package/AttributesFiltersBuilder/components/RowActions/RowActions.test.js +0 -106
- package/BasicTable/IntegrationBasicTable.test.d.ts +0 -1
- package/BasicTable/IntegrationBasicTable.test.js +0 -203
- package/DependentLookupEditor/IntegrationDependentLookupEditor.test.d.ts +0 -1
- package/DependentLookupEditor/IntegrationDependentLookupEditor.test.js +0 -137
- package/DropDownMenuButton/components/DefaultMenuItemRenderer/DefaultMenuItemRenderer.spec.d.ts +0 -1
- package/DropDownMenuButton/components/DefaultMenuItemRenderer/DefaultMenuItemRenderer.spec.js +0 -32
- package/EditModeAttributesFactory/components/EditModeAttribute/EditModeAttribute.test.d.ts +0 -1
- package/EditModeAttributesFactory/components/EditModeAttribute/EditModeAttribute.test.js +0 -106
- package/EditModeAttributesPager/components/AttributeRenderer/AttributeRenderer.test.d.ts +0 -1
- package/EditModeAttributesPager/components/AttributeRenderer/AttributeRenderer.test.js +0 -338
- package/EditModeAttributesPager/components/AttributeRenderer/IntegrationAttributeRenderer.test.d.ts +0 -1
- package/EditModeAttributesPager/components/AttributeRenderer/IntegrationAttributeRenderer.test.js +0 -225
- package/EditModeAttributesPager/components/ImageLineRenderer/ImageLineRenderer.test.d.ts +0 -1
- package/EditModeAttributesPager/components/ImageLineRenderer/ImageLineRenderer.test.js +0 -47
- package/EditModeAttributesPager/components/SpecialRenderer/SpecialRenderer.test.d.ts +0 -1
- package/EditModeAttributesPager/components/SpecialRenderer/SpecialRenderer.test.js +0 -204
- package/EditModeAttributesView/IntegrationEditModeAttributesView.test.d.ts +0 -1
- package/EditModeAttributesView/IntegrationEditModeAttributesView.test.js +0 -246
- package/EditModeAttributesView/metadata.test-data.d.ts +0 -4
- package/EditModeAttributesView/metadata.test-data.js +0 -119
- package/EntityCreator/entityType.test-data.d.ts +0 -52
- package/EntityCreator/entityType.test-data.js +0 -188
- package/EntitySelector/components/ClearIndicator/ClearIndicator.test.d.ts +0 -1
- package/EntitySelector/components/ClearIndicator/ClearIndicator.test.js +0 -27
- package/EntitySelector/components/EntityOption/EntityOption.test.d.ts +0 -1
- package/EntitySelector/components/EntityOption/EntityOption.test.js +0 -79
- package/EntitySelector/components/Group/Group.test.d.ts +0 -1
- package/EntitySelector/components/Group/Group.test.js +0 -65
- package/EntitySelector/components/SingleValue/SingleValue.test.d.ts +0 -1
- package/EntitySelector/components/SingleValue/SingleValue.test.js +0 -78
- package/FilterValueEditor/components/RangeDataTypeValueEditor/RangeDataTypeValueEditor.test.d.ts +0 -1
- package/FilterValueEditor/components/RangeDataTypeValueEditor/RangeDataTypeValueEditor.test.js +0 -76
- package/cjs/AttributesFiltersBuilder/components/AttributeSelector/AttributeSelector.test.d.ts +0 -1
- package/cjs/AttributesFiltersBuilder/components/AttributeSelector/AttributeSelector.test.js +0 -106
- package/cjs/AttributesFiltersBuilder/components/RowActions/RowActions.test.d.ts +0 -1
- package/cjs/AttributesFiltersBuilder/components/RowActions/RowActions.test.js +0 -111
- package/cjs/BasicTable/IntegrationBasicTable.test.d.ts +0 -1
- package/cjs/BasicTable/IntegrationBasicTable.test.js +0 -208
- package/cjs/DependentLookupEditor/IntegrationDependentLookupEditor.test.d.ts +0 -1
- package/cjs/DependentLookupEditor/IntegrationDependentLookupEditor.test.js +0 -142
- package/cjs/DropDownMenuButton/components/DefaultMenuItemRenderer/DefaultMenuItemRenderer.spec.d.ts +0 -1
- package/cjs/DropDownMenuButton/components/DefaultMenuItemRenderer/DefaultMenuItemRenderer.spec.js +0 -37
- package/cjs/EditModeAttributesFactory/components/EditModeAttribute/EditModeAttribute.test.d.ts +0 -1
- package/cjs/EditModeAttributesFactory/components/EditModeAttribute/EditModeAttribute.test.js +0 -111
- package/cjs/EditModeAttributesPager/components/AttributeRenderer/AttributeRenderer.test.d.ts +0 -1
- package/cjs/EditModeAttributesPager/components/AttributeRenderer/AttributeRenderer.test.js +0 -343
- package/cjs/EditModeAttributesPager/components/AttributeRenderer/IntegrationAttributeRenderer.test.d.ts +0 -1
- package/cjs/EditModeAttributesPager/components/AttributeRenderer/IntegrationAttributeRenderer.test.js +0 -230
- package/cjs/EditModeAttributesPager/components/ImageLineRenderer/ImageLineRenderer.test.d.ts +0 -1
- package/cjs/EditModeAttributesPager/components/ImageLineRenderer/ImageLineRenderer.test.js +0 -52
- package/cjs/EditModeAttributesPager/components/SpecialRenderer/SpecialRenderer.test.d.ts +0 -1
- package/cjs/EditModeAttributesPager/components/SpecialRenderer/SpecialRenderer.test.js +0 -209
- package/cjs/EditModeAttributesView/IntegrationEditModeAttributesView.test.d.ts +0 -1
- package/cjs/EditModeAttributesView/IntegrationEditModeAttributesView.test.js +0 -251
- package/cjs/EditModeAttributesView/metadata.test-data.d.ts +0 -4
- package/cjs/EditModeAttributesView/metadata.test-data.js +0 -123
- package/cjs/EntityCreator/entityType.test-data.d.ts +0 -52
- package/cjs/EntityCreator/entityType.test-data.js +0 -191
- package/cjs/EntitySelector/components/ClearIndicator/ClearIndicator.test.d.ts +0 -1
- package/cjs/EntitySelector/components/ClearIndicator/ClearIndicator.test.js +0 -32
- package/cjs/EntitySelector/components/EntityOption/EntityOption.test.d.ts +0 -1
- package/cjs/EntitySelector/components/EntityOption/EntityOption.test.js +0 -84
- package/cjs/EntitySelector/components/Group/Group.test.d.ts +0 -1
- package/cjs/EntitySelector/components/Group/Group.test.js +0 -70
- package/cjs/EntitySelector/components/SingleValue/SingleValue.test.d.ts +0 -1
- package/cjs/EntitySelector/components/SingleValue/SingleValue.test.js +0 -83
- package/cjs/FilterValueEditor/components/RangeDataTypeValueEditor/RangeDataTypeValueEditor.test.d.ts +0 -1
- package/cjs/FilterValueEditor/components/RangeDataTypeValueEditor/RangeDataTypeValueEditor.test.js +0 -81
- package/cjs/contexts/CollaborationContext/CollaborationContextProvider.test.d.ts +0 -1
- package/cjs/contexts/CollaborationContext/CollaborationContextProvider.test.js +0 -104
- package/contexts/CollaborationContext/CollaborationContextProvider.test.d.ts +0 -1
- package/contexts/CollaborationContext/CollaborationContextProvider.test.js +0 -99
- /package/{AttributesFiltersBuilder/components/AttributeSelector/AttributeSelector.test.d.ts → EditModeAttributesFactory/EditModeAttributesFactory.test.d.ts} +0 -0
- /package/{AttributesFiltersBuilder/components/RowActions/RowActions.test.d.ts → cjs/EditModeAttributesFactory/EditModeAttributesFactory.test.d.ts} +0 -0
|
@@ -8,29 +8,8 @@ var subSubNestedAttributeType = {
|
|
|
8
8
|
label: 'Attribute Value',
|
|
9
9
|
name: 'AttributeValue',
|
|
10
10
|
type: 'String',
|
|
11
|
-
uri: 'configuration/relationTypes/InternalHCPtoHCP/attributes/AdditionalAttributes/attributes/SubNested/attributes/SubSubNested/attributes/AttributeValue'
|
|
12
|
-
skipInDataAccess: false,
|
|
13
|
-
access: [
|
|
14
|
-
'CREATE',
|
|
15
|
-
'UPDATE',
|
|
16
|
-
'DELETE',
|
|
17
|
-
'READ',
|
|
18
|
-
'UNMERGE',
|
|
19
|
-
'INITIATE_CHANGE_REQUEST',
|
|
20
|
-
'MERGE',
|
|
21
|
-
'ACCEPT_CHANGE_REQUEST'
|
|
22
|
-
]
|
|
11
|
+
uri: 'configuration/relationTypes/InternalHCPtoHCP/attributes/AdditionalAttributes/attributes/SubNested/attributes/SubSubNested/attributes/AttributeValue'
|
|
23
12
|
}
|
|
24
|
-
],
|
|
25
|
-
access: [
|
|
26
|
-
'CREATE',
|
|
27
|
-
'UPDATE',
|
|
28
|
-
'DELETE',
|
|
29
|
-
'READ',
|
|
30
|
-
'UNMERGE',
|
|
31
|
-
'INITIATE_CHANGE_REQUEST',
|
|
32
|
-
'MERGE',
|
|
33
|
-
'ACCEPT_CHANGE_REQUEST'
|
|
34
13
|
]
|
|
35
14
|
};
|
|
36
15
|
var subNestedAttributeType = {
|
|
@@ -39,17 +18,7 @@ var subNestedAttributeType = {
|
|
|
39
18
|
type: 'Nested',
|
|
40
19
|
dataLabelPattern: '{AttributeName} [+ {AttributeType}] [+ {AttributeValue}]',
|
|
41
20
|
uri: 'configuration/relationTypes/InternalHCPtoHCP/attributes/AdditionalAttributes/attributes/SubNested',
|
|
42
|
-
attributes: [subSubNestedAttributeType]
|
|
43
|
-
access: [
|
|
44
|
-
'CREATE',
|
|
45
|
-
'UPDATE',
|
|
46
|
-
'DELETE',
|
|
47
|
-
'READ',
|
|
48
|
-
'UNMERGE',
|
|
49
|
-
'INITIATE_CHANGE_REQUEST',
|
|
50
|
-
'MERGE',
|
|
51
|
-
'ACCEPT_CHANGE_REQUEST'
|
|
52
|
-
]
|
|
21
|
+
attributes: [subSubNestedAttributeType]
|
|
53
22
|
};
|
|
54
23
|
export var nestedAttributeType = {
|
|
55
24
|
label: 'Additional Attributes',
|
|
@@ -57,15 +26,5 @@ export var nestedAttributeType = {
|
|
|
57
26
|
type: 'Nested',
|
|
58
27
|
uri: 'configuration/relationTypes/InternalHCPtoHCP/attributes/AdditionalAttributes',
|
|
59
28
|
dataLabelPattern: '{AttributeName} [- {AttributeType}] [- {AttributeValue}]',
|
|
60
|
-
attributes: [subNestedAttributeType]
|
|
61
|
-
access: [
|
|
62
|
-
'CREATE',
|
|
63
|
-
'UPDATE',
|
|
64
|
-
'DELETE',
|
|
65
|
-
'READ',
|
|
66
|
-
'UNMERGE',
|
|
67
|
-
'INITIATE_CHANGE_REQUEST',
|
|
68
|
-
'MERGE',
|
|
69
|
-
'ACCEPT_CHANGE_REQUEST'
|
|
70
|
-
]
|
|
29
|
+
attributes: [subNestedAttributeType]
|
|
71
30
|
};
|
|
@@ -1,45 +1,106 @@
|
|
|
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
|
+
};
|
|
1
48
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import { EmptyState } from './EmptyState';
|
|
5
|
-
var
|
|
6
|
-
|
|
49
|
+
import { render, screen } from '@testing-library/react';
|
|
50
|
+
import userEvent from '@testing-library/user-event';
|
|
51
|
+
import { EMPTY_STATE_VARIANTS, EmptyState } from './EmptyState';
|
|
52
|
+
var defaultProps = {
|
|
53
|
+
text: 'Header',
|
|
54
|
+
variant: EMPTY_STATE_VARIANTS.full,
|
|
55
|
+
LogoRenderer: function () { return React.createElement("div", { "data-reltio-id": "logo" }); }
|
|
56
|
+
};
|
|
57
|
+
var setUp = function (props) {
|
|
58
|
+
if (props === void 0) { props = defaultProps; }
|
|
59
|
+
var user = userEvent.setup();
|
|
60
|
+
return __assign({ user: user }, render(React.createElement(EmptyState, __assign({}, props))));
|
|
61
|
+
};
|
|
62
|
+
describe('Empty state tests', function () {
|
|
7
63
|
it('should render main parts', function () {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
expect(
|
|
12
|
-
expect(
|
|
13
|
-
expect(component.find('.text').at(0).text()).toBe(text);
|
|
14
|
-
expect(component.find('.secondaryText')).toHaveLength(0);
|
|
15
|
-
expect(component.find(Button)).toHaveLength(0);
|
|
64
|
+
setUp(__assign(__assign({}, defaultProps), { access: false }));
|
|
65
|
+
screen.getByTestId('logo');
|
|
66
|
+
screen.getByText('Header');
|
|
67
|
+
expect(screen.queryByText('Description')).not.toBeInTheDocument();
|
|
68
|
+
expect(screen.queryByRole('button')).not.toBeInTheDocument();
|
|
16
69
|
});
|
|
17
70
|
it('should render secondaryText if it is defined', function () {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
expect(component.find(Logo)).toHaveLength(1);
|
|
21
|
-
expect(component.find('.textBox')).toHaveLength(1);
|
|
22
|
-
expect(component.find('.text')).toHaveLength(2);
|
|
23
|
-
expect(component.find('.secondaryText')).toHaveLength(2);
|
|
24
|
-
expect(component.find('.secondaryText').at(0).text()).toBe(secondaryText);
|
|
25
|
-
expect(component.find(Button)).toHaveLength(0);
|
|
26
|
-
});
|
|
27
|
-
it('should render Button component if buttonTitle is defined and has access', function () {
|
|
28
|
-
var buttonTitle = 'SELECT';
|
|
29
|
-
var component = mount(React.createElement(EmptyState, { access: true, LogoRenderer: Logo, text: "Header", buttonTitle: buttonTitle }));
|
|
30
|
-
expect(component.find(Logo)).toHaveLength(1);
|
|
31
|
-
expect(component.find('.textBox')).toHaveLength(1);
|
|
32
|
-
expect(component.find(Button)).toHaveLength(1);
|
|
33
|
-
expect(component.find(Button).text()).toBe(buttonTitle);
|
|
34
|
-
});
|
|
35
|
-
it('should call onClick on button click', function () {
|
|
36
|
-
var onClick = jest.fn();
|
|
37
|
-
var component = mount(React.createElement(EmptyState, { access: true, LogoRenderer: Logo, text: "Header", buttonTitle: 'SELECT', onClick: onClick }));
|
|
38
|
-
component.find(Button).find('button').at(0).simulate('click');
|
|
39
|
-
expect(onClick).toHaveBeenCalled();
|
|
71
|
+
setUp(__assign(__assign({}, defaultProps), { secondaryText: 'Description' }));
|
|
72
|
+
screen.getByText('Description');
|
|
40
73
|
});
|
|
41
|
-
it('should
|
|
42
|
-
|
|
43
|
-
|
|
74
|
+
it('should render button component if buttonTitle is defined and has access', function () {
|
|
75
|
+
setUp(__assign(__assign({}, defaultProps), { access: true, buttonTitle: 'SELECT' }));
|
|
76
|
+
expect(screen.getByRole('button', { name: 'SELECT' })).toBeInTheDocument();
|
|
44
77
|
});
|
|
78
|
+
it('should call onClick on button click', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
79
|
+
var onClick, user;
|
|
80
|
+
return __generator(this, function (_a) {
|
|
81
|
+
switch (_a.label) {
|
|
82
|
+
case 0:
|
|
83
|
+
onClick = jest.fn();
|
|
84
|
+
user = setUp(__assign(__assign({}, defaultProps), { access: true, buttonTitle: 'SELECT', onClick: onClick })).user;
|
|
85
|
+
return [4 /*yield*/, user.click(screen.getByRole('button', { name: 'SELECT' }))];
|
|
86
|
+
case 1:
|
|
87
|
+
_a.sent();
|
|
88
|
+
expect(onClick).toHaveBeenCalled();
|
|
89
|
+
return [2 /*return*/];
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
}); });
|
|
93
|
+
it('should not fail when onClick prop is undefined', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
94
|
+
var user;
|
|
95
|
+
return __generator(this, function (_a) {
|
|
96
|
+
switch (_a.label) {
|
|
97
|
+
case 0:
|
|
98
|
+
user = setUp(__assign(__assign({}, defaultProps), { access: true, buttonTitle: 'SELECT' })).user;
|
|
99
|
+
return [4 /*yield*/, user.click(screen.getByRole('button', { name: 'SELECT' }))];
|
|
100
|
+
case 1:
|
|
101
|
+
_a.sent();
|
|
102
|
+
return [2 /*return*/];
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
}); });
|
|
45
106
|
});
|
|
@@ -11,23 +11,50 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
};
|
|
12
12
|
var _a;
|
|
13
13
|
import React from 'react';
|
|
14
|
-
import { mount } from 'enzyme';
|
|
15
14
|
import { Mode } from '@reltio/mdm-sdk';
|
|
16
|
-
import {
|
|
17
|
-
import
|
|
18
|
-
import { EditModeAttributesList } from '../EditModeAttributesList';
|
|
15
|
+
import { render, screen, within } from '@testing-library/react';
|
|
16
|
+
import userEvent from '@testing-library/user-event';
|
|
19
17
|
import { MdmModuleProvider } from '../contexts/MdmModuleContext';
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
import { EntityCreator } from './EntityCreator';
|
|
19
|
+
var entityType = {
|
|
20
|
+
uri: 'configuration/entityTypes/HCP',
|
|
21
|
+
label: 'HCP',
|
|
22
|
+
attributes: [
|
|
23
|
+
{
|
|
24
|
+
label: 'String',
|
|
25
|
+
name: 'FirstName',
|
|
26
|
+
type: 'String',
|
|
27
|
+
uri: 'configuration/entityTypes/HCP/attributes/FirstName'
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
label: 'Enumeration',
|
|
31
|
+
name: 'Enumeration',
|
|
32
|
+
type: 'String',
|
|
33
|
+
uri: 'configuration/entityTypes/HCP/attributes/Enumeration'
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
label: 'Int',
|
|
37
|
+
name: 'Int',
|
|
38
|
+
type: 'Int',
|
|
39
|
+
uri: 'configuration/entityTypes/HCP/attributes/Int'
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
label: 'Float',
|
|
43
|
+
name: 'Float',
|
|
44
|
+
type: 'Float',
|
|
45
|
+
uri: 'configuration/entityTypes/HCP/attributes/Float'
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
};
|
|
23
49
|
var defaultEntityUri = 'entities/123';
|
|
24
50
|
var defaultEntity = {
|
|
25
51
|
uri: defaultEntityUri,
|
|
26
|
-
|
|
27
|
-
|
|
52
|
+
type: 'configuration/entityTypes/HCP',
|
|
53
|
+
attributes: { Attr1: [], Attr2: [] }
|
|
28
54
|
};
|
|
29
55
|
var defaultMdmValues = {
|
|
30
|
-
modifiedEntities: (_a = {}, _a[defaultEntityUri] = defaultEntity, _a)
|
|
56
|
+
modifiedEntities: (_a = {}, _a[defaultEntityUri] = defaultEntity, _a),
|
|
57
|
+
dependentLookups: { editors: {}, structure: {}, initedTypeUris: [] }
|
|
31
58
|
};
|
|
32
59
|
var mdmActions = {
|
|
33
60
|
addAttributes: jest.fn(),
|
|
@@ -37,39 +64,45 @@ var mdmActions = {
|
|
|
37
64
|
var defaultProps = {
|
|
38
65
|
entityType: entityType,
|
|
39
66
|
entityUri: defaultEntityUri,
|
|
40
|
-
mode: Mode.
|
|
67
|
+
mode: Mode.Editing
|
|
41
68
|
};
|
|
42
69
|
var setUp = function (_a) {
|
|
43
70
|
var _b = _a === void 0 ? {} : _a, _c = _b.props, props = _c === void 0 ? defaultProps : _c, _d = _b.mdmValues, mdmValues = _d === void 0 ? defaultMdmValues : _d;
|
|
44
|
-
|
|
45
|
-
|
|
71
|
+
var user = userEvent.setup();
|
|
72
|
+
var Providers = function (_a) {
|
|
73
|
+
var children = _a.children;
|
|
74
|
+
return (React.createElement(MdmModuleProvider, { values: mdmValues, actions: mdmActions }, children));
|
|
75
|
+
};
|
|
76
|
+
return __assign(__assign({}, render(React.createElement(EntityCreator, __assign({}, props)), { wrapper: Providers })), { user: user });
|
|
46
77
|
};
|
|
47
|
-
describe('
|
|
78
|
+
describe('Entity сreator tests', function () {
|
|
48
79
|
it('should render nothing if entity is null', function () {
|
|
49
80
|
var props = __assign(__assign({}, defaultProps), { entityUri: 'entities/234234232' });
|
|
50
|
-
var
|
|
51
|
-
expect(
|
|
81
|
+
var container = setUp({ props: props }).container;
|
|
82
|
+
expect(container).toBeEmptyDOMElement();
|
|
52
83
|
});
|
|
53
|
-
it('should render
|
|
54
|
-
|
|
55
|
-
var
|
|
56
|
-
expect(
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
expect(attributeList.prop('onChangeAttribute')).toBe(mdmActions.modifyAttribute);
|
|
67
|
-
expect(attributeList.prop('onDeleteAttribute')).toBe(mdmActions.removeAttribute);
|
|
84
|
+
it('should render correctly if entity is not null', function () {
|
|
85
|
+
setUp();
|
|
86
|
+
var branchDecorators = screen.getAllByTestId('branch-decorator');
|
|
87
|
+
expect(branchDecorators).toHaveLength(5);
|
|
88
|
+
within(branchDecorators[0]).getByText('More attributes');
|
|
89
|
+
within(branchDecorators[1]).getByText('String');
|
|
90
|
+
within(branchDecorators[1]).getByRole('textbox');
|
|
91
|
+
within(branchDecorators[2]).getByText('Enumeration');
|
|
92
|
+
within(branchDecorators[2]).getByRole('textbox');
|
|
93
|
+
within(branchDecorators[3]).getByText('Int');
|
|
94
|
+
within(branchDecorators[3]).getByRole('textbox');
|
|
95
|
+
within(branchDecorators[4]).getByText('Float');
|
|
96
|
+
within(branchDecorators[4]).getByRole('textbox');
|
|
68
97
|
});
|
|
69
|
-
it('should use attributeTypesSelectionStrategy for evaluating needed attribute types
|
|
98
|
+
it('should use attributeTypesSelectionStrategy for evaluating needed attribute types correctly', function () {
|
|
70
99
|
var props = __assign(__assign({}, defaultProps), { attributeTypesSelectionStrategy: function (entityType) { return entityType.attributes.slice(0, 2); } });
|
|
71
|
-
|
|
72
|
-
var
|
|
73
|
-
expect(
|
|
100
|
+
setUp({ props: props });
|
|
101
|
+
var branchDecorators = screen.getAllByTestId('branch-decorator');
|
|
102
|
+
expect(branchDecorators).toHaveLength(3);
|
|
103
|
+
within(branchDecorators[0]).getByText('More attributes');
|
|
104
|
+
within(branchDecorators[1]).getByText('String');
|
|
105
|
+
within(branchDecorators[1]).getByRole('textbox');
|
|
106
|
+
within(branchDecorators[2]).getByText('Enumeration');
|
|
74
107
|
});
|
|
75
108
|
});
|
|
@@ -75,6 +75,6 @@ export var EntitySelector = function (_a) {
|
|
|
75
75
|
}, [TextFieldProps]);
|
|
76
76
|
return (React.createElement(React.Fragment, null,
|
|
77
77
|
React.createElement(DropDownSelector, __assign({ value: !isEmpty(entity) ? entity : undefined, inputValue: inputValue, onInputChange: handleInputChange, getOptions: getOptions, getOptionLabel: prop('entityLabel'), onChange: handleChange, onCreate: handleCreate, onClear: handleClear, label: label, createLabel: createLabel, components: __assign(__assign({ Option: EntityOption, SingleValue: SingleValue }, groupComponent), clearComponent), currentEntityType: currentEntityType, isClearable: true, disableLinkClick: disableLinkClick, TextFieldProps: textFieldProps }, dropDownSelectorProps)),
|
|
78
|
-
isTempEntity && (React.createElement("div", { className: styles.creatorWrapper },
|
|
78
|
+
isTempEntity && (React.createElement("div", { "data-reltio-id": "entity-creator", className: styles.creatorWrapper },
|
|
79
79
|
React.createElement(EntityCreator, { mode: mode, attributeTypesSelectionStrategy: attributeTypesSelectionStrategy, entityType: currentEntityType, entityUri: entity.entityUri })))));
|
|
80
80
|
};
|