@reltio/components 1.4.2069 → 1.4.2071
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/FacetViewHeader/FacetViewHeader.js +1 -1
- package/ImageAttributesLine/imageAttributeValues.test-data.js +8 -0
- package/ImageAttributesLine/index.d.ts +1 -1
- package/ImageAttributesLine/index.js +1 -1
- package/ImageDetailsView/components/ImageDetailsViewCarousel/ImageDetailsViewCarousel.js +1 -1
- package/MergeButton/MergeButton.spec.js +55 -124
- package/MetadataTypesSelector/MetadataTypesSelector.js +1 -1
- package/MetadataTypesSelector/MetadataTypesSelector.test.js +193 -190
- package/MoreAttributesButton/MoreAttributesButton.test.js +173 -166
- package/MultiValueSelector/MultiValueSelector.test.js +78 -38
- package/MultipliableSelect/MultipliableSelect.test.js +111 -47
- package/NestedAttribute/NestedAttribute.test.js +121 -42
- package/NestedAttributeEditor/NestedAttributeEditor.test.js +95 -41
- package/NotMatchButton/NotMatchButton.spec.js +51 -100
- package/PieChart/PieChart.test.js +130 -114
- package/PinButton/PinButton.spec.js +89 -22
- package/PivotingTooltip/PivotingTooltip.test.js +338 -174
- package/PotentialMatchReviewCard/PotentialMatchReviewCard.spec.js +94 -29
- package/ProfileBand/ProfileBand.spec.js +60 -53
- package/ProfileCard/ProfileCard.test.js +109 -27
- package/ProfilesList/ProfilesList.d.ts +1 -3
- package/ProfilesList/ProfilesList.js +1 -1
- package/ProfilesList/ProfilesList.spec.js +226 -211
- package/QueryBuilderRow/QueryBuilderRow.spec.js +83 -90
- package/QueryBuilderRowsGroup/QueryBuilderRowsGroup.spec.js +195 -86
- package/ReactSelectLoadMoreButton/ReactSelectLoadMoreButton.test.js +73 -15
- package/ReactSelectMenuWithPopper/ReactSelectMenuWithPopper.test.js +71 -117
- package/ReadOnlyAttributeValuesBlock/ReadOnlyAttributeValuesBlock.test.js +128 -61
- package/ReadOnlyAttributesFactory/components/ReadOnlyAttribute/ReadOnlyAttribute.test.js +179 -44
- package/ReadOnlyAttributesList/ReadOnlyAttributesList.test.js +254 -211
- package/ReadOnlyAttributesList/attributes.test-data.js +4 -4
- package/ReadOnlyAttributesPager/ReadOnlyAttributesPager.test.js +75 -18
- package/ReadOnlyAttributesView/ReadOnlyAttributesView.test.js +187 -312
- package/ReadOnlyComplexAttribute/ReadOnlyComplexAttribute.test.js +210 -219
- package/ReadOnlyImageAttributesLine/ReadOnlyImageAttributesLine.test.js +89 -89
- package/ReferenceAttributeEditor/ReferenceAttributeEditor.test.js +556 -602
- package/ReferenceAttributeEditor/metadata.test-data.d.ts +13 -13
- package/ReferenceAttributeEditor/metadata.test-data.js +2 -2
- package/ReferenceAttributeEditor/styles.d.ts +1 -1
- package/RelationEditor/RelationEditor.test.js +1448 -1392
- package/RelationTypeSelector/RelationTypeSelector.test.js +99 -17
- package/RelationTypesSelector/RelationTypesSelector.test.js +73 -22
- package/ReltioMap/ReltioMap.spec.js +51 -25
- package/Roles/Roles.test.js +54 -10
- package/ScreenProfileBand/ScreenProfileBand.test.js +142 -72
- package/cjs/FacetViewHeader/FacetViewHeader.js +1 -1
- package/cjs/ImageAttributesLine/imageAttributeValues.test-data.js +8 -0
- package/cjs/ImageAttributesLine/index.d.ts +1 -1
- package/cjs/ImageAttributesLine/index.js +2 -1
- package/cjs/ImageDetailsView/components/ImageDetailsViewCarousel/ImageDetailsViewCarousel.js +1 -1
- package/cjs/MergeButton/MergeButton.spec.js +55 -124
- package/cjs/MetadataTypesSelector/MetadataTypesSelector.js +1 -1
- package/cjs/MetadataTypesSelector/MetadataTypesSelector.test.js +193 -190
- package/cjs/MoreAttributesButton/MoreAttributesButton.test.js +172 -165
- package/cjs/MultiValueSelector/MultiValueSelector.test.js +78 -38
- package/cjs/MultipliableSelect/MultipliableSelect.test.js +111 -47
- package/cjs/NestedAttribute/NestedAttribute.test.js +121 -42
- package/cjs/NestedAttributeEditor/NestedAttributeEditor.test.js +94 -40
- package/cjs/NotMatchButton/NotMatchButton.spec.js +51 -100
- package/cjs/PieChart/PieChart.test.js +130 -114
- package/cjs/PinButton/PinButton.spec.js +89 -22
- package/cjs/PivotingTooltip/PivotingTooltip.test.js +338 -174
- package/cjs/PotentialMatchReviewCard/PotentialMatchReviewCard.spec.js +94 -29
- package/cjs/ProfileBand/ProfileBand.spec.js +60 -53
- package/cjs/ProfileCard/ProfileCard.test.js +109 -27
- package/cjs/ProfilesList/ProfilesList.d.ts +1 -3
- package/cjs/ProfilesList/ProfilesList.js +1 -1
- package/cjs/ProfilesList/ProfilesList.spec.js +226 -211
- package/cjs/QueryBuilderRow/QueryBuilderRow.spec.js +83 -90
- package/cjs/QueryBuilderRowsGroup/QueryBuilderRowsGroup.spec.js +195 -86
- package/cjs/ReactSelectLoadMoreButton/ReactSelectLoadMoreButton.test.js +73 -15
- package/cjs/ReactSelectMenuWithPopper/ReactSelectMenuWithPopper.test.js +71 -117
- package/cjs/ReadOnlyAttributeValuesBlock/ReadOnlyAttributeValuesBlock.test.js +128 -61
- package/cjs/ReadOnlyAttributesFactory/components/ReadOnlyAttribute/ReadOnlyAttribute.test.js +179 -44
- package/cjs/ReadOnlyAttributesList/ReadOnlyAttributesList.test.js +254 -211
- package/cjs/ReadOnlyAttributesList/attributes.test-data.js +4 -4
- package/cjs/ReadOnlyAttributesPager/ReadOnlyAttributesPager.test.js +75 -18
- package/cjs/ReadOnlyAttributesView/ReadOnlyAttributesView.test.js +185 -310
- package/cjs/ReadOnlyComplexAttribute/ReadOnlyComplexAttribute.test.js +209 -218
- package/cjs/ReadOnlyImageAttributesLine/ReadOnlyImageAttributesLine.test.js +89 -89
- package/cjs/ReferenceAttributeEditor/ReferenceAttributeEditor.test.js +555 -601
- package/cjs/ReferenceAttributeEditor/metadata.test-data.d.ts +13 -13
- package/cjs/ReferenceAttributeEditor/metadata.test-data.js +2 -2
- package/cjs/ReferenceAttributeEditor/styles.d.ts +1 -1
- package/cjs/RelationEditor/RelationEditor.test.js +1446 -1390
- package/cjs/RelationTypeSelector/RelationTypeSelector.test.js +99 -17
- package/cjs/RelationTypesSelector/RelationTypesSelector.test.js +73 -22
- package/cjs/ReltioMap/ReltioMap.spec.js +51 -25
- package/cjs/Roles/Roles.test.js +54 -10
- package/cjs/ScreenProfileBand/ScreenProfileBand.test.js +141 -71
- package/package.json +2 -2
- package/MetadataTypesSelector/components/ListLabel/ListLabel.test.d.ts +0 -1
- package/MetadataTypesSelector/components/ListLabel/ListLabel.test.js +0 -24
- package/PivotingTooltip/IntegrationPivotingTooltip.test.d.ts +0 -1
- package/PivotingTooltip/IntegrationPivotingTooltip.test.js +0 -356
- package/PivotingTooltip/components/PivotingTooltipContent/PivotingTooltipContent.test.d.ts +0 -1
- package/PivotingTooltip/components/PivotingTooltipContent/PivotingTooltipContent.test.js +0 -201
- package/ProfileCard/components/ProfileCardContent/ProfileCardContent.test.d.ts +0 -1
- package/ProfileCard/components/ProfileCardContent/ProfileCardContent.test.js +0 -43
- package/QueryBuilderRow/components/ReadOnlyFilter/ReadOnlyFilter.spec.d.ts +0 -1
- package/QueryBuilderRow/components/ReadOnlyFilter/ReadOnlyFilter.spec.js +0 -31
- package/QueryBuilderRow/components/ReadOnlyLogicOperator/ReadOnlyLogicOperator.spec.d.ts +0 -1
- package/QueryBuilderRow/components/ReadOnlyLogicOperator/ReadOnlyLogicOperator.spec.js +0 -31
- package/ReadOnlyAttributesPager/components/ImageLineRenderer/ImageLineRenderer.test.d.ts +0 -1
- package/ReadOnlyAttributesPager/components/ImageLineRenderer/ImageLineRenderer.test.js +0 -45
- package/ReadOnlyAttributesPager/components/MultiLineRenderer/MultiLineRenderer.test.d.ts +0 -1
- package/ReadOnlyAttributesPager/components/MultiLineRenderer/MultiLineRenderer.test.js +0 -114
- package/ReadOnlyAttributesPager/components/OneLineRenderer/OneLineRenderer.test.d.ts +0 -1
- package/ReadOnlyAttributesPager/components/OneLineRenderer/OneLineRenderer.test.js +0 -107
- package/ReadOnlyAttributesPager/components/SpecialRenderer/SpecialRenderer.test.d.ts +0 -1
- package/ReadOnlyAttributesPager/components/SpecialRenderer/SpecialRenderer.test.js +0 -72
- package/RelationEditor/IntegrationRelationEditor.test.d.ts +0 -1
- package/RelationEditor/IntegrationRelationEditor.test.js +0 -337
- package/ReltioMap/components/MapControlContainer/MapControlContainer.d.ts +0 -10
- package/ReltioMap/components/MapControlContainer/MapControlContainer.js +0 -24
- package/ReltioMap/components/MapControlContainer/MapControlContainer.spec.d.ts +0 -1
- package/ReltioMap/components/MapControlContainer/MapControlContainer.spec.js +0 -33
- package/ReltioMap/components/MapControlContainer/index.d.ts +0 -1
- package/ReltioMap/components/MapControlContainer/index.js +0 -1
- package/ReltioMap/components/TopCenterMapControls/TopCenterMapControls.spec.d.ts +0 -1
- package/ReltioMap/components/TopCenterMapControls/TopCenterMapControls.spec.js +0 -36
- package/ReltioMap/components/TopRightMapControls/TopRightMapControls.spec.d.ts +0 -1
- package/ReltioMap/components/TopRightMapControls/TopRightMapControls.spec.js +0 -60
- package/Roles/components/Role/Role.test.d.ts +0 -1
- package/Roles/components/Role/Role.test.js +0 -55
- package/cjs/MetadataTypesSelector/components/ListLabel/ListLabel.test.d.ts +0 -1
- package/cjs/MetadataTypesSelector/components/ListLabel/ListLabel.test.js +0 -52
- package/cjs/PivotingTooltip/IntegrationPivotingTooltip.test.d.ts +0 -1
- package/cjs/PivotingTooltip/IntegrationPivotingTooltip.test.js +0 -361
- package/cjs/PivotingTooltip/components/PivotingTooltipContent/PivotingTooltipContent.test.d.ts +0 -1
- package/cjs/PivotingTooltip/components/PivotingTooltipContent/PivotingTooltipContent.test.js +0 -206
- package/cjs/ProfileCard/components/ProfileCardContent/ProfileCardContent.test.d.ts +0 -1
- package/cjs/ProfileCard/components/ProfileCardContent/ProfileCardContent.test.js +0 -48
- package/cjs/QueryBuilderRow/components/ReadOnlyFilter/ReadOnlyFilter.spec.d.ts +0 -1
- package/cjs/QueryBuilderRow/components/ReadOnlyFilter/ReadOnlyFilter.spec.js +0 -36
- package/cjs/QueryBuilderRow/components/ReadOnlyLogicOperator/ReadOnlyLogicOperator.spec.d.ts +0 -1
- package/cjs/QueryBuilderRow/components/ReadOnlyLogicOperator/ReadOnlyLogicOperator.spec.js +0 -36
- package/cjs/ReadOnlyAttributesPager/components/ImageLineRenderer/ImageLineRenderer.test.d.ts +0 -1
- package/cjs/ReadOnlyAttributesPager/components/ImageLineRenderer/ImageLineRenderer.test.js +0 -50
- package/cjs/ReadOnlyAttributesPager/components/MultiLineRenderer/MultiLineRenderer.test.d.ts +0 -1
- package/cjs/ReadOnlyAttributesPager/components/MultiLineRenderer/MultiLineRenderer.test.js +0 -119
- package/cjs/ReadOnlyAttributesPager/components/OneLineRenderer/OneLineRenderer.test.d.ts +0 -1
- package/cjs/ReadOnlyAttributesPager/components/OneLineRenderer/OneLineRenderer.test.js +0 -112
- package/cjs/ReadOnlyAttributesPager/components/SpecialRenderer/SpecialRenderer.test.d.ts +0 -1
- package/cjs/ReadOnlyAttributesPager/components/SpecialRenderer/SpecialRenderer.test.js +0 -77
- package/cjs/RelationEditor/IntegrationRelationEditor.test.d.ts +0 -1
- package/cjs/RelationEditor/IntegrationRelationEditor.test.js +0 -342
- package/cjs/ReltioMap/components/MapControlContainer/MapControlContainer.d.ts +0 -10
- package/cjs/ReltioMap/components/MapControlContainer/MapControlContainer.js +0 -28
- package/cjs/ReltioMap/components/MapControlContainer/MapControlContainer.spec.d.ts +0 -1
- package/cjs/ReltioMap/components/MapControlContainer/MapControlContainer.spec.js +0 -38
- package/cjs/ReltioMap/components/MapControlContainer/index.d.ts +0 -1
- package/cjs/ReltioMap/components/MapControlContainer/index.js +0 -5
- package/cjs/ReltioMap/components/TopCenterMapControls/TopCenterMapControls.spec.d.ts +0 -1
- package/cjs/ReltioMap/components/TopCenterMapControls/TopCenterMapControls.spec.js +0 -41
- package/cjs/ReltioMap/components/TopRightMapControls/TopRightMapControls.spec.d.ts +0 -1
- package/cjs/ReltioMap/components/TopRightMapControls/TopRightMapControls.spec.js +0 -65
- package/cjs/Roles/components/Role/Role.test.d.ts +0 -1
- package/cjs/Roles/components/Role/Role.test.js +0 -60
|
@@ -9,104 +9,104 @@ 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 { act } from '
|
|
15
|
-
import
|
|
49
|
+
import { mockResizeObserver } from 'jsdom-testing-mocks';
|
|
50
|
+
import { render, screen, within, fireEvent, act } from '@testing-library/react';
|
|
51
|
+
import userEvent from '@testing-library/user-event';
|
|
16
52
|
import { ReadOnlyImageAttributesLine } from './ReadOnlyImageAttributesLine';
|
|
17
|
-
import {
|
|
18
|
-
import { Image } from '../Image';
|
|
19
|
-
import { ImageAttributesGallery } from '../ImageAttributesGallery';
|
|
53
|
+
import { imageAttributeValues, attributeType } from '../ImageAttributesLine';
|
|
20
54
|
import { MdmModuleProvider } from '../contexts/MdmModuleContext';
|
|
21
|
-
describe('
|
|
22
|
-
var
|
|
23
|
-
|
|
24
|
-
attributeType: {
|
|
25
|
-
name: 'ImageGallery',
|
|
26
|
-
type: '',
|
|
27
|
-
uri: 'uri'
|
|
28
|
-
}
|
|
29
|
-
};
|
|
55
|
+
describe('Read only image attributes line tests', function () {
|
|
56
|
+
var resizeObserver = mockResizeObserver();
|
|
57
|
+
var defaultProps = { attributeValues: imageAttributeValues, attributeType: attributeType };
|
|
30
58
|
var setUp = function (props) {
|
|
31
59
|
if (props === void 0) { props = defaultProps; }
|
|
32
|
-
|
|
33
|
-
|
|
60
|
+
var user = userEvent.setup();
|
|
61
|
+
var Providers = function (_a) {
|
|
62
|
+
var children = _a.children;
|
|
63
|
+
return (React.createElement(MdmModuleProvider, null, children));
|
|
64
|
+
};
|
|
65
|
+
return __assign(__assign({}, render(React.createElement(ReadOnlyImageAttributesLine, __assign({}, props)), { wrapper: Providers })), { user: user });
|
|
34
66
|
};
|
|
35
67
|
it('should render main parts', function () {
|
|
36
|
-
var
|
|
37
|
-
|
|
38
|
-
expect(component.find(Image)).toHaveLength(0);
|
|
39
|
-
});
|
|
40
|
-
it('should render attribute', function () {
|
|
41
|
-
var component = setUp(__assign(__assign({}, defaultProps), { attributeValues: imageAttributeValues }));
|
|
42
|
-
act(function () {
|
|
43
|
-
var onResize = component.find(ReactResizeDetector).prop('onResize');
|
|
44
|
-
onResize(600);
|
|
45
|
-
});
|
|
46
|
-
component.update();
|
|
47
|
-
var images = component.find(Image);
|
|
48
|
-
expect(images).toHaveLength(3);
|
|
49
|
-
expect(images.map(function (image) { return image.prop('src'); })).toEqual(['/test.jpg', '/test2.jpg', '/wrong.jpg']);
|
|
50
|
-
});
|
|
51
|
-
it('should open gallery dialog on image click', function () {
|
|
52
|
-
var component = setUp(__assign(__assign({}, defaultProps), { attributeValues: imageAttributeValues }));
|
|
53
|
-
act(function () {
|
|
54
|
-
var onResize = component.find(ReactResizeDetector).prop('onResize');
|
|
55
|
-
onResize(600);
|
|
56
|
-
});
|
|
57
|
-
component.update();
|
|
58
|
-
expect(component.find(ImageAttributesGallery).prop('open')).toBe(false);
|
|
68
|
+
var container = setUp().container;
|
|
69
|
+
resizeObserver.mockElementSize(container, { contentBoxSize: { inlineSize: 600 } });
|
|
59
70
|
act(function () {
|
|
60
|
-
|
|
61
|
-
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
71
|
+
resizeObserver.resize();
|
|
62
72
|
});
|
|
63
|
-
|
|
64
|
-
expect(
|
|
73
|
+
var attributes = screen.getAllByTestId('reltio-attribute-value');
|
|
74
|
+
expect(attributes).toHaveLength(3);
|
|
75
|
+
expect(within(attributes[0]).getByRole('img')).toHaveAttribute('src', '/test.jpg');
|
|
76
|
+
expect(within(attributes[1]).getByRole('img')).toHaveAttribute('src', '/test2.jpg');
|
|
77
|
+
expect(within(attributes[2]).getByRole('img')).toHaveAttribute('src', '/wrong.jpg');
|
|
65
78
|
});
|
|
66
|
-
it('should
|
|
67
|
-
var
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
79
|
+
it('should open gallery dialog on image click correctly', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
80
|
+
var _a, container, user, image, dialog, metaInfoItems;
|
|
81
|
+
return __generator(this, function (_b) {
|
|
82
|
+
switch (_b.label) {
|
|
83
|
+
case 0:
|
|
84
|
+
_a = setUp(), container = _a.container, user = _a.user;
|
|
85
|
+
resizeObserver.mockElementSize(container, { contentBoxSize: { inlineSize: 600 } });
|
|
86
|
+
act(function () {
|
|
87
|
+
resizeObserver.resize();
|
|
88
|
+
});
|
|
89
|
+
image = screen.getAllByRole('img')[0];
|
|
90
|
+
return [4 /*yield*/, user.click(image)];
|
|
91
|
+
case 1:
|
|
92
|
+
_b.sent();
|
|
93
|
+
dialog = screen.getByRole('dialog');
|
|
94
|
+
within(dialog)
|
|
95
|
+
.getAllByRole('img')
|
|
96
|
+
.forEach(function (image) { return fireEvent.load(image); });
|
|
97
|
+
expect(within(dialog).getByTestId('main-image')).toHaveAttribute('src', '/test.jpg');
|
|
98
|
+
metaInfoItems = within(dialog).getAllByTestId('image-meta-info-item');
|
|
99
|
+
expect(metaInfoItems).toHaveLength(4);
|
|
100
|
+
within(metaInfoItems[0]).getByText('Full image URL (S3)');
|
|
101
|
+
within(metaInfoItems[0]).getByText('link');
|
|
102
|
+
within(metaInfoItems[1]).getByText('Preview image URL (S3)');
|
|
103
|
+
within(metaInfoItems[1]).getByText('link');
|
|
104
|
+
within(metaInfoItems[2]).getByText('Small image URL (S3)');
|
|
105
|
+
within(metaInfoItems[2]).getByText('link');
|
|
106
|
+
within(metaInfoItems[3]).getByText('Small image URL (CDN)');
|
|
107
|
+
within(metaInfoItems[3]).getByText('link');
|
|
108
|
+
return [2 /*return*/];
|
|
109
|
+
}
|
|
78
110
|
});
|
|
79
|
-
|
|
80
|
-
});
|
|
81
|
-
it('should provide custom sizeImage to Image and ImageAttributesLine', function () {
|
|
82
|
-
var imageSize = {
|
|
83
|
-
imageMargin: 40,
|
|
84
|
-
imageWidth: 11,
|
|
85
|
-
imageHeight: 3
|
|
86
|
-
};
|
|
87
|
-
var component = setUp(__assign(__assign({}, defaultProps), { imageSize: imageSize, attributeValues: imageAttributeValues }));
|
|
88
|
-
act(function () {
|
|
89
|
-
var onResize = component.find(ReactResizeDetector).prop('onResize');
|
|
90
|
-
onResize(600);
|
|
91
|
-
});
|
|
92
|
-
component.update();
|
|
93
|
-
expect(component.find(Image)).toHaveLength(3);
|
|
94
|
-
var image = component.find(Image).first();
|
|
95
|
-
expect(image.prop('size')).toEqual({
|
|
96
|
-
imageWidth: imageSize.imageWidth,
|
|
97
|
-
imageHeight: imageSize.imageHeight
|
|
98
|
-
});
|
|
99
|
-
expect(component.find(ImageAttributesLine).prop('imageSize')).toEqual(imageSize);
|
|
100
|
-
});
|
|
101
|
-
it('should provide correct props to ImageAttributesLine', function () {
|
|
102
|
-
var requestNextPageOfAttributeValues = jest.fn();
|
|
103
|
-
var props = __assign(__assign({}, defaultProps), { attributeValues: imageAttributeValues, requestNextPageOfAttributeValues: requestNextPageOfAttributeValues, paging: {}, parentUri: 'parentUri', showNonOv: false });
|
|
104
|
-
var component = setUp(props);
|
|
105
|
-
expect(component.find(ImageAttributesLine).props()).toMatchObject({
|
|
106
|
-
requestNextPageOfAttributeValues: expect.any(Function),
|
|
107
|
-
paging: {},
|
|
108
|
-
parentUri: 'parentUri',
|
|
109
|
-
showNonOv: false
|
|
110
|
-
});
|
|
111
|
-
});
|
|
111
|
+
}); });
|
|
112
112
|
});
|