@reltio/components 1.4.2050 → 1.4.2052
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/AttributeListItem/AttributeListItem.d.ts +1 -1
- package/ChartTooltip/ChartTooltip.js +3 -3
- package/ColumnsSettings/ColumnsSettings.d.ts +2 -1
- package/ColumnsSettings/ColumnsSettings.js +2 -2
- package/ColumnsSettings/ColumnsSettings.test.js +14 -0
- package/ColumnsSettings/components/ColumnListItem/ColumnListItem.d.ts +11 -26
- package/ColumnsSettings/components/ColumnListItem/ColumnListItem.js +0 -14
- package/ColumnsSettings/components/ColumnsSettingsPopup/ColumnsSettingsPopup.d.ts +2 -1
- package/ColumnsSettings/components/ColumnsSettingsPopup/ColumnsSettingsPopup.js +2 -2
- package/DropDownMenuButton/DropDownMenuButton.js +1 -1
- package/HOCs/withAsyncMount/withAsyncMount.test.js +52 -52
- package/IgnoreButton/IgnoreButton.spec.js +109 -20
- package/Image/Image.d.ts +1 -1
- package/Image/Image.js +8 -8
- package/Image/Image.test.js +46 -51
- package/ImageActionsOverlay/ImageActionsOverlay.js +2 -1
- package/ImageActionsOverlay/ImageActionsOverlay.test.js +207 -125
- package/ImageActionsOverlay/components/CheckedIcon/CheckedIcon.js +1 -1
- package/ImageAttributesGallery/ImageAttributesGallery.test.js +525 -281
- package/ImageAttributesLine/ImageAttributesLine.js +1 -1
- package/ImageAttributesLine/ImageAttributesLine.test.js +187 -193
- package/ImageAttributesLine/imageAttributeValues.test-data.d.ts +10 -0
- package/ImageAttributesLine/imageAttributeValues.test-data.js +22 -0
- package/ImageAttributesLineEditor/ImageAttributesLineEditor.test.js +315 -298
- package/ImageDetailsView/ImageDetailsView.test.js +529 -55
- package/ImageDetailsView/attributes.test-data.d.ts +4 -1
- package/ImageDetailsView/attributes.test-data.js +98 -1
- package/ImageDetailsView/components/ImageDetailsViewCarousel/ImageDetailsViewCarousel.js +2 -2
- package/ImageDetailsView/components/MetaInfoItem/MetaInfoItem.js +1 -1
- package/ImageDetailsView/components/MetaInfoList/MetaInfoList.js +1 -1
- package/ImageDetailsView/components/Thumbnails/Thumbnails.js +1 -1
- package/ImageDetailsView/helpers.test.js +4 -4
- package/ImageGalleryDialog/ImageGalleryDialog.test.js +89 -46
- package/ImportButton/ImportButton.test.js +94 -24
- package/InlineAttributesList/InlineAttributesList.test.js +22 -62
- package/InlineAttributesList/attributes.test-data.d.ts +4 -2
- package/InlineAttributesList/attributes.test-data.js +40 -1
- package/InlineAttributesPager/InlineAttributesPager.d.ts +1 -2
- package/InlineAttributesPager/InlineAttributesPager.js +1 -4
- package/InlineAttributesPager/InlineAttributesPager.test.js +393 -183
- package/InlineComplexAttribute/InlineComplexAttribute.js +1 -1
- package/InlineComplexAttribute/InlineComplexAttribute.test.js +396 -182
- package/InlineImageAttribute/InlineImageAttribute.test.js +103 -55
- package/InlineNestedAttribute/InlineNestedAttribute.test.js +105 -43
- package/InlineReferenceAttribute/InlineReferenceAttribute.test.js +165 -107
- package/InlineSimpleAttribute/InlineSimpleAttribute.spec.js +352 -346
- package/InlineSimpleAttributeEditor/InlineSimpleAttributeEditor.test.js +285 -194
- package/InternalLink/InternalLink.test.js +41 -11
- package/LookupEditor/LookupEditor.test.js +180 -44
- package/LookupEditor/components/GroupedDropDownEditor/helpers.test.js +1 -1
- package/MapChart/MapChart.js +3 -8
- package/MapChart/MapChart.test.js +152 -188
- package/MapChart/components/Legend/Legend.js +3 -3
- package/MaskingSwitcher/MaskingSwitcher.js +1 -1
- package/MatchRulesBadge/MatchRulesBadge.test.js +93 -24
- package/SelectEditor/SelectEditor.d.ts +4 -10
- package/SelectEditor/SelectEditor.js +0 -4
- package/SelectEditor/SelectEditor.test.js +79 -9
- package/SelectionPopup/SelectionPopup.d.ts +2 -1
- package/SelectionPopup/SelectionPopup.js +3 -3
- package/SelectionPopup/SelectionPopup.spec.js +90 -30
- package/cjs/AttributeListItem/AttributeListItem.d.ts +1 -1
- package/cjs/ChartTooltip/ChartTooltip.js +3 -3
- package/cjs/ColumnsSettings/ColumnsSettings.d.ts +2 -1
- package/cjs/ColumnsSettings/ColumnsSettings.js +2 -2
- package/cjs/ColumnsSettings/ColumnsSettings.test.js +14 -0
- package/cjs/ColumnsSettings/components/ColumnListItem/ColumnListItem.d.ts +11 -26
- package/cjs/ColumnsSettings/components/ColumnListItem/ColumnListItem.js +0 -14
- package/cjs/ColumnsSettings/components/ColumnsSettingsPopup/ColumnsSettingsPopup.d.ts +2 -1
- package/cjs/ColumnsSettings/components/ColumnsSettingsPopup/ColumnsSettingsPopup.js +2 -2
- package/cjs/DropDownMenuButton/DropDownMenuButton.js +1 -1
- package/cjs/HOCs/withAsyncMount/withAsyncMount.test.js +56 -56
- package/cjs/IgnoreButton/IgnoreButton.spec.js +109 -20
- package/cjs/Image/Image.d.ts +1 -1
- package/cjs/Image/Image.js +8 -8
- package/cjs/Image/Image.test.js +46 -51
- package/cjs/ImageActionsOverlay/ImageActionsOverlay.js +2 -1
- package/cjs/ImageActionsOverlay/ImageActionsOverlay.test.js +207 -125
- package/cjs/ImageActionsOverlay/components/CheckedIcon/CheckedIcon.js +1 -1
- package/cjs/ImageAttributesGallery/ImageAttributesGallery.test.js +525 -281
- package/cjs/ImageAttributesLine/ImageAttributesLine.js +1 -1
- package/cjs/ImageAttributesLine/ImageAttributesLine.test.js +195 -224
- package/cjs/ImageAttributesLine/imageAttributeValues.test-data.d.ts +10 -0
- package/cjs/ImageAttributesLine/imageAttributeValues.test-data.js +23 -1
- package/cjs/ImageAttributesLineEditor/ImageAttributesLineEditor.test.js +316 -299
- package/cjs/ImageDetailsView/ImageDetailsView.test.js +529 -55
- package/cjs/ImageDetailsView/attributes.test-data.d.ts +4 -1
- package/cjs/ImageDetailsView/attributes.test-data.js +99 -2
- package/cjs/ImageDetailsView/components/ImageDetailsViewCarousel/ImageDetailsViewCarousel.js +2 -2
- package/cjs/ImageDetailsView/components/MetaInfoItem/MetaInfoItem.js +1 -1
- package/cjs/ImageDetailsView/components/MetaInfoList/MetaInfoList.js +1 -1
- package/cjs/ImageDetailsView/components/Thumbnails/Thumbnails.js +1 -1
- package/cjs/ImageDetailsView/helpers.test.js +3 -3
- package/cjs/ImageGalleryDialog/ImageGalleryDialog.test.js +89 -46
- package/cjs/ImportButton/ImportButton.test.js +94 -24
- package/cjs/InlineAttributesList/InlineAttributesList.test.js +22 -62
- package/cjs/InlineAttributesList/attributes.test-data.d.ts +4 -2
- package/cjs/InlineAttributesList/attributes.test-data.js +41 -2
- package/cjs/InlineAttributesPager/InlineAttributesPager.d.ts +1 -2
- package/cjs/InlineAttributesPager/InlineAttributesPager.js +1 -4
- package/cjs/InlineAttributesPager/InlineAttributesPager.test.js +393 -183
- package/cjs/InlineComplexAttribute/InlineComplexAttribute.js +1 -1
- package/cjs/InlineComplexAttribute/InlineComplexAttribute.test.js +395 -204
- package/cjs/InlineImageAttribute/InlineImageAttribute.test.js +103 -55
- package/cjs/InlineNestedAttribute/InlineNestedAttribute.test.js +105 -43
- package/cjs/InlineReferenceAttribute/InlineReferenceAttribute.test.js +164 -106
- package/cjs/InlineSimpleAttribute/InlineSimpleAttribute.spec.js +351 -345
- package/cjs/InlineSimpleAttributeEditor/InlineSimpleAttributeEditor.test.js +307 -193
- package/cjs/InternalLink/InternalLink.test.js +40 -10
- package/cjs/LookupEditor/LookupEditor.test.js +178 -65
- package/cjs/LookupEditor/components/GroupedDropDownEditor/helpers.test.js +1 -1
- package/cjs/MapChart/MapChart.js +3 -8
- package/cjs/MapChart/MapChart.test.js +152 -188
- package/cjs/MapChart/components/Legend/Legend.js +3 -3
- package/cjs/MaskingSwitcher/MaskingSwitcher.js +1 -1
- package/cjs/MatchRulesBadge/MatchRulesBadge.test.js +93 -24
- package/cjs/SelectEditor/SelectEditor.d.ts +4 -10
- package/cjs/SelectEditor/SelectEditor.js +0 -4
- package/cjs/SelectEditor/SelectEditor.test.js +79 -9
- package/cjs/SelectionPopup/SelectionPopup.d.ts +2 -1
- package/cjs/SelectionPopup/SelectionPopup.js +3 -3
- package/cjs/SelectionPopup/SelectionPopup.spec.js +90 -30
- package/cjs/hooks/useAsyncMount/useAsyncMount.d.ts +1 -1
- package/cjs/hooks/useAsyncMount/useAsyncMount.js +1 -1
- package/hooks/useAsyncMount/useAsyncMount.d.ts +1 -1
- package/hooks/useAsyncMount/useAsyncMount.js +1 -1
- package/package.json +1 -1
- package/HOCs/withTableContext/withTableContext.test.d.ts +0 -1
- package/HOCs/withTableContext/withTableContext.test.js +0 -41
- package/ImageAttributesGallery/components/GalleryView/GalleryView.test.d.ts +0 -1
- package/ImageAttributesGallery/components/GalleryView/GalleryView.test.js +0 -98
- package/ImageDetailsView/components/ImageDetailsViewCarousel/ImageDetailsViewCarousel.test.d.ts +0 -1
- package/ImageDetailsView/components/ImageDetailsViewCarousel/ImageDetailsViewCarousel.test.js +0 -99
- package/ImageDetailsView/components/ImageDetailsViewSidebar/ImageDetailsViewSidebar.test.d.ts +0 -1
- package/ImageDetailsView/components/ImageDetailsViewSidebar/ImageDetailsViewSidebar.test.js +0 -65
- package/ImageDetailsView/components/MetaInfo/MetaInfo.test.d.ts +0 -1
- package/ImageDetailsView/components/MetaInfo/MetaInfo.test.js +0 -306
- package/ImageDetailsView/components/MetaInfoForm/MetaInfoForm.test.d.ts +0 -1
- package/ImageDetailsView/components/MetaInfoForm/MetaInfoForm.test.js +0 -134
- package/ImageDetailsView/components/MetaInfoHeader/MetaInfoHeader.test.d.ts +0 -1
- package/ImageDetailsView/components/MetaInfoHeader/MetaInfoHeader.test.js +0 -99
- package/ImageDetailsView/components/MetaInfoItem/MetaInfoItem.test.d.ts +0 -1
- package/ImageDetailsView/components/MetaInfoItem/MetaInfoItem.test.js +0 -36
- package/ImageDetailsView/components/MetaInfoList/MetaInfoList.test.d.ts +0 -1
- package/ImageDetailsView/components/MetaInfoList/MetaInfoList.test.js +0 -161
- package/ImageDetailsView/components/Thumbnails/Thumbnails.test.d.ts +0 -1
- package/ImageDetailsView/components/Thumbnails/Thumbnails.test.js +0 -76
- package/InlineAttributesPager/components/InlineImageAttributesBlock/InlineImageAttributesBlock.test.d.ts +0 -1
- package/InlineAttributesPager/components/InlineImageAttributesBlock/InlineImageAttributesBlock.test.js +0 -104
- package/InlineAttributesPager/components/InlineNestedAttributesBlock/InlineNestedAttributesBlock.test.d.ts +0 -1
- package/InlineAttributesPager/components/InlineNestedAttributesBlock/InlineNestedAttributesBlock.test.js +0 -114
- package/InlineAttributesPager/components/InlineReferenceAttributesBlock/InlineReferenceAttributesBlock.test.d.ts +0 -1
- package/InlineAttributesPager/components/InlineReferenceAttributesBlock/InlineReferenceAttributesBlock.test.js +0 -177
- package/InlineSimpleAttribute/components/CrosswalkMenuItem/CrosswalkMenuItem.spec.d.ts +0 -1
- package/InlineSimpleAttribute/components/CrosswalkMenuItem/CrosswalkMenuItem.spec.js +0 -52
- package/LookupEditor/components/GroupedDropDownEditor/GroupedDropDownEditor.test.d.ts +0 -1
- package/LookupEditor/components/GroupedDropDownEditor/GroupedDropDownEditor.test.js +0 -37
- package/cjs/HOCs/withTableContext/withTableContext.test.d.ts +0 -1
- package/cjs/HOCs/withTableContext/withTableContext.test.js +0 -46
- package/cjs/ImageAttributesGallery/components/GalleryView/GalleryView.test.d.ts +0 -1
- package/cjs/ImageAttributesGallery/components/GalleryView/GalleryView.test.js +0 -103
- package/cjs/ImageDetailsView/components/ImageDetailsViewCarousel/ImageDetailsViewCarousel.test.d.ts +0 -1
- package/cjs/ImageDetailsView/components/ImageDetailsViewCarousel/ImageDetailsViewCarousel.test.js +0 -104
- package/cjs/ImageDetailsView/components/ImageDetailsViewSidebar/ImageDetailsViewSidebar.test.d.ts +0 -1
- package/cjs/ImageDetailsView/components/ImageDetailsViewSidebar/ImageDetailsViewSidebar.test.js +0 -70
- package/cjs/ImageDetailsView/components/MetaInfo/MetaInfo.test.d.ts +0 -1
- package/cjs/ImageDetailsView/components/MetaInfo/MetaInfo.test.js +0 -311
- package/cjs/ImageDetailsView/components/MetaInfoForm/MetaInfoForm.test.d.ts +0 -1
- package/cjs/ImageDetailsView/components/MetaInfoForm/MetaInfoForm.test.js +0 -139
- package/cjs/ImageDetailsView/components/MetaInfoHeader/MetaInfoHeader.test.d.ts +0 -1
- package/cjs/ImageDetailsView/components/MetaInfoHeader/MetaInfoHeader.test.js +0 -104
- package/cjs/ImageDetailsView/components/MetaInfoItem/MetaInfoItem.test.d.ts +0 -1
- package/cjs/ImageDetailsView/components/MetaInfoItem/MetaInfoItem.test.js +0 -41
- package/cjs/ImageDetailsView/components/MetaInfoList/MetaInfoList.test.d.ts +0 -1
- package/cjs/ImageDetailsView/components/MetaInfoList/MetaInfoList.test.js +0 -166
- package/cjs/ImageDetailsView/components/Thumbnails/Thumbnails.test.d.ts +0 -1
- package/cjs/ImageDetailsView/components/Thumbnails/Thumbnails.test.js +0 -81
- package/cjs/InlineAttributesPager/components/InlineImageAttributesBlock/InlineImageAttributesBlock.test.d.ts +0 -1
- package/cjs/InlineAttributesPager/components/InlineImageAttributesBlock/InlineImageAttributesBlock.test.js +0 -109
- package/cjs/InlineAttributesPager/components/InlineNestedAttributesBlock/InlineNestedAttributesBlock.test.d.ts +0 -1
- package/cjs/InlineAttributesPager/components/InlineNestedAttributesBlock/InlineNestedAttributesBlock.test.js +0 -119
- package/cjs/InlineAttributesPager/components/InlineReferenceAttributesBlock/InlineReferenceAttributesBlock.test.d.ts +0 -1
- package/cjs/InlineAttributesPager/components/InlineReferenceAttributesBlock/InlineReferenceAttributesBlock.test.js +0 -182
- package/cjs/InlineSimpleAttribute/components/CrosswalkMenuItem/CrosswalkMenuItem.spec.d.ts +0 -1
- package/cjs/InlineSimpleAttribute/components/CrosswalkMenuItem/CrosswalkMenuItem.spec.js +0 -57
- package/cjs/LookupEditor/components/GroupedDropDownEditor/GroupedDropDownEditor.test.d.ts +0 -1
- package/cjs/LookupEditor/components/GroupedDropDownEditor/GroupedDropDownEditor.test.js +0 -42
|
@@ -9,66 +9,540 @@ 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
|
import React from 'react';
|
|
13
|
-
import {
|
|
14
|
-
import
|
|
15
|
-
import {
|
|
49
|
+
import { render, screen, within } from '@testing-library/react';
|
|
50
|
+
import userEvent from '@testing-library/user-event';
|
|
51
|
+
import { Mode } from '@reltio/mdm-sdk';
|
|
16
52
|
import { ImageDetailsView } from './ImageDetailsView';
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
jest.
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
53
|
+
import { MdmModuleProvider } from '../contexts/MdmModuleContext';
|
|
54
|
+
import { attributeType, complexAttributeValues, simpleAttributeValues, smallCombinedAttributeValues } from './attributes.test-data';
|
|
55
|
+
var defaultProps = {
|
|
56
|
+
setCurrentAttributeValueUri: jest.fn(),
|
|
57
|
+
handleSetAsDefault: jest.fn(),
|
|
58
|
+
currentAttributeValueUri: 'entities/mnGiTyT/attributes/ImageGallery/4',
|
|
59
|
+
attributeType: attributeType,
|
|
60
|
+
attributeValues: simpleAttributeValues
|
|
61
|
+
};
|
|
62
|
+
var defaultMdmModuleValues = {
|
|
63
|
+
dependentLookups: {
|
|
64
|
+
editors: {},
|
|
65
|
+
structure: {},
|
|
66
|
+
initedTypeUris: []
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
var defaultMdmModuleActions = {
|
|
70
|
+
modifyAttribute: jest.fn()
|
|
71
|
+
};
|
|
72
|
+
var setUp = function (_a) {
|
|
73
|
+
var _b = _a === void 0 ? {} : _a, _c = _b.props, props = _c === void 0 ? {} : _c, _d = _b.mdmModuleValues, mdmModuleValues = _d === void 0 ? {} : _d;
|
|
74
|
+
var user = userEvent.setup();
|
|
75
|
+
var Providers = function (_a) {
|
|
76
|
+
var children = _a.children;
|
|
77
|
+
return (React.createElement(MdmModuleProvider, { values: __assign(__assign({}, defaultMdmModuleValues), mdmModuleValues), actions: defaultMdmModuleActions }, children));
|
|
32
78
|
};
|
|
79
|
+
return __assign({ user: user }, render(React.createElement(ImageDetailsView, __assign({}, defaultProps, props)), { wrapper: Providers }));
|
|
80
|
+
};
|
|
81
|
+
describe('DetailsView tests', function () {
|
|
82
|
+
beforeEach(function () {
|
|
83
|
+
jest.clearAllMocks();
|
|
84
|
+
});
|
|
33
85
|
it('should render DetailsViewSidebar and DetailsViewCarousel with current props', function () {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
setCurrentAttributeValueUri: setCurrentAttributeValueUri,
|
|
42
|
-
attributeValues: attributeValues,
|
|
43
|
-
currentAttributeValueUri: currentAttributeValueUri,
|
|
44
|
-
handleSetAsDefault: handleSetAsDefault,
|
|
45
|
-
attributeType: attributeType
|
|
46
|
-
};
|
|
47
|
-
var component = mount(React.createElement(ImageDetailsView, __assign({}, props)));
|
|
48
|
-
var detailsViewCarousel = component.find(ImageDetailsViewCarousel);
|
|
49
|
-
expect(detailsViewCarousel.length).toBe(1);
|
|
50
|
-
expect(detailsViewCarousel.prop('attributeValueIndex')).toBe(0);
|
|
51
|
-
expect(detailsViewCarousel.prop('attributeValues')).toStrictEqual(attributeValues);
|
|
52
|
-
var detailsViewSidebar = component.find(ImageDetailsViewSidebar);
|
|
53
|
-
expect(detailsViewSidebar.length).toBe(1);
|
|
54
|
-
expect(detailsViewSidebar.prop('attributeValue')).toStrictEqual(attributeValues[0]);
|
|
86
|
+
setUp();
|
|
87
|
+
expect(screen.getByTestId('thumbnails-container').childNodes).toHaveLength(5);
|
|
88
|
+
expect(screen.getByText('Details')).toBeInTheDocument();
|
|
89
|
+
expect(screen.getByText('Set as default')).toBeInTheDocument();
|
|
90
|
+
expect(screen.getByText('Meta info')).toBeInTheDocument();
|
|
91
|
+
expect(screen.getByText('Mime Type')).toBeInTheDocument();
|
|
92
|
+
expect(screen.getByText('image/jpg')).toBeInTheDocument();
|
|
55
93
|
});
|
|
56
94
|
it('should render DetailsViewSidebar and DetailsViewCarousel with current props if attributeValues empty', function () {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
95
|
+
setUp({ props: { attributeValues: [] } });
|
|
96
|
+
expect(screen.queryByText('thumbnails-container')).not.toBeInTheDocument();
|
|
97
|
+
expect(screen.getByText('Details')).toBeInTheDocument();
|
|
98
|
+
expect(screen.getByText('Set as default')).toBeInTheDocument();
|
|
99
|
+
expect(screen.getByText('Meta info')).toBeInTheDocument();
|
|
100
|
+
expect(screen.queryByText('Mime Type')).not.toBeInTheDocument();
|
|
101
|
+
expect(screen.queryByText('image/jpg')).not.toBeInTheDocument();
|
|
102
|
+
});
|
|
103
|
+
describe('carousel tests', function () {
|
|
104
|
+
it('should render 5 images and render correct main image', function () {
|
|
105
|
+
var container = setUp().container;
|
|
106
|
+
expect(screen.getByTestId('thumbnails-container').childNodes).toHaveLength(5);
|
|
107
|
+
expect(container.querySelector('img.mainImage')).toHaveAttribute('src', '#3');
|
|
108
|
+
});
|
|
109
|
+
it('should change currentImageIndex on prevButtonClick', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
110
|
+
var _a, container, user;
|
|
111
|
+
return __generator(this, function (_b) {
|
|
112
|
+
switch (_b.label) {
|
|
113
|
+
case 0:
|
|
114
|
+
_a = setUp(), container = _a.container, user = _a.user;
|
|
115
|
+
expect(container.querySelector('img.mainImage')).toHaveAttribute('src', '#3');
|
|
116
|
+
return [4 /*yield*/, user.click(screen.getByTestId('prev-image-button'))];
|
|
117
|
+
case 1:
|
|
118
|
+
_b.sent();
|
|
119
|
+
expect(container.querySelector('img.mainImage')).toHaveAttribute('src', '#2');
|
|
120
|
+
return [2 /*return*/];
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
}); });
|
|
124
|
+
it('should change currentImageIndex on nextButtonClick', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
125
|
+
var _a, container, user;
|
|
126
|
+
return __generator(this, function (_b) {
|
|
127
|
+
switch (_b.label) {
|
|
128
|
+
case 0:
|
|
129
|
+
_a = setUp(), container = _a.container, user = _a.user;
|
|
130
|
+
expect(container.querySelector('img.mainImage')).toHaveAttribute('src', '#3');
|
|
131
|
+
return [4 /*yield*/, user.click(screen.getByTestId('next-image-button'))];
|
|
132
|
+
case 1:
|
|
133
|
+
_b.sent();
|
|
134
|
+
expect(container.querySelector('img.mainImage')).toHaveAttribute('src', '#4');
|
|
135
|
+
return [2 /*return*/];
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
}); });
|
|
139
|
+
it('should change currentImageIndex on click on image at carousel', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
140
|
+
var _a, user, container, firstThumbnail;
|
|
141
|
+
return __generator(this, function (_b) {
|
|
142
|
+
switch (_b.label) {
|
|
143
|
+
case 0:
|
|
144
|
+
_a = setUp(), user = _a.user, container = _a.container;
|
|
145
|
+
firstThumbnail = within(screen.getByTestId('thumbnails-container')).getAllByTestId('SvgDefaultImage')[0];
|
|
146
|
+
return [4 /*yield*/, user.click(firstThumbnail)];
|
|
147
|
+
case 1:
|
|
148
|
+
_b.sent();
|
|
149
|
+
expect(container.querySelector('img.mainImage')).toHaveAttribute('src', '#0');
|
|
150
|
+
return [2 /*return*/];
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
}); });
|
|
154
|
+
it('should not render prev button if current image is first', function () {
|
|
155
|
+
setUp({ props: { currentAttributeValueUri: 'entities/mnGiTyT/attributes/ImageGallery/1' } });
|
|
156
|
+
expect(screen.queryByTestId('prev-image-button')).not.toBeInTheDocument();
|
|
157
|
+
});
|
|
158
|
+
it('should not render next button if current image is last', function () {
|
|
159
|
+
setUp({ props: { currentAttributeValueUri: 'entities/mnGiTyT/attributes/ImageGallery/5' } });
|
|
160
|
+
expect(screen.queryByTestId('next-image-button')).not.toBeInTheDocument();
|
|
161
|
+
});
|
|
162
|
+
});
|
|
163
|
+
describe('sidebar tests', function () {
|
|
164
|
+
it('should call handleSetAsDefault on click on "Set as default" button', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
165
|
+
var user;
|
|
166
|
+
return __generator(this, function (_a) {
|
|
167
|
+
switch (_a.label) {
|
|
168
|
+
case 0:
|
|
169
|
+
user = setUp().user;
|
|
170
|
+
return [4 /*yield*/, user.click(screen.getByText('Set as default'))];
|
|
171
|
+
case 1:
|
|
172
|
+
_a.sent();
|
|
173
|
+
expect(defaultProps.handleSetAsDefault).toHaveBeenCalledWith(defaultProps.currentAttributeValueUri);
|
|
174
|
+
return [2 /*return*/];
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
}); });
|
|
178
|
+
it('should render system and non-system attributes in view mode', function () {
|
|
179
|
+
setUp({
|
|
180
|
+
props: {
|
|
181
|
+
attributeValues: complexAttributeValues,
|
|
182
|
+
currentAttributeValueUri: 'entities/mnGiTyT/attributes/ImageGallery/1'
|
|
183
|
+
},
|
|
184
|
+
mdmModuleValues: { mode: Mode.Viewing }
|
|
185
|
+
});
|
|
186
|
+
expect(screen.getByText('Details')).toBeInTheDocument();
|
|
187
|
+
expect(screen.getByText('Meta info')).toBeInTheDocument();
|
|
188
|
+
expect(screen.queryByText('Attributes')).not.toBeInTheDocument();
|
|
189
|
+
var metaItems = screen.getAllByTestId('image-meta-info-item');
|
|
190
|
+
expect(metaItems).toHaveLength(11);
|
|
191
|
+
var _a = screen.getAllByTestId('one-line-renderer'), stringRenderer = _a[0], longRenderer = _a[1];
|
|
192
|
+
expect(stringRenderer).toHaveTextContent('String');
|
|
193
|
+
expect(longRenderer).toHaveTextContent('Long');
|
|
194
|
+
expect(metaItems.map(function (item) { return item.textContent; })).toEqual([
|
|
195
|
+
expect.stringContaining('Creation Time'),
|
|
196
|
+
'Creation Date06-09-2021',
|
|
197
|
+
'Dimensions500 x 400 pixels',
|
|
198
|
+
'Mime Typeimage/png',
|
|
199
|
+
'Size5.00 KB',
|
|
200
|
+
'Full image URL (S3)link',
|
|
201
|
+
'Preview image URL (S3)link',
|
|
202
|
+
'Small image URL (S3)link',
|
|
203
|
+
'Full image URL (CDN)link',
|
|
204
|
+
'Preview image URL (CDN)link',
|
|
205
|
+
'Small image URL (CDN)link'
|
|
206
|
+
]);
|
|
207
|
+
});
|
|
208
|
+
it('should render only system attributes in editing mode', function () {
|
|
209
|
+
setUp({
|
|
210
|
+
props: {
|
|
211
|
+
attributeValues: complexAttributeValues,
|
|
212
|
+
currentAttributeValueUri: 'entities/mnGiTyT/attributes/ImageGallery/1'
|
|
213
|
+
},
|
|
214
|
+
mdmModuleValues: { mode: Mode.Editing }
|
|
215
|
+
});
|
|
216
|
+
expect(screen.getByText('Details')).toBeInTheDocument();
|
|
217
|
+
expect(screen.getByText('Meta info')).toBeInTheDocument();
|
|
218
|
+
expect(screen.getByText('Attributes')).toBeInTheDocument();
|
|
219
|
+
expect(screen.getAllByTestId('image-meta-info-item')).toHaveLength(11);
|
|
220
|
+
expect(screen.queryByTestId('one-line-renderer')).not.toBeInTheDocument();
|
|
221
|
+
});
|
|
222
|
+
it('should render only system attributes in suggesting mode', function () {
|
|
223
|
+
setUp({
|
|
224
|
+
props: {
|
|
225
|
+
attributeValues: complexAttributeValues,
|
|
226
|
+
currentAttributeValueUri: 'entities/mnGiTyT/attributes/ImageGallery/1'
|
|
227
|
+
},
|
|
228
|
+
mdmModuleValues: { mode: Mode.Suggesting }
|
|
229
|
+
});
|
|
230
|
+
expect(screen.getByText('Details')).toBeInTheDocument();
|
|
231
|
+
expect(screen.getByText('Meta info')).toBeInTheDocument();
|
|
232
|
+
expect(screen.getByText('Attributes')).toBeInTheDocument();
|
|
233
|
+
expect(screen.getAllByTestId('image-meta-info-item')).toHaveLength(11);
|
|
234
|
+
expect(screen.queryByTestId('one-line-renderer')).not.toBeInTheDocument();
|
|
235
|
+
});
|
|
236
|
+
it('should render MetaInfo without currentImage.value', function () {
|
|
237
|
+
var attributeValues = [
|
|
238
|
+
{ uri: 'entities/mnGiTyT/attributes/ImageGallery/1', value: {} }
|
|
239
|
+
];
|
|
240
|
+
setUp({ props: { attributeValues: attributeValues, currentAttributeValueUri: 'entities/mnGiTyT/attributes/ImageGallery/1' } });
|
|
241
|
+
expect(screen.getByText('Details')).toBeInTheDocument();
|
|
242
|
+
expect(screen.getByText('Meta info')).toBeInTheDocument();
|
|
243
|
+
expect(screen.queryByTestId('image-meta-info-item')).not.toBeInTheDocument();
|
|
244
|
+
});
|
|
245
|
+
it('should render MetaInfo without values', function () {
|
|
246
|
+
var attributeValues = [
|
|
247
|
+
{
|
|
248
|
+
uri: '1',
|
|
249
|
+
value: {
|
|
250
|
+
CdnUrl: [],
|
|
251
|
+
CdnUrlPreview: [],
|
|
252
|
+
CdnUrlThumbnail: [],
|
|
253
|
+
CreationTimestamp: [],
|
|
254
|
+
Height: [],
|
|
255
|
+
MimeType: [],
|
|
256
|
+
Size: [],
|
|
257
|
+
Url: [],
|
|
258
|
+
UrlPreview: [],
|
|
259
|
+
UrlThumbnail: [],
|
|
260
|
+
Width: []
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
];
|
|
264
|
+
setUp({ props: { attributeValues: attributeValues, currentAttributeValueUri: 'entities/mnGiTyT/attributes/ImageGallery/1' } });
|
|
265
|
+
expect(screen.getByText('Details')).toBeInTheDocument();
|
|
266
|
+
expect(screen.getByText('Meta info')).toBeInTheDocument();
|
|
267
|
+
expect(screen.queryByTestId('image-meta-info-item')).not.toBeInTheDocument();
|
|
268
|
+
});
|
|
269
|
+
it('should not show add attributes button in viewing mode', function () {
|
|
270
|
+
setUp({ mdmModuleValues: { mode: Mode.Viewing } });
|
|
271
|
+
expect(screen.queryByText('Attributes')).not.toBeInTheDocument();
|
|
272
|
+
});
|
|
273
|
+
it('should show add attributes button in editing mode', function () {
|
|
274
|
+
setUp({
|
|
275
|
+
props: {
|
|
276
|
+
attributeValues: smallCombinedAttributeValues,
|
|
277
|
+
currentAttributeValueUri: 'entities/mnGiTyT/attributes/ImageGallery/1'
|
|
278
|
+
},
|
|
279
|
+
mdmModuleValues: { mode: Mode.Editing }
|
|
280
|
+
});
|
|
281
|
+
expect(screen.getByText('Attributes')).toBeInTheDocument();
|
|
282
|
+
expect(screen.getByText('String')).toBeInTheDocument();
|
|
283
|
+
expect(screen.getByRole('textbox')).toHaveValue('String123');
|
|
284
|
+
expect(screen.getByText('Cancel')).toBeDisabled();
|
|
285
|
+
expect(screen.getByText('Apply')).toBeDisabled();
|
|
286
|
+
});
|
|
287
|
+
it('should show add attributes button in suggesting mode', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
288
|
+
return __generator(this, function (_a) {
|
|
289
|
+
setUp({
|
|
290
|
+
props: {
|
|
291
|
+
attributeValues: smallCombinedAttributeValues,
|
|
292
|
+
currentAttributeValueUri: 'entities/mnGiTyT/attributes/ImageGallery/1'
|
|
293
|
+
},
|
|
294
|
+
mdmModuleValues: { mode: Mode.Suggesting }
|
|
295
|
+
});
|
|
296
|
+
expect(screen.getByText('Attributes')).toBeInTheDocument();
|
|
297
|
+
expect(screen.getByText('String')).toBeInTheDocument();
|
|
298
|
+
expect(screen.getByRole('textbox')).toHaveValue('String123');
|
|
299
|
+
expect(screen.getByText('Cancel')).toBeDisabled();
|
|
300
|
+
expect(screen.getByText('Apply')).toBeDisabled();
|
|
301
|
+
return [2 /*return*/];
|
|
302
|
+
});
|
|
303
|
+
}); });
|
|
73
304
|
});
|
|
305
|
+
it('should show correct attributes in attributes selector', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
306
|
+
var user, menuitems;
|
|
307
|
+
return __generator(this, function (_a) {
|
|
308
|
+
switch (_a.label) {
|
|
309
|
+
case 0:
|
|
310
|
+
user = setUp({
|
|
311
|
+
props: {
|
|
312
|
+
attributeValues: smallCombinedAttributeValues,
|
|
313
|
+
currentAttributeValueUri: 'entities/mnGiTyT/attributes/ImageGallery/1'
|
|
314
|
+
},
|
|
315
|
+
mdmModuleValues: { mode: Mode.Suggesting }
|
|
316
|
+
}).user;
|
|
317
|
+
expect(screen.getByText('String')).toBeInTheDocument();
|
|
318
|
+
expect(screen.getByRole('textbox')).toHaveValue('String123');
|
|
319
|
+
return [4 /*yield*/, user.click(screen.getByText('Attributes'))];
|
|
320
|
+
case 1:
|
|
321
|
+
_a.sent();
|
|
322
|
+
expect(screen.getByRole('textbox')).toHaveAttribute('placeholder', 'Search & add attributes');
|
|
323
|
+
menuitems = screen.getAllByRole('menuitem');
|
|
324
|
+
expect(menuitems[0]).toHaveTextContent('String');
|
|
325
|
+
expect(menuitems[1]).toHaveTextContent('Long');
|
|
326
|
+
return [2 /*return*/];
|
|
327
|
+
}
|
|
328
|
+
});
|
|
329
|
+
}); });
|
|
330
|
+
it('should correctly work with values editing apply', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
331
|
+
var user, cancelButton, applyButton, backdrop, menuitems, _a, titleTextbox, locationTextbox;
|
|
332
|
+
return __generator(this, function (_b) {
|
|
333
|
+
switch (_b.label) {
|
|
334
|
+
case 0:
|
|
335
|
+
user = setUp({
|
|
336
|
+
props: {
|
|
337
|
+
attributeValues: smallCombinedAttributeValues,
|
|
338
|
+
currentAttributeValueUri: 'entities/mnGiTyT/attributes/ImageGallery/1'
|
|
339
|
+
},
|
|
340
|
+
mdmModuleValues: { mode: Mode.Suggesting }
|
|
341
|
+
}).user;
|
|
342
|
+
cancelButton = screen.getByText('Cancel');
|
|
343
|
+
applyButton = screen.getByText('Apply');
|
|
344
|
+
expect(cancelButton).toBeDisabled();
|
|
345
|
+
expect(applyButton).toBeDisabled();
|
|
346
|
+
return [4 /*yield*/, user.click(screen.getByText('Attributes'))];
|
|
347
|
+
case 1:
|
|
348
|
+
_b.sent();
|
|
349
|
+
backdrop = screen.getByRole('presentation').firstChild;
|
|
350
|
+
menuitems = screen.getAllByRole('menuitem');
|
|
351
|
+
return [4 /*yield*/, user.click(menuitems[1])];
|
|
352
|
+
case 2:
|
|
353
|
+
_b.sent();
|
|
354
|
+
return [4 /*yield*/, user.click(backdrop)];
|
|
355
|
+
case 3:
|
|
356
|
+
_b.sent();
|
|
357
|
+
expect(cancelButton).not.toBeDisabled();
|
|
358
|
+
expect(applyButton).not.toBeDisabled();
|
|
359
|
+
_a = screen.getAllByRole('textbox'), titleTextbox = _a[0], locationTextbox = _a[1];
|
|
360
|
+
return [4 /*yield*/, user.type(titleTextbox, '{Backspace}{Backspace}{Backspace}')];
|
|
361
|
+
case 4:
|
|
362
|
+
_b.sent();
|
|
363
|
+
return [4 /*yield*/, user.type(locationTextbox, '123')];
|
|
364
|
+
case 5:
|
|
365
|
+
_b.sent();
|
|
366
|
+
return [4 /*yield*/, user.click(applyButton)];
|
|
367
|
+
case 6:
|
|
368
|
+
_b.sent();
|
|
369
|
+
expect(defaultMdmModuleActions.modifyAttribute).toHaveBeenCalledWith({
|
|
370
|
+
attributeType: defaultProps.attributeType,
|
|
371
|
+
uri: 'entities/mnGiTyT/attributes/ImageGallery/1',
|
|
372
|
+
value: {
|
|
373
|
+
uri: 'entities/mnGiTyT/attributes/ImageGallery/1',
|
|
374
|
+
value: {
|
|
375
|
+
CdnUrl: [{ value: 'https://google.com', uri: 'entities/mnGiTyT/attributes/ImageGallery/1/CdnUrl/1' }],
|
|
376
|
+
String: [
|
|
377
|
+
{
|
|
378
|
+
value: 'String',
|
|
379
|
+
type: 'configuration/entityTypes/HCP/attributes/ImageGallery/attributes/String',
|
|
380
|
+
uri: 'entities/mnGiTyT/attributes/ImageGallery/1/String/12'
|
|
381
|
+
}
|
|
382
|
+
],
|
|
383
|
+
Long: [
|
|
384
|
+
{
|
|
385
|
+
value: '123',
|
|
386
|
+
type: 'configuration/entityTypes/HCP/attributes/ImageGallery/attributes/Long',
|
|
387
|
+
uri: expect.any(String)
|
|
388
|
+
}
|
|
389
|
+
]
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
});
|
|
393
|
+
return [2 /*return*/];
|
|
394
|
+
}
|
|
395
|
+
});
|
|
396
|
+
}); });
|
|
397
|
+
it('should correctly work with values editing cancel', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
398
|
+
var user, cancelButton, applyButton, backdrop, menuitems, _a, titleTextbox, locationTextbox;
|
|
399
|
+
return __generator(this, function (_b) {
|
|
400
|
+
switch (_b.label) {
|
|
401
|
+
case 0:
|
|
402
|
+
user = setUp({
|
|
403
|
+
props: {
|
|
404
|
+
attributeValues: smallCombinedAttributeValues,
|
|
405
|
+
currentAttributeValueUri: 'entities/mnGiTyT/attributes/ImageGallery/1'
|
|
406
|
+
},
|
|
407
|
+
mdmModuleValues: { mode: Mode.Suggesting }
|
|
408
|
+
}).user;
|
|
409
|
+
cancelButton = screen.getByText('Cancel');
|
|
410
|
+
applyButton = screen.getByText('Apply');
|
|
411
|
+
expect(cancelButton).toBeDisabled();
|
|
412
|
+
expect(applyButton).toBeDisabled();
|
|
413
|
+
return [4 /*yield*/, user.click(screen.getByText('Attributes'))];
|
|
414
|
+
case 1:
|
|
415
|
+
_b.sent();
|
|
416
|
+
backdrop = screen.getByRole('presentation').firstChild;
|
|
417
|
+
menuitems = screen.getAllByRole('menuitem');
|
|
418
|
+
return [4 /*yield*/, user.click(menuitems[1])];
|
|
419
|
+
case 2:
|
|
420
|
+
_b.sent();
|
|
421
|
+
return [4 /*yield*/, user.click(backdrop)];
|
|
422
|
+
case 3:
|
|
423
|
+
_b.sent();
|
|
424
|
+
expect(cancelButton).not.toBeDisabled();
|
|
425
|
+
expect(applyButton).not.toBeDisabled();
|
|
426
|
+
_a = screen.getAllByRole('textbox'), titleTextbox = _a[0], locationTextbox = _a[1];
|
|
427
|
+
return [4 /*yield*/, user.type(titleTextbox, '{Backspace}{Backspace}{Backspace}')];
|
|
428
|
+
case 4:
|
|
429
|
+
_b.sent();
|
|
430
|
+
return [4 /*yield*/, user.type(locationTextbox, 'L1')];
|
|
431
|
+
case 5:
|
|
432
|
+
_b.sent();
|
|
433
|
+
return [4 /*yield*/, user.click(cancelButton)];
|
|
434
|
+
case 6:
|
|
435
|
+
_b.sent();
|
|
436
|
+
expect(screen.getByRole('textbox')).toHaveValue('String123');
|
|
437
|
+
return [2 /*return*/];
|
|
438
|
+
}
|
|
439
|
+
});
|
|
440
|
+
}); });
|
|
441
|
+
it('should work correctly with attributes actions', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
442
|
+
var attributeValues, user, cancelButton, applyButton, backdrop, _a, second, third, longTextBox;
|
|
443
|
+
return __generator(this, function (_b) {
|
|
444
|
+
switch (_b.label) {
|
|
445
|
+
case 0:
|
|
446
|
+
attributeValues = [
|
|
447
|
+
{
|
|
448
|
+
uri: 'entities/mnGiTyT/attributes/ImageGallery/1',
|
|
449
|
+
value: {
|
|
450
|
+
CdnUrl: [{ value: 'https://google.com', uri: 'entities/mnGiTyT/attributes/ImageGallery/1/CdnUrl/1' }],
|
|
451
|
+
String: [
|
|
452
|
+
{
|
|
453
|
+
value: 'String1',
|
|
454
|
+
type: 'configuration/entityTypes/HCP/attributes/ImageGallery/attributes/String',
|
|
455
|
+
uri: 'entities/mnGiTyT/attributes/ImageGallery/1/String/11'
|
|
456
|
+
},
|
|
457
|
+
{
|
|
458
|
+
value: 'String2',
|
|
459
|
+
type: 'configuration/entityTypes/HCP/attributes/ImageGallery/attributes/String',
|
|
460
|
+
uri: 'entities/mnGiTyT/attributes/ImageGallery/1/String/12'
|
|
461
|
+
},
|
|
462
|
+
{
|
|
463
|
+
value: 'String3',
|
|
464
|
+
type: 'configuration/entityTypes/HCP/attributes/ImageGallery/attributes/String',
|
|
465
|
+
uri: 'entities/mnGiTyT/attributes/ImageGallery/1/String/13'
|
|
466
|
+
}
|
|
467
|
+
]
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
];
|
|
471
|
+
user = setUp({
|
|
472
|
+
props: { attributeValues: attributeValues, currentAttributeValueUri: 'entities/mnGiTyT/attributes/ImageGallery/1' },
|
|
473
|
+
mdmModuleValues: { mode: Mode.Suggesting }
|
|
474
|
+
}).user;
|
|
475
|
+
cancelButton = screen.getByText('Cancel');
|
|
476
|
+
applyButton = screen.getByText('Apply');
|
|
477
|
+
expect(cancelButton).toBeDisabled();
|
|
478
|
+
expect(applyButton).toBeDisabled();
|
|
479
|
+
return [4 /*yield*/, user.click(screen.getByText('Attributes'))];
|
|
480
|
+
case 1:
|
|
481
|
+
_b.sent();
|
|
482
|
+
return [4 /*yield*/, user.click(screen.getByTestId('reltio-add-one-more-simple-attribute-button'))];
|
|
483
|
+
case 2:
|
|
484
|
+
_b.sent();
|
|
485
|
+
return [4 /*yield*/, user.click(screen.getAllByTestId('reltio-delete-simple-attribute-button')[0])];
|
|
486
|
+
case 3:
|
|
487
|
+
_b.sent();
|
|
488
|
+
backdrop = screen.getByRole('presentation').firstChild;
|
|
489
|
+
return [4 /*yield*/, user.click(screen.getByText('Long'))];
|
|
490
|
+
case 4:
|
|
491
|
+
_b.sent();
|
|
492
|
+
return [4 /*yield*/, user.click(backdrop)];
|
|
493
|
+
case 5:
|
|
494
|
+
_b.sent();
|
|
495
|
+
expect(cancelButton).not.toBeDisabled();
|
|
496
|
+
expect(applyButton).not.toBeDisabled();
|
|
497
|
+
_a = screen.getAllByRole('textbox'), second = _a[1], third = _a[2], longTextBox = _a[3];
|
|
498
|
+
return [4 /*yield*/, user.type(second, '2')];
|
|
499
|
+
case 6:
|
|
500
|
+
_b.sent();
|
|
501
|
+
return [4 /*yield*/, user.type(third, '3')];
|
|
502
|
+
case 7:
|
|
503
|
+
_b.sent();
|
|
504
|
+
return [4 /*yield*/, user.type(longTextBox, '4')];
|
|
505
|
+
case 8:
|
|
506
|
+
_b.sent();
|
|
507
|
+
return [4 /*yield*/, user.click(applyButton)];
|
|
508
|
+
case 9:
|
|
509
|
+
_b.sent();
|
|
510
|
+
expect(defaultMdmModuleActions.modifyAttribute).toHaveBeenCalledWith({
|
|
511
|
+
attributeType: defaultProps.attributeType,
|
|
512
|
+
uri: 'entities/mnGiTyT/attributes/ImageGallery/1',
|
|
513
|
+
value: {
|
|
514
|
+
uri: 'entities/mnGiTyT/attributes/ImageGallery/1',
|
|
515
|
+
value: {
|
|
516
|
+
CdnUrl: [{ value: 'https://google.com', uri: 'entities/mnGiTyT/attributes/ImageGallery/1/CdnUrl/1' }],
|
|
517
|
+
String: [
|
|
518
|
+
{
|
|
519
|
+
value: 'String2',
|
|
520
|
+
type: 'configuration/entityTypes/HCP/attributes/ImageGallery/attributes/String',
|
|
521
|
+
uri: 'entities/mnGiTyT/attributes/ImageGallery/1/String/12'
|
|
522
|
+
},
|
|
523
|
+
{
|
|
524
|
+
value: 'String32',
|
|
525
|
+
type: 'configuration/entityTypes/HCP/attributes/ImageGallery/attributes/String',
|
|
526
|
+
uri: 'entities/mnGiTyT/attributes/ImageGallery/1/String/13'
|
|
527
|
+
},
|
|
528
|
+
{
|
|
529
|
+
value: '3',
|
|
530
|
+
type: 'configuration/entityTypes/HCP/attributes/ImageGallery/attributes/String',
|
|
531
|
+
uri: expect.any(String)
|
|
532
|
+
}
|
|
533
|
+
],
|
|
534
|
+
Long: [
|
|
535
|
+
{
|
|
536
|
+
value: '4',
|
|
537
|
+
type: 'configuration/entityTypes/HCP/attributes/ImageGallery/attributes/Long',
|
|
538
|
+
uri: expect.any(String)
|
|
539
|
+
}
|
|
540
|
+
]
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
});
|
|
544
|
+
return [2 /*return*/];
|
|
545
|
+
}
|
|
546
|
+
});
|
|
547
|
+
}); });
|
|
74
548
|
});
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import { AttributeType, ImageAttributeValue } from '@reltio/mdm-sdk';
|
|
2
2
|
export declare const attributeType: AttributeType;
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const complexAttributeValue: ImageAttributeValue;
|
|
4
|
+
export declare const simpleAttributeValues: ImageAttributeValue[];
|
|
5
|
+
export declare const complexAttributeValues: ImageAttributeValue[];
|
|
6
|
+
export declare const smallCombinedAttributeValues: ImageAttributeValue[];
|