@reltio/components 1.4.2070 → 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 +1 -1
- 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
|
@@ -65,12 +65,16 @@ var user_event_1 = __importDefault(require("@testing-library/user-event"));
|
|
|
65
65
|
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
66
66
|
var ReadOnlyAttributesPager_1 = __importDefault(require("./ReadOnlyAttributesPager"));
|
|
67
67
|
var MdmModuleContext_1 = require("../contexts/MdmModuleContext");
|
|
68
|
+
var FeaturesContext_1 = require("../contexts/FeaturesContext");
|
|
69
|
+
var CollaborationContext_1 = require("../contexts/CollaborationContext");
|
|
68
70
|
describe('ReadOnlyAttributesPager tests', function () {
|
|
71
|
+
var collaboration = { commentsMap: {} };
|
|
69
72
|
var attributeType = {
|
|
70
73
|
uri: 'configuration/entityTypes/HCP/attributes/Simple',
|
|
71
74
|
type: 'String',
|
|
72
75
|
name: 'Simple',
|
|
73
|
-
label: 'Simple label'
|
|
76
|
+
label: 'Simple label',
|
|
77
|
+
description: 'Simple description'
|
|
74
78
|
};
|
|
75
79
|
var values = [
|
|
76
80
|
{ type: attributeType.uri, uri: 'entities/sIeHttl/attributes/Simple/u123', value: '123', ov: true },
|
|
@@ -88,57 +92,108 @@ describe('ReadOnlyAttributesPager tests', function () {
|
|
|
88
92
|
jest.clearAllMocks();
|
|
89
93
|
});
|
|
90
94
|
var setUp = function (_a) {
|
|
91
|
-
var _b = _a === void 0 ? {} : _a, _c = _b.props, props = _c === void 0 ? defaultProps : _c, _d = _b.mdmValues, mdmValues = _d === void 0 ? {} : _d;
|
|
95
|
+
var _b = _a === void 0 ? {} : _a, _c = _b.props, props = _c === void 0 ? defaultProps : _c, _d = _b.mdmValues, mdmValues = _d === void 0 ? {} : _d, _e = _b.featuresContextValue, featuresContextValue = _e === void 0 ? { showDescription: true } : _e;
|
|
92
96
|
var user = user_event_1.default.setup();
|
|
93
97
|
var Providers = function (_a) {
|
|
94
98
|
var children = _a.children;
|
|
95
|
-
return (react_1.default.createElement(MdmModuleContext_1.MdmModuleProvider, { values: mdmValues, actions: actions },
|
|
99
|
+
return (react_1.default.createElement(MdmModuleContext_1.MdmModuleProvider, { values: mdmValues, actions: actions },
|
|
100
|
+
react_1.default.createElement(CollaborationContext_1.CollaborationContext.Provider, { value: collaboration },
|
|
101
|
+
react_1.default.createElement(FeaturesContext_1.FeaturesContext.Provider, { value: featuresContextValue }, children))));
|
|
96
102
|
};
|
|
97
103
|
return __assign({ user: user }, (0, react_2.render)(react_1.default.createElement(ReadOnlyAttributesPager_1.default, __assign({}, props)), { wrapper: Providers }));
|
|
98
104
|
};
|
|
99
105
|
it('should use OneLineRenderer if there is only one ov value of Simple attribute', function () {
|
|
100
106
|
var props = __assign(__assign({}, defaultProps), { values: [values[0]] });
|
|
101
107
|
setUp({ props: props });
|
|
102
|
-
expect(react_2.screen.queryByTestId('branch-decorator')).not.toBeInTheDocument();
|
|
103
108
|
expect(react_2.screen.getByTestId('one-line-renderer')).toBeInTheDocument();
|
|
109
|
+
expect(react_2.screen.getByLabelText('Simple description')).toBeInTheDocument();
|
|
104
110
|
expect(react_2.screen.getByText('Simple label')).toBeInTheDocument();
|
|
111
|
+
expect(react_2.screen.getByLabelText('Add comment')).toBeInTheDocument();
|
|
105
112
|
expect(react_2.screen.getByText('123')).toBeInTheDocument();
|
|
106
|
-
});
|
|
107
|
-
it('should use OneLineRenderer if there is only one ov value (and some non ov) of Simple attribute', function () {
|
|
108
|
-
var props = __assign(__assign({}, defaultProps), { values: [values[0], __assign(__assign({}, values[1]), { ov: false })] });
|
|
109
|
-
setUp({ props: props });
|
|
110
113
|
expect(react_2.screen.queryByTestId('branch-decorator')).not.toBeInTheDocument();
|
|
111
|
-
expect(react_2.screen.getByTestId('one-line-renderer')).toBeInTheDocument();
|
|
112
|
-
expect(react_2.screen.getByText('Simple label')).toBeInTheDocument();
|
|
113
|
-
expect(react_2.screen.getByText('123')).toBeInTheDocument();
|
|
114
|
-
expect(react_2.screen.queryByText('456')).not.toBeInTheDocument();
|
|
115
114
|
});
|
|
115
|
+
it('should use OneLineRenderer if there is only one ov value (and some non ov) of Simple attribute', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
116
|
+
var props, user;
|
|
117
|
+
return __generator(this, function (_a) {
|
|
118
|
+
switch (_a.label) {
|
|
119
|
+
case 0:
|
|
120
|
+
props = __assign(__assign({}, defaultProps), { values: [values[0], __assign(__assign({}, values[1]), { ov: false })] });
|
|
121
|
+
user = setUp({ props: props }).user;
|
|
122
|
+
expect(react_2.screen.getByTestId('one-line-renderer')).toBeInTheDocument();
|
|
123
|
+
expect(react_2.screen.getByLabelText('Simple description')).toBeInTheDocument();
|
|
124
|
+
expect(react_2.screen.getByText('Simple label')).toBeInTheDocument();
|
|
125
|
+
expect(react_2.screen.getByLabelText('Add comment')).toBeInTheDocument();
|
|
126
|
+
expect(react_2.screen.getByText('123')).toBeInTheDocument();
|
|
127
|
+
return [4 /*yield*/, user.hover(react_2.screen.getByText('+ 1'))];
|
|
128
|
+
case 1:
|
|
129
|
+
_a.sent();
|
|
130
|
+
expect(react_2.screen.getByText('456')).toBeInTheDocument();
|
|
131
|
+
return [2 /*return*/];
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
}); });
|
|
116
135
|
it('should use MultiLineRenderer for Complex attribute', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
117
|
-
var ovValues, props, user;
|
|
136
|
+
var ovValues, props, user, labels;
|
|
118
137
|
return __generator(this, function (_a) {
|
|
119
138
|
switch (_a.label) {
|
|
120
139
|
case 0:
|
|
121
140
|
ovValues = [
|
|
122
|
-
__assign(__assign({}, values[0]), { value: { Name: [{ value: '123', uri: '123' }] } }),
|
|
123
|
-
__assign(__assign({}, values[1]), { value: { Name: [{ value: '456', uri: '456' }] } }),
|
|
124
|
-
__assign(__assign({}, values[2]), { value: { Name: [{ value: '444', uri: '444' }] } })
|
|
141
|
+
__assign(__assign({}, values[0]), { label: 'First value', value: { Name: [{ value: '123', uri: '123' }] } }),
|
|
142
|
+
__assign(__assign({}, values[1]), { label: 'Second value', value: { Name: [{ value: '456', uri: '456' }] } }),
|
|
143
|
+
__assign(__assign({}, values[2]), { label: 'Third value', value: { Name: [{ value: '444', uri: '444' }] } })
|
|
125
144
|
];
|
|
126
145
|
props = __assign(__assign({}, defaultProps), { attributeType: __assign(__assign({}, defaultProps.attributeType), { type: 'Nested' }), max: 1, paging: { totalOvValues: 5 }, values: __spreadArray(__spreadArray([], ovValues, true), [__assign(__assign({}, values[1]), { ov: false })], false) });
|
|
127
146
|
user = setUp({ props: props }).user;
|
|
128
147
|
expect(react_2.screen.queryByTestId('branch-decorator')).not.toBeInTheDocument();
|
|
129
148
|
expect(react_2.screen.getByTestId('multi-line-renderer')).toBeInTheDocument();
|
|
149
|
+
expect(react_2.screen.getByLabelText('Add comment')).toBeInTheDocument();
|
|
150
|
+
expect(react_2.screen.getByLabelText('Simple description')).toBeInTheDocument();
|
|
130
151
|
expect(react_2.screen.getByText('Simple label')).toBeInTheDocument();
|
|
131
152
|
expect(react_2.screen.getByText('+ 1')).toBeInTheDocument();
|
|
132
|
-
|
|
153
|
+
labels = react_2.screen.getAllByTestId('reltio-attribute-complex-label');
|
|
154
|
+
expect(labels).toHaveLength(1);
|
|
155
|
+
expect(labels[0]).toHaveTextContent('First value');
|
|
156
|
+
return [4 /*yield*/, user.click(react_2.screen.getByText('Show 1 more of remaining 4 value'))];
|
|
133
157
|
case 1:
|
|
134
158
|
_a.sent();
|
|
135
|
-
expect(actions.requestNextPageOfAttributeValues).
|
|
159
|
+
expect(actions.requestNextPageOfAttributeValues).toHaveBeenLastCalledWith({
|
|
136
160
|
attributeTypeName: 'Simple',
|
|
137
161
|
attributeTypeUri: 'configuration/entityTypes/HCP/attributes/Simple',
|
|
138
162
|
defaultMaxValues: 1,
|
|
139
163
|
parentUri: 'entities/sIeHttl',
|
|
140
164
|
values: ovValues
|
|
141
165
|
});
|
|
166
|
+
labels = react_2.screen.getAllByTestId('reltio-attribute-complex-label');
|
|
167
|
+
expect(labels).toHaveLength(2);
|
|
168
|
+
expect(labels[0]).toHaveTextContent('First value');
|
|
169
|
+
expect(labels[1]).toHaveTextContent('Second value');
|
|
170
|
+
return [4 /*yield*/, user.click(react_2.screen.getByText('Show 1 more of remaining 3 value'))];
|
|
171
|
+
case 2:
|
|
172
|
+
_a.sent();
|
|
173
|
+
expect(actions.requestNextPageOfAttributeValues).toHaveBeenLastCalledWith({
|
|
174
|
+
attributeTypeName: 'Simple',
|
|
175
|
+
attributeTypeUri: 'configuration/entityTypes/HCP/attributes/Simple',
|
|
176
|
+
defaultMaxValues: 1,
|
|
177
|
+
parentUri: 'entities/sIeHttl',
|
|
178
|
+
values: ovValues
|
|
179
|
+
});
|
|
180
|
+
labels = react_2.screen.getAllByTestId('reltio-attribute-complex-label');
|
|
181
|
+
expect(labels).toHaveLength(3);
|
|
182
|
+
expect(labels[0]).toHaveTextContent('First value');
|
|
183
|
+
expect(labels[1]).toHaveTextContent('Second value');
|
|
184
|
+
expect(labels[2]).toHaveTextContent('Third value');
|
|
185
|
+
return [4 /*yield*/, user.click(react_2.screen.getByText('Show 1 more of remaining 2 value'))];
|
|
186
|
+
case 3:
|
|
187
|
+
_a.sent();
|
|
188
|
+
return [4 /*yield*/, user.click(react_2.screen.getByText('Show 1 more of remaining 1 value'))];
|
|
189
|
+
case 4:
|
|
190
|
+
_a.sent();
|
|
191
|
+
return [4 /*yield*/, user.click(react_2.screen.getByText('Show less'))];
|
|
192
|
+
case 5:
|
|
193
|
+
_a.sent();
|
|
194
|
+
labels = react_2.screen.getAllByTestId('reltio-attribute-complex-label');
|
|
195
|
+
expect(labels).toHaveLength(1);
|
|
196
|
+
expect(labels[0]).toHaveTextContent('First value');
|
|
142
197
|
return [2 /*return*/];
|
|
143
198
|
}
|
|
144
199
|
});
|
|
@@ -148,6 +203,8 @@ describe('ReadOnlyAttributesPager tests', function () {
|
|
|
148
203
|
setUp({ props: props });
|
|
149
204
|
expect(react_2.screen.queryByTestId('branch-decorator')).not.toBeInTheDocument();
|
|
150
205
|
expect(react_2.screen.getByTestId('multi-line-renderer')).toBeInTheDocument();
|
|
206
|
+
expect(react_2.screen.getByLabelText('Add comment')).toBeInTheDocument();
|
|
207
|
+
expect(react_2.screen.getByLabelText('Simple description')).toBeInTheDocument();
|
|
151
208
|
expect(react_2.screen.getByText('Simple label')).toBeInTheDocument();
|
|
152
209
|
expect(react_2.screen.getByText('123')).toBeInTheDocument();
|
|
153
210
|
expect(react_2.screen.queryByText('+ 1')).not.toBeInTheDocument();
|