@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
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
var react_1 = __importDefault(require("react"));
|
|
30
|
-
var enzyme_1 = require("enzyme");
|
|
31
|
-
var Tooltip_1 = __importDefault(require("@mui/material/Tooltip"));
|
|
32
|
-
var helpers = __importStar(require("./helpers"));
|
|
33
|
-
var ListLabel_1 = require("./ListLabel");
|
|
34
|
-
describe('List label tests', function () {
|
|
35
|
-
beforeAll(function () {
|
|
36
|
-
jest.spyOn(helpers, 'countHiddenItems');
|
|
37
|
-
jest.spyOn(helpers, 'getListLabelWidth').mockReturnValue('100px');
|
|
38
|
-
});
|
|
39
|
-
it('should render all items if they do not overflow', function () {
|
|
40
|
-
helpers.countHiddenItems.mockReturnValueOnce(0);
|
|
41
|
-
var wrapper = (0, enzyme_1.mount)(react_1.default.createElement(ListLabel_1.ListLabel, { list: ['one', 'two', 'three'] }));
|
|
42
|
-
expect(wrapper.find('.visibleItemsLabel').text()).toEqual('one, two, three');
|
|
43
|
-
expect(wrapper.find(Tooltip_1.default).prop('title')).toEqual('');
|
|
44
|
-
});
|
|
45
|
-
it('should render only visible items, hidden count and tooltip if they overflow', function () {
|
|
46
|
-
helpers.countHiddenItems.mockReturnValueOnce(1);
|
|
47
|
-
var wrapper = (0, enzyme_1.mount)(react_1.default.createElement(ListLabel_1.ListLabel, { list: ['one', 'two', 'three'] }));
|
|
48
|
-
expect(wrapper.find('.visibleItemsLabel').text()).toEqual('one, two');
|
|
49
|
-
expect(wrapper.find('.hiddenCount').text()).toEqual('+1');
|
|
50
|
-
expect(wrapper.find(Tooltip_1.default).prop('title')).toEqual('one, two, three');
|
|
51
|
-
});
|
|
52
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,361 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
-
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);
|
|
24
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
-
function step(op) {
|
|
27
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
29
|
-
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;
|
|
30
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
-
switch (op[0]) {
|
|
32
|
-
case 0: case 1: t = op; break;
|
|
33
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
-
default:
|
|
37
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
-
if (t[2]) _.ops.pop();
|
|
42
|
-
_.trys.pop(); continue;
|
|
43
|
-
}
|
|
44
|
-
op = body.call(thisArg, _);
|
|
45
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
50
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
51
|
-
};
|
|
52
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
53
|
-
var react_1 = __importDefault(require("react"));
|
|
54
|
-
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
55
|
-
var react_2 = require("@testing-library/react");
|
|
56
|
-
var user_event_1 = __importDefault(require("@testing-library/user-event"));
|
|
57
|
-
var MdmModuleContext_1 = require("../contexts/MdmModuleContext");
|
|
58
|
-
var PivotingAttributeContext_1 = require("../contexts/PivotingAttributeContext");
|
|
59
|
-
var PivotingTooltip_1 = require("./PivotingTooltip");
|
|
60
|
-
jest.mock('@reltio/mdm-sdk', function () { return (__assign(__assign({}, jest.requireActual('@reltio/mdm-sdk')), { getFilteredEntities: jest.fn(), getTotals: jest.fn() })); });
|
|
61
|
-
var attributes = [
|
|
62
|
-
{
|
|
63
|
-
name: 'Phone',
|
|
64
|
-
uri: 'configuration/entityTypes/HCP/attributes/Phone2',
|
|
65
|
-
type: 'Nested',
|
|
66
|
-
attributes: [
|
|
67
|
-
{
|
|
68
|
-
uri: 'configuration/entityTypes/HCP/attributes/Phone2/attributes/Phone3',
|
|
69
|
-
name: 'Phone3',
|
|
70
|
-
type: 'String'
|
|
71
|
-
}
|
|
72
|
-
]
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
name: 'Phone3',
|
|
76
|
-
uri: 'configuration/entityTypes/HCP/attributes/Phone3',
|
|
77
|
-
type: 'Nested',
|
|
78
|
-
attributes: [
|
|
79
|
-
{
|
|
80
|
-
uri: 'configuration/entityTypes/HCP/attributes/Phone3/attributes/Phone4',
|
|
81
|
-
name: 'Phone4',
|
|
82
|
-
type: 'String'
|
|
83
|
-
}
|
|
84
|
-
]
|
|
85
|
-
}
|
|
86
|
-
];
|
|
87
|
-
var metadata = {
|
|
88
|
-
entityTypes: [
|
|
89
|
-
{
|
|
90
|
-
attributes: attributes,
|
|
91
|
-
uri: 'configuration/entityTypes/HCP',
|
|
92
|
-
analyticsAttributes: []
|
|
93
|
-
}
|
|
94
|
-
]
|
|
95
|
-
};
|
|
96
|
-
var uiPath = 'https://reltio.com/nui';
|
|
97
|
-
var openPivotingPerspective = jest.fn();
|
|
98
|
-
var defaultPivotingAttributeContextValue = [
|
|
99
|
-
{
|
|
100
|
-
uri: 'configuration/entityTypes/HCP/attributes/Phone'
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
uri: 'configuration/entityTypes/HCP/attributes/Phone2',
|
|
104
|
-
children: ['configuration/entityTypes/HCP/attributes/Phone2/attributes/Phone3']
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
uri: 'configuration/entityTypes/HCP/attributes/Phone3'
|
|
108
|
-
}
|
|
109
|
-
];
|
|
110
|
-
var globalFilter = {
|
|
111
|
-
query: "((equals(type,'configuration/entityTypes/HCP') and (range(updatedTime,1622458333452,1622717533451) or range(updatedTime,1622458333452,1622717533451))))",
|
|
112
|
-
savedSearches: [],
|
|
113
|
-
savedSearchesUris: []
|
|
114
|
-
};
|
|
115
|
-
var mockGetFilteredEntitiesResponse = [
|
|
116
|
-
{
|
|
117
|
-
uri: 'entities/01Qi9Bv',
|
|
118
|
-
type: 'configuration/entityTypes/HCP',
|
|
119
|
-
label: 'entity label'
|
|
120
|
-
}
|
|
121
|
-
];
|
|
122
|
-
var setUp = function (props, pivotingAttributeContextValue) {
|
|
123
|
-
if (pivotingAttributeContextValue === void 0) { pivotingAttributeContextValue = defaultPivotingAttributeContextValue; }
|
|
124
|
-
var user = user_event_1.default.setup();
|
|
125
|
-
(0, react_2.render)(react_1.default.createElement(MdmModuleContext_1.MdmModuleProvider, { values: {
|
|
126
|
-
metadata: metadata,
|
|
127
|
-
uiPath: uiPath,
|
|
128
|
-
globalFilter: globalFilter,
|
|
129
|
-
entity: {
|
|
130
|
-
uri: 'entityUri',
|
|
131
|
-
type: 'configuration/entityTypes/HCP'
|
|
132
|
-
}
|
|
133
|
-
}, actions: { openPivotingPerspective: openPivotingPerspective } },
|
|
134
|
-
react_1.default.createElement(PivotingAttributeContext_1.PivotingAttributeContext.Provider, { value: pivotingAttributeContextValue },
|
|
135
|
-
react_1.default.createElement(PivotingTooltip_1.PivotingTooltip, __assign({}, props)))));
|
|
136
|
-
return { user: user };
|
|
137
|
-
};
|
|
138
|
-
describe('PivotingTooltip test', function () {
|
|
139
|
-
var values = {
|
|
140
|
-
value: '8-800-555-35-35',
|
|
141
|
-
ov: true,
|
|
142
|
-
type: 'String',
|
|
143
|
-
lookupCode: '8-800-555-35-35',
|
|
144
|
-
lookupRawValue: '8-800-555-35-35'
|
|
145
|
-
};
|
|
146
|
-
beforeEach(function () {
|
|
147
|
-
mdm_sdk_1.getFilteredEntities.mockResolvedValue(mockGetFilteredEntitiesResponse);
|
|
148
|
-
mdm_sdk_1.getTotals.mockResolvedValue({ total: 5 });
|
|
149
|
-
});
|
|
150
|
-
it('getTotals should not be called if user do not hover tooltip', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
151
|
-
var value, attributeType, props, tooltip;
|
|
152
|
-
return __generator(this, function (_a) {
|
|
153
|
-
switch (_a.label) {
|
|
154
|
-
case 0:
|
|
155
|
-
value = __assign(__assign({}, values), { uri: 'configuration/entityTypes/HCP/attributes/Phone' });
|
|
156
|
-
attributeType = {
|
|
157
|
-
name: 'Phone',
|
|
158
|
-
uri: 'configuration/entityTypes/HCP/attributes/Phone',
|
|
159
|
-
type: 'String'
|
|
160
|
-
};
|
|
161
|
-
props = { value: value, attributeType: attributeType, children: '8-800-555-35-35' };
|
|
162
|
-
setUp(props);
|
|
163
|
-
return [4 /*yield*/, react_2.screen.findByText('8-800-555-35-35')];
|
|
164
|
-
case 1:
|
|
165
|
-
tooltip = _a.sent();
|
|
166
|
-
expect(tooltip).toBeInTheDocument();
|
|
167
|
-
expect(mdm_sdk_1.getTotals).toHaveBeenCalledTimes(0);
|
|
168
|
-
expect(mdm_sdk_1.getFilteredEntities).toHaveBeenCalledTimes(0);
|
|
169
|
-
return [2 /*return*/];
|
|
170
|
-
}
|
|
171
|
-
});
|
|
172
|
-
}); });
|
|
173
|
-
it('getFilteredEntities should be called with correct params', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
174
|
-
var value, attributeType, props, user, tooltip, tooltipHeader, tooltipContent;
|
|
175
|
-
return __generator(this, function (_a) {
|
|
176
|
-
switch (_a.label) {
|
|
177
|
-
case 0:
|
|
178
|
-
value = __assign(__assign({}, values), { uri: 'configuration/entityTypes/HCP/attributes/Phone' });
|
|
179
|
-
attributeType = {
|
|
180
|
-
name: 'Phone',
|
|
181
|
-
uri: 'configuration/entityTypes/HCP/attributes/Phone',
|
|
182
|
-
type: 'String'
|
|
183
|
-
};
|
|
184
|
-
props = { value: value, attributeType: attributeType, children: '8-800-555-35-35' };
|
|
185
|
-
user = setUp(props).user;
|
|
186
|
-
return [4 /*yield*/, react_2.screen.findByText('8-800-555-35-35')];
|
|
187
|
-
case 1:
|
|
188
|
-
tooltip = _a.sent();
|
|
189
|
-
return [4 /*yield*/, user.hover(tooltip)];
|
|
190
|
-
case 2:
|
|
191
|
-
_a.sent();
|
|
192
|
-
return [4 /*yield*/, react_2.screen.findByText('Pivot profiles')];
|
|
193
|
-
case 3:
|
|
194
|
-
tooltipHeader = _a.sent();
|
|
195
|
-
expect(tooltipHeader).toBeInTheDocument();
|
|
196
|
-
return [4 /*yield*/, react_2.screen.findByText('entity label')];
|
|
197
|
-
case 4:
|
|
198
|
-
tooltipContent = _a.sent();
|
|
199
|
-
expect(tooltipContent).toBeInTheDocument();
|
|
200
|
-
expect(mdm_sdk_1.getFilteredEntities).toHaveBeenCalledWith({
|
|
201
|
-
filters: [
|
|
202
|
-
{ fieldName: 'type', filter: 'equals', values: ['configuration/entityTypes/HCP'] },
|
|
203
|
-
{ fieldName: 'attributes.Phone', filter: 'equals', values: ['8-800-555-35-35'] }
|
|
204
|
-
],
|
|
205
|
-
options: {
|
|
206
|
-
activityFilter: undefined,
|
|
207
|
-
globalFilter: "((equals(type,'configuration/entityTypes/HCP') and (range(updatedTime,1622458333452,1622717533451) or range(updatedTime,1622458333452,1622717533451))))",
|
|
208
|
-
max: 6,
|
|
209
|
-
searchOptions: '',
|
|
210
|
-
sort: 'label'
|
|
211
|
-
}
|
|
212
|
-
});
|
|
213
|
-
return [2 /*return*/];
|
|
214
|
-
}
|
|
215
|
-
});
|
|
216
|
-
}); });
|
|
217
|
-
it('getFilteredEntities should be called with correct entity type if PivotingAttributeContextValue contain popup', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
218
|
-
var value, attributeType, props, pivotingAttributeContextValue, user, tooltip, tooltipHeader, tooltipContent;
|
|
219
|
-
return __generator(this, function (_a) {
|
|
220
|
-
switch (_a.label) {
|
|
221
|
-
case 0:
|
|
222
|
-
value = __assign(__assign({}, values), { uri: 'configuration/entityTypes/HCP/attributes/Phone' });
|
|
223
|
-
attributeType = {
|
|
224
|
-
name: 'Phone',
|
|
225
|
-
uri: 'configuration/entityTypes/HCP/attributes/Phone',
|
|
226
|
-
type: 'String'
|
|
227
|
-
};
|
|
228
|
-
props = { value: value, attributeType: attributeType, children: '8-800-555-35-35' };
|
|
229
|
-
pivotingAttributeContextValue = [
|
|
230
|
-
{
|
|
231
|
-
uri: 'configuration/entityTypes/HCP/attributes/Phone',
|
|
232
|
-
popup: { entityType: 'configuration/entityTypes/HCP_1', label: 'HCPs status' }
|
|
233
|
-
}
|
|
234
|
-
];
|
|
235
|
-
user = setUp(props, pivotingAttributeContextValue).user;
|
|
236
|
-
return [4 /*yield*/, react_2.screen.findByText('8-800-555-35-35')];
|
|
237
|
-
case 1:
|
|
238
|
-
tooltip = _a.sent();
|
|
239
|
-
return [4 /*yield*/, user.hover(tooltip)];
|
|
240
|
-
case 2:
|
|
241
|
-
_a.sent();
|
|
242
|
-
return [4 /*yield*/, react_2.screen.findByText('Pivot profiles')];
|
|
243
|
-
case 3:
|
|
244
|
-
tooltipHeader = _a.sent();
|
|
245
|
-
expect(tooltipHeader).toBeInTheDocument();
|
|
246
|
-
return [4 /*yield*/, react_2.screen.findByText('entity label')];
|
|
247
|
-
case 4:
|
|
248
|
-
tooltipContent = _a.sent();
|
|
249
|
-
expect(tooltipContent).toBeInTheDocument();
|
|
250
|
-
expect(mdm_sdk_1.getFilteredEntities).toHaveBeenCalledWith({
|
|
251
|
-
filters: [
|
|
252
|
-
{ fieldName: 'type', filter: 'equals', values: ['configuration/entityTypes/HCP_1'] },
|
|
253
|
-
{ fieldName: 'attributes.Phone', filter: 'equals', values: ['8-800-555-35-35'] }
|
|
254
|
-
],
|
|
255
|
-
options: {
|
|
256
|
-
activityFilter: undefined,
|
|
257
|
-
globalFilter: "((equals(type,'configuration/entityTypes/HCP') and (range(updatedTime,1622458333452,1622717533451) or range(updatedTime,1622458333452,1622717533451))))",
|
|
258
|
-
max: 6,
|
|
259
|
-
searchOptions: '',
|
|
260
|
-
sort: 'label'
|
|
261
|
-
}
|
|
262
|
-
});
|
|
263
|
-
return [2 /*return*/];
|
|
264
|
-
}
|
|
265
|
-
});
|
|
266
|
-
}); });
|
|
267
|
-
it('getTotals should be called with correct params', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
268
|
-
var value, attributeType, props, user, tooltip, tooltipHeader, tooltipContent;
|
|
269
|
-
return __generator(this, function (_a) {
|
|
270
|
-
switch (_a.label) {
|
|
271
|
-
case 0:
|
|
272
|
-
value = __assign(__assign({}, values), { uri: 'configuration/entityTypes/HCP/attributes/Phone' });
|
|
273
|
-
attributeType = {
|
|
274
|
-
name: 'Phone',
|
|
275
|
-
uri: 'configuration/entityTypes/HCP/attributes/Phone',
|
|
276
|
-
type: 'String'
|
|
277
|
-
};
|
|
278
|
-
props = { value: value, attributeType: attributeType, children: '8-800-555-35-35' };
|
|
279
|
-
user = setUp(props).user;
|
|
280
|
-
return [4 /*yield*/, react_2.screen.findByText('8-800-555-35-35')];
|
|
281
|
-
case 1:
|
|
282
|
-
tooltip = _a.sent();
|
|
283
|
-
return [4 /*yield*/, user.hover(tooltip)];
|
|
284
|
-
case 2:
|
|
285
|
-
_a.sent();
|
|
286
|
-
return [4 /*yield*/, react_2.screen.findByText('Pivot profiles')];
|
|
287
|
-
case 3:
|
|
288
|
-
tooltipHeader = _a.sent();
|
|
289
|
-
expect(tooltipHeader).toBeInTheDocument();
|
|
290
|
-
return [4 /*yield*/, react_2.screen.findByText('entity label')];
|
|
291
|
-
case 4:
|
|
292
|
-
tooltipContent = _a.sent();
|
|
293
|
-
expect(tooltipContent).toBeInTheDocument();
|
|
294
|
-
expect(mdm_sdk_1.getTotals).toHaveBeenCalledWith({
|
|
295
|
-
filters: [
|
|
296
|
-
{ fieldName: 'type', filter: 'equals', values: ['configuration/entityTypes/HCP'] },
|
|
297
|
-
{ fieldName: 'attributes.Phone', filter: 'equals', values: ['8-800-555-35-35'] }
|
|
298
|
-
],
|
|
299
|
-
options: {
|
|
300
|
-
activityFilter: undefined,
|
|
301
|
-
globalFilter: "((equals(type,'configuration/entityTypes/HCP') and (range(updatedTime,1622458333452,1622717533451) or range(updatedTime,1622458333452,1622717533451))))",
|
|
302
|
-
max: 6,
|
|
303
|
-
searchOptions: '',
|
|
304
|
-
sort: 'label'
|
|
305
|
-
}
|
|
306
|
-
});
|
|
307
|
-
return [2 /*return*/];
|
|
308
|
-
}
|
|
309
|
-
});
|
|
310
|
-
}); });
|
|
311
|
-
it('getTotals should be called with correct entity type if PivotingAttributeContextValue contain popup', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
312
|
-
var value, attributeType, props, pivotingAttributeContextValue, user, tooltip, tooltipHeader, tooltipContent;
|
|
313
|
-
return __generator(this, function (_a) {
|
|
314
|
-
switch (_a.label) {
|
|
315
|
-
case 0:
|
|
316
|
-
value = __assign(__assign({}, values), { uri: 'configuration/entityTypes/HCP/attributes/Phone' });
|
|
317
|
-
attributeType = {
|
|
318
|
-
name: 'Phone',
|
|
319
|
-
uri: 'configuration/entityTypes/HCP/attributes/Phone',
|
|
320
|
-
type: 'String'
|
|
321
|
-
};
|
|
322
|
-
props = { value: value, attributeType: attributeType, children: '8-800-555-35-35' };
|
|
323
|
-
pivotingAttributeContextValue = [
|
|
324
|
-
{
|
|
325
|
-
uri: 'configuration/entityTypes/HCP/attributes/Phone',
|
|
326
|
-
popup: { entityType: 'configuration/entityTypes/HCP_1', label: 'HCPs status' }
|
|
327
|
-
}
|
|
328
|
-
];
|
|
329
|
-
user = setUp(props, pivotingAttributeContextValue).user;
|
|
330
|
-
return [4 /*yield*/, react_2.screen.findByText('8-800-555-35-35')];
|
|
331
|
-
case 1:
|
|
332
|
-
tooltip = _a.sent();
|
|
333
|
-
return [4 /*yield*/, user.hover(tooltip)];
|
|
334
|
-
case 2:
|
|
335
|
-
_a.sent();
|
|
336
|
-
return [4 /*yield*/, react_2.screen.findByText('Pivot profiles')];
|
|
337
|
-
case 3:
|
|
338
|
-
tooltipHeader = _a.sent();
|
|
339
|
-
expect(tooltipHeader).toBeInTheDocument();
|
|
340
|
-
return [4 /*yield*/, react_2.screen.findByText('entity label')];
|
|
341
|
-
case 4:
|
|
342
|
-
tooltipContent = _a.sent();
|
|
343
|
-
expect(tooltipContent).toBeInTheDocument();
|
|
344
|
-
expect(mdm_sdk_1.getTotals).toHaveBeenCalledWith({
|
|
345
|
-
filters: [
|
|
346
|
-
{ fieldName: 'type', filter: 'equals', values: ['configuration/entityTypes/HCP_1'] },
|
|
347
|
-
{ fieldName: 'attributes.Phone', filter: 'equals', values: ['8-800-555-35-35'] }
|
|
348
|
-
],
|
|
349
|
-
options: {
|
|
350
|
-
activityFilter: undefined,
|
|
351
|
-
globalFilter: "((equals(type,'configuration/entityTypes/HCP') and (range(updatedTime,1622458333452,1622717533451) or range(updatedTime,1622458333452,1622717533451))))",
|
|
352
|
-
max: 6,
|
|
353
|
-
searchOptions: '',
|
|
354
|
-
sort: 'label'
|
|
355
|
-
}
|
|
356
|
-
});
|
|
357
|
-
return [2 /*return*/];
|
|
358
|
-
}
|
|
359
|
-
});
|
|
360
|
-
}); });
|
|
361
|
-
});
|
package/cjs/PivotingTooltip/components/PivotingTooltipContent/PivotingTooltipContent.test.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/cjs/PivotingTooltip/components/PivotingTooltipContent/PivotingTooltipContent.test.js
DELETED
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
-
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);
|
|
24
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
-
function step(op) {
|
|
27
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
29
|
-
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;
|
|
30
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
-
switch (op[0]) {
|
|
32
|
-
case 0: case 1: t = op; break;
|
|
33
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
-
default:
|
|
37
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
-
if (t[2]) _.ops.pop();
|
|
42
|
-
_.trys.pop(); continue;
|
|
43
|
-
}
|
|
44
|
-
op = body.call(thisArg, _);
|
|
45
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
50
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
51
|
-
};
|
|
52
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
53
|
-
var react_1 = __importDefault(require("react"));
|
|
54
|
-
var enzyme_1 = require("enzyme");
|
|
55
|
-
var test_utils_1 = require("react-dom/test-utils");
|
|
56
|
-
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
57
|
-
var PivotingUriLink_1 = require("../../../PivotingUriLink");
|
|
58
|
-
var MdmModuleContext_1 = require("../../../contexts/MdmModuleContext");
|
|
59
|
-
var PivotingTooltipContent_1 = require("./PivotingTooltipContent");
|
|
60
|
-
jest.mock('@reltio/mdm-sdk', function () { return (__assign(__assign({}, jest.requireActual('@reltio/mdm-sdk')), { getFilteredEntities: jest.fn(), getTotals: jest.fn() })); });
|
|
61
|
-
jest.mock('../../../EntityAvatar', function () { return ({
|
|
62
|
-
EntityAvatar: function () { return react_1.default.createElement("div", null); }
|
|
63
|
-
}); });
|
|
64
|
-
var entityType = 'configuration/entityTypes/HCP';
|
|
65
|
-
var entity = {
|
|
66
|
-
uri: 'entities/13JKIKAz',
|
|
67
|
-
type: entityType,
|
|
68
|
-
attributes: {},
|
|
69
|
-
label: 'Active'
|
|
70
|
-
};
|
|
71
|
-
var mdmValues = {
|
|
72
|
-
activityFilter: undefined,
|
|
73
|
-
globalFilter: {
|
|
74
|
-
query: "((equals(type,'configuration/entityTypes/HCP') and (range(updatedTime,1622458333452,1622717533451) or range(updatedTime,1622458333452,1622717533451))))",
|
|
75
|
-
savedSearches: [],
|
|
76
|
-
savedSearchesUris: []
|
|
77
|
-
},
|
|
78
|
-
searchOptions: {},
|
|
79
|
-
entity: entity,
|
|
80
|
-
uiPath: 'https://reltio.com/nui'
|
|
81
|
-
};
|
|
82
|
-
var defaultProps = {
|
|
83
|
-
generatedValue: [{ CountryCode: 'IT' }],
|
|
84
|
-
value: '123 456',
|
|
85
|
-
attributeType: {
|
|
86
|
-
label: 'Country Code',
|
|
87
|
-
name: 'CountryCode',
|
|
88
|
-
type: 'String',
|
|
89
|
-
uri: 'configuration/entityTypes/HCP/attributes/CountryCode'
|
|
90
|
-
},
|
|
91
|
-
config: {},
|
|
92
|
-
onSeeAllClick: jest.fn(),
|
|
93
|
-
entities: [
|
|
94
|
-
{
|
|
95
|
-
uri: 'entities/1',
|
|
96
|
-
type: 'configuration/entityTypes/HCP',
|
|
97
|
-
label: 'BulkUpdate_regression_12',
|
|
98
|
-
secondaryLabel: 'UKyFCjjugYimtXm Ihmetwet'
|
|
99
|
-
}
|
|
100
|
-
],
|
|
101
|
-
total: 2
|
|
102
|
-
};
|
|
103
|
-
var setUp = function (props) {
|
|
104
|
-
if (props === void 0) { props = defaultProps; }
|
|
105
|
-
return (0, enzyme_1.mount)(react_1.default.createElement(MdmModuleContext_1.MdmModuleProvider, { values: mdmValues },
|
|
106
|
-
react_1.default.createElement(PivotingTooltipContent_1.PivotingTooltipContent, __assign({}, props))));
|
|
107
|
-
};
|
|
108
|
-
describe('PivotingTooltipContent test', function () {
|
|
109
|
-
it('EntityUriLink should be rendered', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
110
|
-
var component, entityContainer;
|
|
111
|
-
return __generator(this, function (_a) {
|
|
112
|
-
component = setUp();
|
|
113
|
-
expect(component).not.toBeNull();
|
|
114
|
-
entityContainer = component.find('.entityContainer');
|
|
115
|
-
expect(entityContainer.length).toBe(1);
|
|
116
|
-
return [2 /*return*/];
|
|
117
|
-
});
|
|
118
|
-
}); });
|
|
119
|
-
it('EntityUriLink should be rendered with to many entities', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
120
|
-
var component, entityContainer;
|
|
121
|
-
return __generator(this, function (_a) {
|
|
122
|
-
component = setUp(__assign(__assign({}, defaultProps), { entities: [
|
|
123
|
-
{
|
|
124
|
-
uri: 'entities/1',
|
|
125
|
-
type: 'configuration/entityTypes/HCP',
|
|
126
|
-
label: 'BulkUpdate_regression_12',
|
|
127
|
-
secondaryLabel: 'UKyFCjjugYimtXm Ihmetwet'
|
|
128
|
-
},
|
|
129
|
-
{
|
|
130
|
-
uri: 'entities/2',
|
|
131
|
-
type: 'configuration/entityTypes/HCP',
|
|
132
|
-
label: 'BulkUpdate_regression_12',
|
|
133
|
-
secondaryLabel: 'UKyFCjjugYimtXm Ihmetwet'
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
uri: 'entities/3',
|
|
137
|
-
type: 'configuration/entityTypes/HCP',
|
|
138
|
-
label: 'BulkUpdate_regression_12',
|
|
139
|
-
secondaryLabel: 'UKyFCjjugYimtXm Ihmetwet'
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
uri: 'entities/4',
|
|
143
|
-
type: 'configuration/entityTypes/HCP',
|
|
144
|
-
label: 'BulkUpdate_regression_12',
|
|
145
|
-
secondaryLabel: 'UKyFCjjugYimtXm Ihmetwet'
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
uri: 'entities/5',
|
|
149
|
-
type: 'configuration/entityTypes/HCP',
|
|
150
|
-
label: 'BulkUpdate_regression_12',
|
|
151
|
-
secondaryLabel: 'UKyFCjjugYimtXm Ihmetwet'
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
uri: 'entities/6',
|
|
155
|
-
type: 'configuration/entityTypes/HCP',
|
|
156
|
-
label: 'BulkUpdate_regression_12',
|
|
157
|
-
secondaryLabel: 'UKyFCjjugYimtXm Ihmetwet'
|
|
158
|
-
}
|
|
159
|
-
] }));
|
|
160
|
-
expect(component).not.toBeNull();
|
|
161
|
-
entityContainer = component.find('.entityContainer');
|
|
162
|
-
expect(entityContainer.length).toBe(6);
|
|
163
|
-
return [2 /*return*/];
|
|
164
|
-
});
|
|
165
|
-
}); });
|
|
166
|
-
it('should show number of items correctly', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
167
|
-
var component;
|
|
168
|
-
return __generator(this, function (_a) {
|
|
169
|
-
component = setUp();
|
|
170
|
-
expect(component.find('.headerCount').text()).toBe('2 items');
|
|
171
|
-
return [2 /*return*/];
|
|
172
|
-
});
|
|
173
|
-
}); });
|
|
174
|
-
it('should not show footer with see all button if total count less than 6', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
175
|
-
var component;
|
|
176
|
-
return __generator(this, function (_a) {
|
|
177
|
-
mdm_sdk_1.getTotals.mockImplementation(function () { return Promise.resolve({ total: 4 }); });
|
|
178
|
-
component = setUp();
|
|
179
|
-
expect(component.find('.footer')).toHaveLength(0);
|
|
180
|
-
return [2 /*return*/];
|
|
181
|
-
});
|
|
182
|
-
}); });
|
|
183
|
-
it('should show footer with see all button if total count more than 6', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
184
|
-
var component;
|
|
185
|
-
return __generator(this, function (_a) {
|
|
186
|
-
mdm_sdk_1.getTotals.mockImplementation(function () { return Promise.resolve({ total: 10 }); });
|
|
187
|
-
component = setUp(__assign(__assign({}, defaultProps), { total: 7 }));
|
|
188
|
-
expect(component.find('.footer')).toHaveLength(1);
|
|
189
|
-
return [2 /*return*/];
|
|
190
|
-
});
|
|
191
|
-
}); });
|
|
192
|
-
it('handleClickSeeAll handler should work and the properties are passed correctly', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
193
|
-
var generatedValue, attributeType, onSeeAllClick, component;
|
|
194
|
-
return __generator(this, function (_a) {
|
|
195
|
-
generatedValue = defaultProps.generatedValue, attributeType = defaultProps.attributeType, onSeeAllClick = defaultProps.onSeeAllClick;
|
|
196
|
-
component = setUp(__assign(__assign({}, defaultProps), { total: 7 }));
|
|
197
|
-
(0, test_utils_1.act)(function () {
|
|
198
|
-
component.find(PivotingUriLink_1.PivotingUriLink).prop('onClick')();
|
|
199
|
-
});
|
|
200
|
-
expect(onSeeAllClick).toHaveBeenCalled();
|
|
201
|
-
expect(component.find(PivotingUriLink_1.PivotingUriLink).prop('value')).toEqual(generatedValue);
|
|
202
|
-
expect(component.find(PivotingUriLink_1.PivotingUriLink).prop('attributeType')).toEqual(attributeType);
|
|
203
|
-
return [2 /*return*/];
|
|
204
|
-
});
|
|
205
|
-
}); });
|
|
206
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|