@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
|
@@ -9,6 +9,42 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
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
|
+
};
|
|
12
48
|
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
13
49
|
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
14
50
|
if (ar || !(i in from)) {
|
|
@@ -19,132 +55,153 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
19
55
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
20
56
|
};
|
|
21
57
|
import React from 'react';
|
|
22
|
-
import { mount } from 'enzyme';
|
|
23
|
-
import { act } from 'react-dom/test-utils';
|
|
24
|
-
import EditModeAttributesList from './EditModeAttributesList';
|
|
25
|
-
import { MoreAttributesButton } from '../MoreAttributesButton';
|
|
26
|
-
import { EditModeAttributesPager } from '../EditModeAttributesPager';
|
|
27
|
-
import { ActivenessAttrTypes, getAttributesListForEditMode, Mode } from '@reltio/mdm-sdk';
|
|
28
|
-
import { attributesList } from './attributes.test-data';
|
|
29
|
-
import { BranchDecorator } from '../BranchDecorator';
|
|
30
58
|
import { adjust, assoc } from 'ramda';
|
|
31
|
-
import {
|
|
32
|
-
import
|
|
59
|
+
import { render, screen, within } from '@testing-library/react';
|
|
60
|
+
import userEvent from '@testing-library/user-event';
|
|
61
|
+
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
|
|
62
|
+
import { AdapterMoment } from '@mui/x-date-pickers/AdapterMoment';
|
|
63
|
+
import { ActivenessAttrTypes, Mode } from '@reltio/mdm-sdk';
|
|
33
64
|
import { PinnedAttributesContext } from '../contexts/PinnedAttributesContext';
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
65
|
+
import { attributesList } from './attributes.test-data';
|
|
66
|
+
import EditModeAttributesList from './EditModeAttributesList';
|
|
67
|
+
import { MdmModuleProvider } from '../contexts/MdmModuleContext';
|
|
68
|
+
var defaultAttributes = {
|
|
69
|
+
Role: [
|
|
70
|
+
{
|
|
71
|
+
ov: true,
|
|
72
|
+
type: 'configuration/relationTypes/knowledge/attributes/Role',
|
|
73
|
+
uri: 'relations/8908/Role',
|
|
74
|
+
value: ''
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
ov: true,
|
|
78
|
+
type: 'configuration/relationTypes/knowledge/attributes/Role',
|
|
79
|
+
uri: 'relations/8909/Role',
|
|
80
|
+
value: 'Some role'
|
|
81
|
+
}
|
|
82
|
+
],
|
|
83
|
+
Name: [
|
|
84
|
+
{
|
|
85
|
+
ov: true,
|
|
86
|
+
type: 'configuration/relationTypes/knowledge/attributes/Name',
|
|
87
|
+
uri: 'relations/8808/Name',
|
|
88
|
+
value: ''
|
|
89
|
+
}
|
|
90
|
+
],
|
|
91
|
+
LastName: [
|
|
92
|
+
{
|
|
93
|
+
ov: true,
|
|
94
|
+
type: 'configuration/relationTypes/knowledge/attributes/LastName',
|
|
95
|
+
uri: 'relations/7808/LastName',
|
|
96
|
+
value: ''
|
|
97
|
+
}
|
|
98
|
+
],
|
|
99
|
+
paging: {
|
|
100
|
+
'configuration/relationTypes/knowledge/attributes/Role': {
|
|
101
|
+
totalOvValues: 4,
|
|
102
|
+
totalValues: 4
|
|
103
|
+
}
|
|
49
104
|
}
|
|
50
|
-
}
|
|
51
|
-
|
|
105
|
+
};
|
|
106
|
+
var defaultEntity = { uri: 'entities/xT3HJZ7', type: 'configuration/entityTypes/HCP', attributes: defaultAttributes };
|
|
107
|
+
var defaultProps = {
|
|
108
|
+
parentUri: 'entities/xT3HJZ7',
|
|
109
|
+
entity: defaultEntity,
|
|
110
|
+
attrTypes: attributesList,
|
|
111
|
+
mode: Mode.Editing,
|
|
112
|
+
showEmptyEditors: false,
|
|
113
|
+
onAddAttributes: jest.fn(),
|
|
114
|
+
onDeleteAttribute: jest.fn(),
|
|
115
|
+
onChangeAttribute: jest.fn()
|
|
116
|
+
};
|
|
117
|
+
var dependentLookups = { editors: {}, structure: {}, initedTypeUris: [] };
|
|
118
|
+
var defaultMdmValues = { dependentLookups: dependentLookups };
|
|
119
|
+
var setUp = function (_a) {
|
|
120
|
+
var _b = _a === void 0 ? {} : _a, _c = _b.props, props = _c === void 0 ? defaultProps : _c, _d = _b.mdmValues, mdmValues = _d === void 0 ? defaultMdmValues : _d, _e = _b.pinnedAttributesContextValue, pinnedAttributesContextValue = _e === void 0 ? [] : _e;
|
|
121
|
+
var user = userEvent.setup();
|
|
122
|
+
var Providers = function (_a) {
|
|
123
|
+
var children = _a.children;
|
|
124
|
+
return (React.createElement(MdmModuleProvider, { values: mdmValues },
|
|
125
|
+
React.createElement(PinnedAttributesContext.Provider, { value: pinnedAttributesContextValue },
|
|
126
|
+
React.createElement(LocalizationProvider, { dateAdapter: AdapterMoment }, children))));
|
|
127
|
+
};
|
|
128
|
+
var result = render(React.createElement(EditModeAttributesList, __assign({}, props)), { wrapper: Providers });
|
|
129
|
+
var rerender = function (newProps) {
|
|
130
|
+
return result.rerender(React.createElement(EditModeAttributesList, __assign({}, props, newProps)));
|
|
131
|
+
};
|
|
132
|
+
return __assign(__assign({}, result), { rerender: rerender, user: user });
|
|
133
|
+
};
|
|
134
|
+
describe('Edit mode attributes list tests', function () {
|
|
52
135
|
afterEach(function () {
|
|
53
136
|
jest.clearAllMocks();
|
|
54
137
|
});
|
|
55
|
-
var attributes = {
|
|
56
|
-
Role: [
|
|
57
|
-
{
|
|
58
|
-
ov: true,
|
|
59
|
-
type: 'configuration/relationTypes/knowledge/attributes/Role',
|
|
60
|
-
uri: 'relations/8908/Role',
|
|
61
|
-
value: ''
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
ov: true,
|
|
65
|
-
type: 'configuration/relationTypes/knowledge/attributes/Role',
|
|
66
|
-
uri: 'relations/8909/Role',
|
|
67
|
-
value: 'Some role'
|
|
68
|
-
}
|
|
69
|
-
],
|
|
70
|
-
Name: [
|
|
71
|
-
{
|
|
72
|
-
ov: true,
|
|
73
|
-
type: 'configuration/relationTypes/knowledge/attributes/Name',
|
|
74
|
-
uri: 'relations/8808/Name',
|
|
75
|
-
value: ''
|
|
76
|
-
}
|
|
77
|
-
],
|
|
78
|
-
LastName: [
|
|
79
|
-
{
|
|
80
|
-
ov: true,
|
|
81
|
-
type: 'configuration/relationTypes/knowledge/attributes/LastName',
|
|
82
|
-
uri: 'relations/7808/LastName',
|
|
83
|
-
value: ''
|
|
84
|
-
}
|
|
85
|
-
],
|
|
86
|
-
paging: {
|
|
87
|
-
'configuration/relationTypes/knowledge/attributes/Role': {
|
|
88
|
-
totalOvValues: 4,
|
|
89
|
-
totalValues: 4
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
var entity = {
|
|
94
|
-
attributes: attributes
|
|
95
|
-
};
|
|
96
|
-
var parentUri = 'entities/xT3HJZ7';
|
|
97
138
|
it('should render button with label and not hidden/required pagers', function () {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
var
|
|
101
|
-
expect(
|
|
102
|
-
expect(
|
|
103
|
-
|
|
104
|
-
expect(
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
it('should not add to more attr types single value types with non-empty attr value', function () {
|
|
112
|
-
var attrTypes = adjust(1, assoc('singleValue', true), attributesList);
|
|
113
|
-
var component = mount(React.createElement(EditModeAttributesList, { attrTypes: attrTypes, entity: entity, parentUri: parentUri }));
|
|
114
|
-
var button = component.find(MoreAttributesButton);
|
|
115
|
-
expect(button.prop('data').includes(attributesList[1])).toBe(false);
|
|
139
|
+
setUp();
|
|
140
|
+
screen.getByText('More attributes');
|
|
141
|
+
var attributeLabels = screen.getAllByTestId('reltio-attribute-label');
|
|
142
|
+
expect(attributeLabels).toHaveLength(3);
|
|
143
|
+
expect(attributeLabels[0]).toHaveTextContent('Role');
|
|
144
|
+
expect(attributeLabels[1]).toHaveTextContent('Name*');
|
|
145
|
+
expect(attributeLabels[2]).toHaveTextContent('Required*');
|
|
146
|
+
var attributes = screen.getAllByTestId('reltio-edit-attribute');
|
|
147
|
+
expect(attributes).toHaveLength(4);
|
|
148
|
+
expect(within(attributes[0]).getByRole('textbox')).toHaveValue('');
|
|
149
|
+
expect(within(attributes[1]).getByRole('textbox')).toHaveValue('Some role');
|
|
150
|
+
expect(within(attributes[2]).getByRole('textbox')).toHaveValue('');
|
|
151
|
+
expect(within(attributes[3]).getByRole('textbox')).toHaveValue('');
|
|
116
152
|
});
|
|
153
|
+
it('should not add to more attr types single value types with non-empty attr value', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
154
|
+
var attrTypes, props, user;
|
|
155
|
+
return __generator(this, function (_a) {
|
|
156
|
+
switch (_a.label) {
|
|
157
|
+
case 0:
|
|
158
|
+
attrTypes = adjust(1, assoc('singleValue', true), attributesList);
|
|
159
|
+
props = __assign(__assign({}, defaultProps), { attrTypes: attrTypes });
|
|
160
|
+
user = setUp({ props: props }).user;
|
|
161
|
+
return [4 /*yield*/, user.click(screen.getByText('More attributes'))];
|
|
162
|
+
case 1:
|
|
163
|
+
_a.sent();
|
|
164
|
+
expect(within(screen.getByRole('presentation')).queryByText('Name')).not.toBeInTheDocument();
|
|
165
|
+
return [2 /*return*/];
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
}); });
|
|
117
169
|
it('should not add to more attr types single value types in showEmptyEditors mode if they did not have deletions', function () {
|
|
118
170
|
var attrTypes = Object.values(ActivenessAttrTypes);
|
|
119
|
-
var
|
|
120
|
-
|
|
171
|
+
var props = __assign(__assign({}, defaultProps), { attrTypes: attrTypes, showEmptyEditors: true });
|
|
172
|
+
setUp({ props: props });
|
|
173
|
+
expect(screen.queryByText('More attributes')).not.toBeInTheDocument();
|
|
121
174
|
});
|
|
122
|
-
it('should add to more attr types single value types in showEmptyEditors mode if they had deletions', function () {
|
|
123
|
-
var
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
175
|
+
it('should add to more attr types single value types in showEmptyEditors mode if they had deletions', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
176
|
+
var attrTypes, props, user, menuItems;
|
|
177
|
+
return __generator(this, function (_a) {
|
|
178
|
+
switch (_a.label) {
|
|
179
|
+
case 0:
|
|
180
|
+
attrTypes = Object.values(ActivenessAttrTypes);
|
|
181
|
+
props = __assign(__assign({}, defaultProps), { attrTypes: attrTypes, showEmptyEditors: true });
|
|
182
|
+
user = setUp({ props: props }).user;
|
|
183
|
+
return [4 /*yield*/, user.click(screen.getAllByTestId('reltio-delete-simple-attribute-button')[0])];
|
|
184
|
+
case 1:
|
|
185
|
+
_a.sent();
|
|
186
|
+
return [4 /*yield*/, user.click(screen.getByText('More attributes'))];
|
|
187
|
+
case 2:
|
|
188
|
+
_a.sent();
|
|
189
|
+
menuItems = screen.getAllByRole('menuitem');
|
|
190
|
+
expect(menuItems).toHaveLength(1);
|
|
191
|
+
expect(menuItems[0]).toHaveTextContent('Start date');
|
|
192
|
+
return [2 /*return*/];
|
|
193
|
+
}
|
|
130
194
|
});
|
|
131
|
-
|
|
132
|
-
expect(component.find(MoreAttributesButton).length).toBe(1);
|
|
133
|
-
expect(component.find(MoreAttributesButton).prop('data')).toEqual([attrTypes[0]]);
|
|
134
|
-
expect(component.find(HasDeletionsContext.Provider).prop('value').hasDeletionsMap).toEqual((_a = {},
|
|
135
|
-
_a[attrTypes[0].uri] = true,
|
|
136
|
-
_a));
|
|
137
|
-
});
|
|
195
|
+
}); });
|
|
138
196
|
it('should not render pagers for attribute type without CREATE permission', function () {
|
|
139
197
|
var attrTypes = __spreadArray([], attributesList, true);
|
|
140
198
|
attrTypes[0] = __assign({}, attrTypes[0]);
|
|
141
199
|
attrTypes[3] = __assign({}, attrTypes[3]);
|
|
142
200
|
attrTypes[0].access = ['DELETE', 'UPDATE'];
|
|
143
201
|
attrTypes[3].access = ['INITIATE_CHANGE_REQUEST'];
|
|
144
|
-
var
|
|
145
|
-
|
|
146
|
-
expect(
|
|
147
|
-
expect(pager.prop('attributeType').hidden).toBeFalsy();
|
|
202
|
+
var props = __assign(__assign({}, defaultProps), { attrTypes: attrTypes });
|
|
203
|
+
setUp({ props: props });
|
|
204
|
+
expect(screen.getAllByTestId('reltio-edit-attribute')).toHaveLength(1);
|
|
148
205
|
});
|
|
149
206
|
it('should not render pager for not required attribute type with only ov=false values', function () {
|
|
150
207
|
var attrTypes = [
|
|
@@ -157,7 +214,7 @@ describe('EditModeAttributesList tests', function () {
|
|
|
157
214
|
uri: 'configuration/entityTypes/HCP/attributes/Name'
|
|
158
215
|
}
|
|
159
216
|
];
|
|
160
|
-
var
|
|
217
|
+
var entity = __assign(__assign({}, defaultEntity), { attributes: {
|
|
161
218
|
Name: [
|
|
162
219
|
{
|
|
163
220
|
ov: false,
|
|
@@ -173,9 +230,9 @@ describe('EditModeAttributesList tests', function () {
|
|
|
173
230
|
}
|
|
174
231
|
]
|
|
175
232
|
} });
|
|
176
|
-
var
|
|
177
|
-
|
|
178
|
-
expect(
|
|
233
|
+
var props = __assign(__assign({}, defaultProps), { entity: entity, attrTypes: attrTypes });
|
|
234
|
+
setUp({ props: props });
|
|
235
|
+
expect(screen.queryByTestId('reltio-edit-attribute')).not.toBeInTheDocument();
|
|
179
236
|
});
|
|
180
237
|
it('should render pager for not required attribute type with ov=false values if showNonOv is true', function () {
|
|
181
238
|
var attrTypes = [
|
|
@@ -188,7 +245,7 @@ describe('EditModeAttributesList tests', function () {
|
|
|
188
245
|
uri: 'configuration/entityTypes/HCP/attributes/Name'
|
|
189
246
|
}
|
|
190
247
|
];
|
|
191
|
-
var
|
|
248
|
+
var entity = __assign(__assign({}, defaultEntity), { attributes: {
|
|
192
249
|
Name: [
|
|
193
250
|
{
|
|
194
251
|
ov: false,
|
|
@@ -198,10 +255,9 @@ describe('EditModeAttributesList tests', function () {
|
|
|
198
255
|
}
|
|
199
256
|
]
|
|
200
257
|
} });
|
|
201
|
-
var
|
|
202
|
-
|
|
203
|
-
expect(
|
|
204
|
-
expect(pager.prop('showNonOv')).toBe(true);
|
|
258
|
+
var props = __assign(__assign({}, defaultProps), { entity: entity, attrTypes: attrTypes, showNonOv: true });
|
|
259
|
+
setUp({ props: props });
|
|
260
|
+
expect(screen.getAllByTestId('reltio-edit-attribute')).toHaveLength(1);
|
|
205
261
|
});
|
|
206
262
|
it('should render pager for required attribute type with only ov=false values', function () {
|
|
207
263
|
var attrTypes = [
|
|
@@ -214,7 +270,7 @@ describe('EditModeAttributesList tests', function () {
|
|
|
214
270
|
uri: 'configuration/entityTypes/HCP/attributes/Name'
|
|
215
271
|
}
|
|
216
272
|
];
|
|
217
|
-
var
|
|
273
|
+
var entity = __assign(__assign({}, defaultEntity), { attributes: {
|
|
218
274
|
Name: [
|
|
219
275
|
{
|
|
220
276
|
ov: false,
|
|
@@ -230,9 +286,9 @@ describe('EditModeAttributesList tests', function () {
|
|
|
230
286
|
}
|
|
231
287
|
]
|
|
232
288
|
} });
|
|
233
|
-
var
|
|
234
|
-
|
|
235
|
-
expect(
|
|
289
|
+
var props = __assign(__assign({}, defaultProps), { entity: entity, attrTypes: attrTypes });
|
|
290
|
+
setUp({ props: props });
|
|
291
|
+
expect(screen.getAllByTestId('reltio-edit-attribute')).toHaveLength(1);
|
|
236
292
|
});
|
|
237
293
|
it('should not render pager for not required attribute type without values', function () {
|
|
238
294
|
var attrTypes = [
|
|
@@ -245,115 +301,112 @@ describe('EditModeAttributesList tests', function () {
|
|
|
245
301
|
uri: 'configuration/entityTypes/HCP/attributes/Name'
|
|
246
302
|
}
|
|
247
303
|
];
|
|
248
|
-
var
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
entity: __assign(__assign({}, entity), { attributes: {} })
|
|
255
|
-
});
|
|
256
|
-
expect(component.find(EditModeAttributesPager).length).toBe(0);
|
|
304
|
+
var entity = __assign(__assign({}, defaultEntity), { attributes: { Name: [] } });
|
|
305
|
+
var props = __assign(__assign({}, defaultProps), { entity: entity, attrTypes: attrTypes });
|
|
306
|
+
var rerender = setUp({ props: props }).rerender;
|
|
307
|
+
expect(screen.queryByTestId('reltio-edit-attribute')).not.toBeInTheDocument();
|
|
308
|
+
rerender({ entity: __assign(__assign({}, defaultEntity), { attributes: {} }) });
|
|
309
|
+
expect(screen.queryByTestId('reltio-edit-attribute')).not.toBeInTheDocument();
|
|
257
310
|
});
|
|
258
|
-
it('should render
|
|
259
|
-
var parentAttributeType
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
311
|
+
it('should render "More attributes" button with parent if parentAttributeType is passed and creatable', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
312
|
+
var parentAttributeType, attrTypes, entity, props, user, menuItems;
|
|
313
|
+
return __generator(this, function (_a) {
|
|
314
|
+
switch (_a.label) {
|
|
315
|
+
case 0:
|
|
316
|
+
parentAttributeType = {
|
|
317
|
+
label: 'Taxonomy',
|
|
318
|
+
name: 'Taxonomy',
|
|
319
|
+
type: 'Nested',
|
|
320
|
+
hidden: false,
|
|
321
|
+
uri: 'configuration/entityTypes/People/attributes/Taxonomy',
|
|
322
|
+
access: ['CREATE', 'READ', 'INITIATE_CHANGE_REQUEST', 'UPDATE']
|
|
323
|
+
};
|
|
324
|
+
attrTypes = [
|
|
325
|
+
{
|
|
326
|
+
label: 'Name',
|
|
327
|
+
name: 'Name',
|
|
328
|
+
type: 'String',
|
|
329
|
+
hidden: false,
|
|
330
|
+
required: true,
|
|
331
|
+
uri: 'configuration/entityTypes/People/attributes/Taxonomy/attributes/Name',
|
|
332
|
+
access: ['CREATE', 'READ', 'INITIATE_CHANGE_REQUEST', 'UPDATE']
|
|
333
|
+
}
|
|
334
|
+
];
|
|
335
|
+
entity = __assign(__assign({}, defaultEntity), { attributes: { Name: [] } });
|
|
336
|
+
props = __assign(__assign({}, defaultProps), { entity: entity, attrTypes: attrTypes, parentAttributeType: parentAttributeType });
|
|
337
|
+
user = setUp({ props: props }).user;
|
|
338
|
+
return [4 /*yield*/, user.click(screen.getByText('More attributes'))];
|
|
339
|
+
case 1:
|
|
340
|
+
_a.sent();
|
|
341
|
+
menuItems = screen.getAllByRole('menuitem');
|
|
342
|
+
expect(menuItems).toHaveLength(2);
|
|
343
|
+
expect(menuItems[0]).toHaveTextContent('Taxonomy');
|
|
344
|
+
expect(menuItems[1]).toHaveTextContent('Name*');
|
|
345
|
+
return [2 /*return*/];
|
|
276
346
|
}
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
347
|
+
});
|
|
348
|
+
}); });
|
|
349
|
+
it('should render "More attributes" button without parent if parentAttributeType is passed but not creatable', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
350
|
+
var parentAttributeType, attrTypes, entity, props, user, menuItems;
|
|
351
|
+
return __generator(this, function (_a) {
|
|
352
|
+
switch (_a.label) {
|
|
353
|
+
case 0:
|
|
354
|
+
parentAttributeType = {
|
|
355
|
+
label: 'Taxonomy',
|
|
356
|
+
name: 'Taxonomy',
|
|
357
|
+
type: 'Nested',
|
|
358
|
+
hidden: false,
|
|
359
|
+
uri: 'configuration/entityTypes/People/attributes/Taxonomy',
|
|
360
|
+
access: ['READ', 'INITIATE_CHANGE_REQUEST', 'UPDATE']
|
|
361
|
+
};
|
|
362
|
+
attrTypes = [
|
|
363
|
+
{
|
|
364
|
+
label: 'Name',
|
|
365
|
+
name: 'Name',
|
|
366
|
+
type: 'String',
|
|
367
|
+
hidden: false,
|
|
368
|
+
required: true,
|
|
369
|
+
uri: 'configuration/entityTypes/People/attributes/Taxonomy/attributes/Name',
|
|
370
|
+
access: ['CREATE', 'READ', 'INITIATE_CHANGE_REQUEST', 'UPDATE']
|
|
371
|
+
}
|
|
372
|
+
];
|
|
373
|
+
entity = __assign(__assign({}, defaultEntity), { attributes: { Name: [] } });
|
|
374
|
+
props = __assign(__assign({}, defaultProps), { entity: entity, attrTypes: attrTypes, parentAttributeType: parentAttributeType });
|
|
375
|
+
user = setUp({ props: props }).user;
|
|
376
|
+
return [4 /*yield*/, user.click(screen.getByText('More attributes'))];
|
|
377
|
+
case 1:
|
|
378
|
+
_a.sent();
|
|
379
|
+
menuItems = screen.getAllByRole('menuitem');
|
|
380
|
+
expect(menuItems).toHaveLength(1);
|
|
381
|
+
expect(menuItems[0]).toHaveTextContent('Name*');
|
|
382
|
+
return [2 /*return*/];
|
|
304
383
|
}
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
expect(component.find(MoreAttributesButton).prop('data')).toEqual(attrTypes);
|
|
313
|
-
});
|
|
314
|
-
it('should render BranchDecorator for MoreAttributesButton with enabled=true when drawLines prop is true', function () {
|
|
315
|
-
var component = mount(React.createElement(EditModeAttributesList, { attrTypes: attributesList, entity: entity, parentUri: parentUri, drawLines: true }));
|
|
316
|
-
var decorator = component.find(BranchDecorator);
|
|
317
|
-
expect(decorator.length).toBe(1);
|
|
318
|
-
expect(decorator.prop('enabled')).toBe(true);
|
|
319
|
-
expect(decorator.prop('plain')).toBe(true);
|
|
320
|
-
expect(decorator.find(MoreAttributesButton).length).toBe(1);
|
|
384
|
+
});
|
|
385
|
+
}); });
|
|
386
|
+
it('should render branch decorator for "More attributes" button when drawLines prop is true', function () {
|
|
387
|
+
var props = __assign(__assign({}, defaultProps), { drawLines: true });
|
|
388
|
+
setUp({ props: props });
|
|
389
|
+
var decorator = screen.getAllByTestId('branch-decorator')[0];
|
|
390
|
+
within(decorator).getByText('More attributes');
|
|
321
391
|
});
|
|
322
|
-
it('should render
|
|
323
|
-
var
|
|
324
|
-
|
|
325
|
-
expect(decorator
|
|
326
|
-
expect(decorator.prop('enabled')).toBe(false);
|
|
327
|
-
expect(decorator.prop('plain')).toBe(true);
|
|
328
|
-
expect(decorator.find(MoreAttributesButton).length).toBe(1);
|
|
392
|
+
it('should not render branch decorator for "More attributes" button when drawLines prop is false', function () {
|
|
393
|
+
var props = __assign(__assign({}, defaultProps), { drawLines: false });
|
|
394
|
+
setUp({ props: props });
|
|
395
|
+
expect(screen.queryByTestId('branch-decorator')).not.toBeInTheDocument();
|
|
329
396
|
});
|
|
330
|
-
it('should render
|
|
397
|
+
it('should render branch decorator for children', function () {
|
|
331
398
|
var Child = function () { return React.createElement("span", null, "children"); };
|
|
332
|
-
var
|
|
333
|
-
|
|
334
|
-
var decorators =
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
expect(decorators.at(0).prop('plain')).toBeFalsy();
|
|
338
|
-
expect(decorators.at(0).find(Child).length).toBe(1);
|
|
339
|
-
expect(decorators.at(1).prop('enabled')).toBe(true);
|
|
340
|
-
expect(decorators.at(1).prop('plain')).toBe(true);
|
|
341
|
-
expect(decorators.at(1).find(MoreAttributesButton).length).toBe(1);
|
|
399
|
+
var props = __assign(__assign({}, defaultProps), { drawLines: true, children: React.createElement(Child, null) });
|
|
400
|
+
setUp({ props: props });
|
|
401
|
+
var decorators = screen.getAllByTestId('branch-decorator');
|
|
402
|
+
within(decorators[0]).getByText('children');
|
|
403
|
+
within(decorators[1]).getByText('More attributes');
|
|
342
404
|
});
|
|
343
|
-
it('should
|
|
344
|
-
var pinnedAttributes = ['
|
|
345
|
-
var
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
expect(getAttributesListForEditMode).toHaveBeenCalledWith({
|
|
350
|
-
attrTypes: attributesList,
|
|
351
|
-
mode: Mode.Editing,
|
|
352
|
-
entity: entity,
|
|
353
|
-
pinnedAttributes: pinnedAttributes,
|
|
354
|
-
configCanCreate: true,
|
|
355
|
-
alwaysVisible: [],
|
|
356
|
-
isTemporary: false
|
|
357
|
-
});
|
|
405
|
+
it('should pin attributes correctly', function () {
|
|
406
|
+
var pinnedAttributes = ['configuration/relationTypes/knowledge/attributes/Required'];
|
|
407
|
+
var attrTypes = adjust(3, assoc('required', false), attributesList);
|
|
408
|
+
var props = __assign(__assign({}, defaultProps), { attrTypes: attrTypes });
|
|
409
|
+
setUp({ props: props, pinnedAttributesContextValue: pinnedAttributes });
|
|
410
|
+
screen.getByText('Required');
|
|
358
411
|
});
|
|
359
412
|
});
|
|
@@ -5,24 +5,13 @@ export declare const attributesList: ({
|
|
|
5
5
|
hidden: boolean;
|
|
6
6
|
required: boolean;
|
|
7
7
|
uri: string;
|
|
8
|
-
lookupCode: string;
|
|
9
8
|
access: string[];
|
|
10
9
|
} | {
|
|
11
10
|
label: string;
|
|
12
|
-
name: string;
|
|
13
|
-
type: string;
|
|
14
|
-
hidden: boolean;
|
|
15
|
-
required: boolean;
|
|
16
|
-
uri: string;
|
|
17
|
-
access: string[];
|
|
18
|
-
lookupCode?: undefined;
|
|
19
|
-
} | {
|
|
20
11
|
name: string;
|
|
21
12
|
type: string;
|
|
22
13
|
required: boolean;
|
|
23
14
|
uri: string;
|
|
24
15
|
access: string[];
|
|
25
|
-
label?: undefined;
|
|
26
16
|
hidden?: undefined;
|
|
27
|
-
lookupCode?: undefined;
|
|
28
17
|
})[];
|
|
@@ -6,7 +6,6 @@ export var attributesList = [
|
|
|
6
6
|
hidden: false,
|
|
7
7
|
required: false,
|
|
8
8
|
uri: 'configuration/relationTypes/knowledge/attributes/Role',
|
|
9
|
-
lookupCode: 'rdm/lookupTypes/Role_knowledge',
|
|
10
9
|
access: ['CREATE', 'READ', 'INITIATE_CHANGE_REQUEST', 'UPDATE']
|
|
11
10
|
},
|
|
12
11
|
{
|
|
@@ -28,6 +27,7 @@ export var attributesList = [
|
|
|
28
27
|
access: ['CREATE', 'READ', 'INITIATE_CHANGE_REQUEST', 'UPDATE']
|
|
29
28
|
},
|
|
30
29
|
{
|
|
30
|
+
label: 'Required',
|
|
31
31
|
name: 'Required',
|
|
32
32
|
type: 'String',
|
|
33
33
|
required: true,
|