@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
|
@@ -10,93 +10,163 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
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
|
+
};
|
|
13
49
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
50
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
51
|
};
|
|
16
52
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
53
|
var react_1 = __importDefault(require("react"));
|
|
18
|
-
var
|
|
54
|
+
var react_2 = require("@testing-library/react");
|
|
19
55
|
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
20
|
-
var useCollaboration_1 = require("../hooks/useCollaboration");
|
|
21
|
-
var ProfileBand_1 = require("../ProfileBand");
|
|
22
|
-
var ProfileBandNavigation_1 = require("../ProfileBandNavigation");
|
|
23
|
-
var CommentsContainer_1 = require("../CommentsContainer");
|
|
24
|
-
var CollaborationContext_1 = require("../contexts/CollaborationContext");
|
|
25
|
-
var history_1 = require("../features/history");
|
|
26
|
-
var constants_1 = require("../constants");
|
|
27
56
|
var ScreenProfileBand_1 = require("./ScreenProfileBand");
|
|
57
|
+
var MdmModuleContext_1 = require("../contexts/MdmModuleContext");
|
|
58
|
+
var ActionsHookContext_1 = require("../contexts/ActionsHookContext");
|
|
59
|
+
jest.mock('@reltio/mdm-sdk', function () { return (__assign(__assign({}, jest.requireActual('@reltio/mdm-sdk')), { getCommentsCount: jest.fn(), getAllUsersForTenant: jest.fn() })); });
|
|
28
60
|
var defaultEntity = {
|
|
29
61
|
uri: 'entities/uri1',
|
|
30
|
-
type: 'configuration/entityTypes/HCO'
|
|
62
|
+
type: 'configuration/entityTypes/HCO',
|
|
63
|
+
label: 'Test entity',
|
|
64
|
+
secondaryLabel: 'Secondary label for test entity'
|
|
31
65
|
};
|
|
32
66
|
var defaultProps = {
|
|
33
67
|
entity: defaultEntity,
|
|
34
68
|
historySlice: undefined
|
|
35
69
|
};
|
|
36
|
-
var
|
|
37
|
-
|
|
38
|
-
|
|
70
|
+
var defaultMdmValues = {
|
|
71
|
+
metadata: {
|
|
72
|
+
entityTypes: [
|
|
73
|
+
{
|
|
74
|
+
uri: 'configuration/entityTypes/HCO',
|
|
75
|
+
label: 'HCO',
|
|
76
|
+
typeImage: 'images/defaultImage/image.png'
|
|
77
|
+
}
|
|
78
|
+
]
|
|
79
|
+
},
|
|
80
|
+
entity: defaultEntity,
|
|
81
|
+
absoluteImagePath: 'https://reltio.com/nui/imagePath',
|
|
82
|
+
mode: mdm_sdk_1.Mode.Viewing,
|
|
83
|
+
searchNavigationData: {
|
|
84
|
+
uri: 'entities/uri1',
|
|
85
|
+
index: 0,
|
|
86
|
+
total: 3,
|
|
87
|
+
tenant: 'alenat',
|
|
88
|
+
cache: ['entities/uri1', 'entities/uri2', 'entities/uri3']
|
|
89
|
+
},
|
|
90
|
+
isCollaborationEnabled: true
|
|
91
|
+
};
|
|
92
|
+
var setUp = function (_a) {
|
|
93
|
+
var _b = _a === void 0 ? {} : _a, _c = _b.props, props = _c === void 0 ? defaultProps : _c, _d = _b.mdmValues, mdmValues = _d === void 0 ? defaultMdmValues : _d;
|
|
94
|
+
var Providers = function (_a) {
|
|
95
|
+
var children = _a.children;
|
|
96
|
+
return (react_1.default.createElement(MdmModuleContext_1.MdmModuleProvider, { values: mdmValues },
|
|
97
|
+
react_1.default.createElement(ActionsHookContext_1.ActionsHookProvider, { hook: function () { return function () { }; } }, children)));
|
|
98
|
+
};
|
|
99
|
+
return (0, react_2.render)(react_1.default.createElement(ScreenProfileBand_1.ScreenProfileBand, __assign({}, props)), { wrapper: Providers });
|
|
39
100
|
};
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
101
|
+
describe('Screen profile band tests', function () {
|
|
102
|
+
beforeEach(function () {
|
|
103
|
+
mdm_sdk_1.getCommentsCount.mockResolvedValue({ objectId: 'entities/uri1', comments: [] });
|
|
104
|
+
mdm_sdk_1.getAllUsersForTenant.mockResolvedValue([
|
|
105
|
+
{ username: 'alexey.ivanov', email: 'alexey.ivanov@reltio.com' }
|
|
106
|
+
]);
|
|
107
|
+
});
|
|
44
108
|
afterEach(function () {
|
|
45
109
|
jest.clearAllMocks();
|
|
46
110
|
});
|
|
47
|
-
it('should render main components', function () {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
111
|
+
it('should render main components correctly', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
112
|
+
return __generator(this, function (_a) {
|
|
113
|
+
switch (_a.label) {
|
|
114
|
+
case 0:
|
|
115
|
+
setUp();
|
|
116
|
+
return [4 /*yield*/, react_2.screen.findByLabelText('Add comment')];
|
|
117
|
+
case 1:
|
|
118
|
+
_a.sent();
|
|
119
|
+
expect(react_2.screen.getByRole('img')).toHaveAttribute('src', 'https://reltio.com/nui/imagePath/images/defaultImage/image.png');
|
|
120
|
+
react_2.screen.getByText('Test entity');
|
|
121
|
+
react_2.screen.getByText('Secondary label for test entity');
|
|
122
|
+
react_2.screen.getByText('HCO');
|
|
123
|
+
react_2.screen.getByText('3 Search results');
|
|
124
|
+
react_2.screen.getByLabelText('Go to previous profile');
|
|
125
|
+
react_2.screen.getByLabelText('Go to next profile');
|
|
126
|
+
return [2 /*return*/];
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
}); });
|
|
130
|
+
it('should render profile band history if historySlice prop is provided', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
131
|
+
var historySlice, props, mdmValues;
|
|
132
|
+
return __generator(this, function (_a) {
|
|
133
|
+
switch (_a.label) {
|
|
134
|
+
case 0:
|
|
135
|
+
historySlice = {
|
|
136
|
+
aEntity: {
|
|
137
|
+
uri: 'entities/uri1',
|
|
138
|
+
type: 'configuration/entityTypes/HCO',
|
|
139
|
+
label: 'Test history entity',
|
|
140
|
+
secondaryLabel: 'Secondary label for test history entity'
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
props = __assign(__assign({}, defaultProps), { historySlice: historySlice });
|
|
144
|
+
mdmValues = __assign(__assign({}, defaultMdmValues), { historyEvent: { aStamp: 1736357647430 } });
|
|
145
|
+
setUp({ props: props, mdmValues: mdmValues });
|
|
146
|
+
return [4 /*yield*/, (0, react_2.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
147
|
+
return __generator(this, function (_a) {
|
|
148
|
+
switch (_a.label) {
|
|
149
|
+
case 0: return [4 /*yield*/, Promise.resolve()];
|
|
150
|
+
case 1:
|
|
151
|
+
_a.sent();
|
|
152
|
+
return [2 /*return*/];
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
}); })];
|
|
156
|
+
case 1:
|
|
157
|
+
_a.sent();
|
|
158
|
+
expect(react_2.screen.getByRole('img')).toHaveAttribute('src', 'https://reltio.com/nui/imagePath/images/defaultImage/image.png');
|
|
159
|
+
react_2.screen.getByText('Test history entity');
|
|
160
|
+
react_2.screen.getByText('Secondary label for test history entity');
|
|
161
|
+
react_2.screen.getByText('HCO');
|
|
162
|
+
react_2.screen.getByText('You are viewing a historic slice:');
|
|
163
|
+
react_2.screen.getByText('Wed, Jan 8, 2025 5:34 PM');
|
|
164
|
+
expect(react_2.screen.queryByLabelText('Add comment')).not.toBeInTheDocument();
|
|
165
|
+
expect(react_2.screen.queryByLabelText('Go to search results')).not.toBeInTheDocument();
|
|
166
|
+
expect(react_2.screen.queryByLabelText('Go to previous profile')).not.toBeInTheDocument();
|
|
167
|
+
expect(react_2.screen.queryByLabelText('Go to next profile')).not.toBeInTheDocument();
|
|
168
|
+
return [2 /*return*/];
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
}); });
|
|
102
172
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reltio/components",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.2071",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE FILE",
|
|
5
5
|
"main": "./cjs/index.js",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"@fluentui/react-context-selector": "^9.1.26",
|
|
12
12
|
"@googlemaps/markerclusterer": "^2.5.3",
|
|
13
13
|
"@react-sigma/core": "3.4.0",
|
|
14
|
-
"@reltio/mdm-sdk": "^1.4.
|
|
14
|
+
"@reltio/mdm-sdk": "^1.4.1918",
|
|
15
15
|
"@vis.gl/react-google-maps": "^1.3.0",
|
|
16
16
|
"d3-cloud": "^1.2.5",
|
|
17
17
|
"d3-geo": "^2.0.1",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { mount } from 'enzyme';
|
|
3
|
-
import Tooltip from '@mui/material/Tooltip';
|
|
4
|
-
import * as helpers from './helpers';
|
|
5
|
-
import { ListLabel } from './ListLabel';
|
|
6
|
-
describe('List label tests', function () {
|
|
7
|
-
beforeAll(function () {
|
|
8
|
-
jest.spyOn(helpers, 'countHiddenItems');
|
|
9
|
-
jest.spyOn(helpers, 'getListLabelWidth').mockReturnValue('100px');
|
|
10
|
-
});
|
|
11
|
-
it('should render all items if they do not overflow', function () {
|
|
12
|
-
helpers.countHiddenItems.mockReturnValueOnce(0);
|
|
13
|
-
var wrapper = mount(React.createElement(ListLabel, { list: ['one', 'two', 'three'] }));
|
|
14
|
-
expect(wrapper.find('.visibleItemsLabel').text()).toEqual('one, two, three');
|
|
15
|
-
expect(wrapper.find(Tooltip).prop('title')).toEqual('');
|
|
16
|
-
});
|
|
17
|
-
it('should render only visible items, hidden count and tooltip if they overflow', function () {
|
|
18
|
-
helpers.countHiddenItems.mockReturnValueOnce(1);
|
|
19
|
-
var wrapper = mount(React.createElement(ListLabel, { list: ['one', 'two', 'three'] }));
|
|
20
|
-
expect(wrapper.find('.visibleItemsLabel').text()).toEqual('one, two');
|
|
21
|
-
expect(wrapper.find('.hiddenCount').text()).toEqual('+1');
|
|
22
|
-
expect(wrapper.find(Tooltip).prop('title')).toEqual('one, two, three');
|
|
23
|
-
});
|
|
24
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,356 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
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
|
-
};
|
|
48
|
-
import React from 'react';
|
|
49
|
-
import { getFilteredEntities, getTotals } from '@reltio/mdm-sdk';
|
|
50
|
-
import { render, screen } from '@testing-library/react';
|
|
51
|
-
import userEvent from '@testing-library/user-event';
|
|
52
|
-
import { MdmModuleProvider } from '../contexts/MdmModuleContext';
|
|
53
|
-
import { PivotingAttributeContext } from '../contexts/PivotingAttributeContext';
|
|
54
|
-
import { PivotingTooltip } from './PivotingTooltip';
|
|
55
|
-
jest.mock('@reltio/mdm-sdk', function () { return (__assign(__assign({}, jest.requireActual('@reltio/mdm-sdk')), { getFilteredEntities: jest.fn(), getTotals: jest.fn() })); });
|
|
56
|
-
var attributes = [
|
|
57
|
-
{
|
|
58
|
-
name: 'Phone',
|
|
59
|
-
uri: 'configuration/entityTypes/HCP/attributes/Phone2',
|
|
60
|
-
type: 'Nested',
|
|
61
|
-
attributes: [
|
|
62
|
-
{
|
|
63
|
-
uri: 'configuration/entityTypes/HCP/attributes/Phone2/attributes/Phone3',
|
|
64
|
-
name: 'Phone3',
|
|
65
|
-
type: 'String'
|
|
66
|
-
}
|
|
67
|
-
]
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
name: 'Phone3',
|
|
71
|
-
uri: 'configuration/entityTypes/HCP/attributes/Phone3',
|
|
72
|
-
type: 'Nested',
|
|
73
|
-
attributes: [
|
|
74
|
-
{
|
|
75
|
-
uri: 'configuration/entityTypes/HCP/attributes/Phone3/attributes/Phone4',
|
|
76
|
-
name: 'Phone4',
|
|
77
|
-
type: 'String'
|
|
78
|
-
}
|
|
79
|
-
]
|
|
80
|
-
}
|
|
81
|
-
];
|
|
82
|
-
var metadata = {
|
|
83
|
-
entityTypes: [
|
|
84
|
-
{
|
|
85
|
-
attributes: attributes,
|
|
86
|
-
uri: 'configuration/entityTypes/HCP',
|
|
87
|
-
analyticsAttributes: []
|
|
88
|
-
}
|
|
89
|
-
]
|
|
90
|
-
};
|
|
91
|
-
var uiPath = 'https://reltio.com/nui';
|
|
92
|
-
var openPivotingPerspective = jest.fn();
|
|
93
|
-
var defaultPivotingAttributeContextValue = [
|
|
94
|
-
{
|
|
95
|
-
uri: 'configuration/entityTypes/HCP/attributes/Phone'
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
uri: 'configuration/entityTypes/HCP/attributes/Phone2',
|
|
99
|
-
children: ['configuration/entityTypes/HCP/attributes/Phone2/attributes/Phone3']
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
uri: 'configuration/entityTypes/HCP/attributes/Phone3'
|
|
103
|
-
}
|
|
104
|
-
];
|
|
105
|
-
var globalFilter = {
|
|
106
|
-
query: "((equals(type,'configuration/entityTypes/HCP') and (range(updatedTime,1622458333452,1622717533451) or range(updatedTime,1622458333452,1622717533451))))",
|
|
107
|
-
savedSearches: [],
|
|
108
|
-
savedSearchesUris: []
|
|
109
|
-
};
|
|
110
|
-
var mockGetFilteredEntitiesResponse = [
|
|
111
|
-
{
|
|
112
|
-
uri: 'entities/01Qi9Bv',
|
|
113
|
-
type: 'configuration/entityTypes/HCP',
|
|
114
|
-
label: 'entity label'
|
|
115
|
-
}
|
|
116
|
-
];
|
|
117
|
-
var setUp = function (props, pivotingAttributeContextValue) {
|
|
118
|
-
if (pivotingAttributeContextValue === void 0) { pivotingAttributeContextValue = defaultPivotingAttributeContextValue; }
|
|
119
|
-
var user = userEvent.setup();
|
|
120
|
-
render(React.createElement(MdmModuleProvider, { values: {
|
|
121
|
-
metadata: metadata,
|
|
122
|
-
uiPath: uiPath,
|
|
123
|
-
globalFilter: globalFilter,
|
|
124
|
-
entity: {
|
|
125
|
-
uri: 'entityUri',
|
|
126
|
-
type: 'configuration/entityTypes/HCP'
|
|
127
|
-
}
|
|
128
|
-
}, actions: { openPivotingPerspective: openPivotingPerspective } },
|
|
129
|
-
React.createElement(PivotingAttributeContext.Provider, { value: pivotingAttributeContextValue },
|
|
130
|
-
React.createElement(PivotingTooltip, __assign({}, props)))));
|
|
131
|
-
return { user: user };
|
|
132
|
-
};
|
|
133
|
-
describe('PivotingTooltip test', function () {
|
|
134
|
-
var values = {
|
|
135
|
-
value: '8-800-555-35-35',
|
|
136
|
-
ov: true,
|
|
137
|
-
type: 'String',
|
|
138
|
-
lookupCode: '8-800-555-35-35',
|
|
139
|
-
lookupRawValue: '8-800-555-35-35'
|
|
140
|
-
};
|
|
141
|
-
beforeEach(function () {
|
|
142
|
-
getFilteredEntities.mockResolvedValue(mockGetFilteredEntitiesResponse);
|
|
143
|
-
getTotals.mockResolvedValue({ total: 5 });
|
|
144
|
-
});
|
|
145
|
-
it('getTotals should not be called if user do not hover tooltip', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
146
|
-
var value, attributeType, props, tooltip;
|
|
147
|
-
return __generator(this, function (_a) {
|
|
148
|
-
switch (_a.label) {
|
|
149
|
-
case 0:
|
|
150
|
-
value = __assign(__assign({}, values), { uri: 'configuration/entityTypes/HCP/attributes/Phone' });
|
|
151
|
-
attributeType = {
|
|
152
|
-
name: 'Phone',
|
|
153
|
-
uri: 'configuration/entityTypes/HCP/attributes/Phone',
|
|
154
|
-
type: 'String'
|
|
155
|
-
};
|
|
156
|
-
props = { value: value, attributeType: attributeType, children: '8-800-555-35-35' };
|
|
157
|
-
setUp(props);
|
|
158
|
-
return [4 /*yield*/, screen.findByText('8-800-555-35-35')];
|
|
159
|
-
case 1:
|
|
160
|
-
tooltip = _a.sent();
|
|
161
|
-
expect(tooltip).toBeInTheDocument();
|
|
162
|
-
expect(getTotals).toHaveBeenCalledTimes(0);
|
|
163
|
-
expect(getFilteredEntities).toHaveBeenCalledTimes(0);
|
|
164
|
-
return [2 /*return*/];
|
|
165
|
-
}
|
|
166
|
-
});
|
|
167
|
-
}); });
|
|
168
|
-
it('getFilteredEntities should be called with correct params', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
169
|
-
var value, attributeType, props, user, tooltip, tooltipHeader, tooltipContent;
|
|
170
|
-
return __generator(this, function (_a) {
|
|
171
|
-
switch (_a.label) {
|
|
172
|
-
case 0:
|
|
173
|
-
value = __assign(__assign({}, values), { uri: 'configuration/entityTypes/HCP/attributes/Phone' });
|
|
174
|
-
attributeType = {
|
|
175
|
-
name: 'Phone',
|
|
176
|
-
uri: 'configuration/entityTypes/HCP/attributes/Phone',
|
|
177
|
-
type: 'String'
|
|
178
|
-
};
|
|
179
|
-
props = { value: value, attributeType: attributeType, children: '8-800-555-35-35' };
|
|
180
|
-
user = setUp(props).user;
|
|
181
|
-
return [4 /*yield*/, screen.findByText('8-800-555-35-35')];
|
|
182
|
-
case 1:
|
|
183
|
-
tooltip = _a.sent();
|
|
184
|
-
return [4 /*yield*/, user.hover(tooltip)];
|
|
185
|
-
case 2:
|
|
186
|
-
_a.sent();
|
|
187
|
-
return [4 /*yield*/, screen.findByText('Pivot profiles')];
|
|
188
|
-
case 3:
|
|
189
|
-
tooltipHeader = _a.sent();
|
|
190
|
-
expect(tooltipHeader).toBeInTheDocument();
|
|
191
|
-
return [4 /*yield*/, screen.findByText('entity label')];
|
|
192
|
-
case 4:
|
|
193
|
-
tooltipContent = _a.sent();
|
|
194
|
-
expect(tooltipContent).toBeInTheDocument();
|
|
195
|
-
expect(getFilteredEntities).toHaveBeenCalledWith({
|
|
196
|
-
filters: [
|
|
197
|
-
{ fieldName: 'type', filter: 'equals', values: ['configuration/entityTypes/HCP'] },
|
|
198
|
-
{ fieldName: 'attributes.Phone', filter: 'equals', values: ['8-800-555-35-35'] }
|
|
199
|
-
],
|
|
200
|
-
options: {
|
|
201
|
-
activityFilter: undefined,
|
|
202
|
-
globalFilter: "((equals(type,'configuration/entityTypes/HCP') and (range(updatedTime,1622458333452,1622717533451) or range(updatedTime,1622458333452,1622717533451))))",
|
|
203
|
-
max: 6,
|
|
204
|
-
searchOptions: '',
|
|
205
|
-
sort: 'label'
|
|
206
|
-
}
|
|
207
|
-
});
|
|
208
|
-
return [2 /*return*/];
|
|
209
|
-
}
|
|
210
|
-
});
|
|
211
|
-
}); });
|
|
212
|
-
it('getFilteredEntities should be called with correct entity type if PivotingAttributeContextValue contain popup', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
213
|
-
var value, attributeType, props, pivotingAttributeContextValue, user, tooltip, tooltipHeader, tooltipContent;
|
|
214
|
-
return __generator(this, function (_a) {
|
|
215
|
-
switch (_a.label) {
|
|
216
|
-
case 0:
|
|
217
|
-
value = __assign(__assign({}, values), { uri: 'configuration/entityTypes/HCP/attributes/Phone' });
|
|
218
|
-
attributeType = {
|
|
219
|
-
name: 'Phone',
|
|
220
|
-
uri: 'configuration/entityTypes/HCP/attributes/Phone',
|
|
221
|
-
type: 'String'
|
|
222
|
-
};
|
|
223
|
-
props = { value: value, attributeType: attributeType, children: '8-800-555-35-35' };
|
|
224
|
-
pivotingAttributeContextValue = [
|
|
225
|
-
{
|
|
226
|
-
uri: 'configuration/entityTypes/HCP/attributes/Phone',
|
|
227
|
-
popup: { entityType: 'configuration/entityTypes/HCP_1', label: 'HCPs status' }
|
|
228
|
-
}
|
|
229
|
-
];
|
|
230
|
-
user = setUp(props, pivotingAttributeContextValue).user;
|
|
231
|
-
return [4 /*yield*/, screen.findByText('8-800-555-35-35')];
|
|
232
|
-
case 1:
|
|
233
|
-
tooltip = _a.sent();
|
|
234
|
-
return [4 /*yield*/, user.hover(tooltip)];
|
|
235
|
-
case 2:
|
|
236
|
-
_a.sent();
|
|
237
|
-
return [4 /*yield*/, screen.findByText('Pivot profiles')];
|
|
238
|
-
case 3:
|
|
239
|
-
tooltipHeader = _a.sent();
|
|
240
|
-
expect(tooltipHeader).toBeInTheDocument();
|
|
241
|
-
return [4 /*yield*/, screen.findByText('entity label')];
|
|
242
|
-
case 4:
|
|
243
|
-
tooltipContent = _a.sent();
|
|
244
|
-
expect(tooltipContent).toBeInTheDocument();
|
|
245
|
-
expect(getFilteredEntities).toHaveBeenCalledWith({
|
|
246
|
-
filters: [
|
|
247
|
-
{ fieldName: 'type', filter: 'equals', values: ['configuration/entityTypes/HCP_1'] },
|
|
248
|
-
{ fieldName: 'attributes.Phone', filter: 'equals', values: ['8-800-555-35-35'] }
|
|
249
|
-
],
|
|
250
|
-
options: {
|
|
251
|
-
activityFilter: undefined,
|
|
252
|
-
globalFilter: "((equals(type,'configuration/entityTypes/HCP') and (range(updatedTime,1622458333452,1622717533451) or range(updatedTime,1622458333452,1622717533451))))",
|
|
253
|
-
max: 6,
|
|
254
|
-
searchOptions: '',
|
|
255
|
-
sort: 'label'
|
|
256
|
-
}
|
|
257
|
-
});
|
|
258
|
-
return [2 /*return*/];
|
|
259
|
-
}
|
|
260
|
-
});
|
|
261
|
-
}); });
|
|
262
|
-
it('getTotals should be called with correct params', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
263
|
-
var value, attributeType, props, user, tooltip, tooltipHeader, tooltipContent;
|
|
264
|
-
return __generator(this, function (_a) {
|
|
265
|
-
switch (_a.label) {
|
|
266
|
-
case 0:
|
|
267
|
-
value = __assign(__assign({}, values), { uri: 'configuration/entityTypes/HCP/attributes/Phone' });
|
|
268
|
-
attributeType = {
|
|
269
|
-
name: 'Phone',
|
|
270
|
-
uri: 'configuration/entityTypes/HCP/attributes/Phone',
|
|
271
|
-
type: 'String'
|
|
272
|
-
};
|
|
273
|
-
props = { value: value, attributeType: attributeType, children: '8-800-555-35-35' };
|
|
274
|
-
user = setUp(props).user;
|
|
275
|
-
return [4 /*yield*/, screen.findByText('8-800-555-35-35')];
|
|
276
|
-
case 1:
|
|
277
|
-
tooltip = _a.sent();
|
|
278
|
-
return [4 /*yield*/, user.hover(tooltip)];
|
|
279
|
-
case 2:
|
|
280
|
-
_a.sent();
|
|
281
|
-
return [4 /*yield*/, screen.findByText('Pivot profiles')];
|
|
282
|
-
case 3:
|
|
283
|
-
tooltipHeader = _a.sent();
|
|
284
|
-
expect(tooltipHeader).toBeInTheDocument();
|
|
285
|
-
return [4 /*yield*/, screen.findByText('entity label')];
|
|
286
|
-
case 4:
|
|
287
|
-
tooltipContent = _a.sent();
|
|
288
|
-
expect(tooltipContent).toBeInTheDocument();
|
|
289
|
-
expect(getTotals).toHaveBeenCalledWith({
|
|
290
|
-
filters: [
|
|
291
|
-
{ fieldName: 'type', filter: 'equals', values: ['configuration/entityTypes/HCP'] },
|
|
292
|
-
{ fieldName: 'attributes.Phone', filter: 'equals', values: ['8-800-555-35-35'] }
|
|
293
|
-
],
|
|
294
|
-
options: {
|
|
295
|
-
activityFilter: undefined,
|
|
296
|
-
globalFilter: "((equals(type,'configuration/entityTypes/HCP') and (range(updatedTime,1622458333452,1622717533451) or range(updatedTime,1622458333452,1622717533451))))",
|
|
297
|
-
max: 6,
|
|
298
|
-
searchOptions: '',
|
|
299
|
-
sort: 'label'
|
|
300
|
-
}
|
|
301
|
-
});
|
|
302
|
-
return [2 /*return*/];
|
|
303
|
-
}
|
|
304
|
-
});
|
|
305
|
-
}); });
|
|
306
|
-
it('getTotals should be called with correct entity type if PivotingAttributeContextValue contain popup', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
307
|
-
var value, attributeType, props, pivotingAttributeContextValue, user, tooltip, tooltipHeader, tooltipContent;
|
|
308
|
-
return __generator(this, function (_a) {
|
|
309
|
-
switch (_a.label) {
|
|
310
|
-
case 0:
|
|
311
|
-
value = __assign(__assign({}, values), { uri: 'configuration/entityTypes/HCP/attributes/Phone' });
|
|
312
|
-
attributeType = {
|
|
313
|
-
name: 'Phone',
|
|
314
|
-
uri: 'configuration/entityTypes/HCP/attributes/Phone',
|
|
315
|
-
type: 'String'
|
|
316
|
-
};
|
|
317
|
-
props = { value: value, attributeType: attributeType, children: '8-800-555-35-35' };
|
|
318
|
-
pivotingAttributeContextValue = [
|
|
319
|
-
{
|
|
320
|
-
uri: 'configuration/entityTypes/HCP/attributes/Phone',
|
|
321
|
-
popup: { entityType: 'configuration/entityTypes/HCP_1', label: 'HCPs status' }
|
|
322
|
-
}
|
|
323
|
-
];
|
|
324
|
-
user = setUp(props, pivotingAttributeContextValue).user;
|
|
325
|
-
return [4 /*yield*/, screen.findByText('8-800-555-35-35')];
|
|
326
|
-
case 1:
|
|
327
|
-
tooltip = _a.sent();
|
|
328
|
-
return [4 /*yield*/, user.hover(tooltip)];
|
|
329
|
-
case 2:
|
|
330
|
-
_a.sent();
|
|
331
|
-
return [4 /*yield*/, screen.findByText('Pivot profiles')];
|
|
332
|
-
case 3:
|
|
333
|
-
tooltipHeader = _a.sent();
|
|
334
|
-
expect(tooltipHeader).toBeInTheDocument();
|
|
335
|
-
return [4 /*yield*/, screen.findByText('entity label')];
|
|
336
|
-
case 4:
|
|
337
|
-
tooltipContent = _a.sent();
|
|
338
|
-
expect(tooltipContent).toBeInTheDocument();
|
|
339
|
-
expect(getTotals).toHaveBeenCalledWith({
|
|
340
|
-
filters: [
|
|
341
|
-
{ fieldName: 'type', filter: 'equals', values: ['configuration/entityTypes/HCP_1'] },
|
|
342
|
-
{ fieldName: 'attributes.Phone', filter: 'equals', values: ['8-800-555-35-35'] }
|
|
343
|
-
],
|
|
344
|
-
options: {
|
|
345
|
-
activityFilter: undefined,
|
|
346
|
-
globalFilter: "((equals(type,'configuration/entityTypes/HCP') and (range(updatedTime,1622458333452,1622717533451) or range(updatedTime,1622458333452,1622717533451))))",
|
|
347
|
-
max: 6,
|
|
348
|
-
searchOptions: '',
|
|
349
|
-
sort: 'label'
|
|
350
|
-
}
|
|
351
|
-
});
|
|
352
|
-
return [2 /*return*/];
|
|
353
|
-
}
|
|
354
|
-
});
|
|
355
|
-
}); });
|
|
356
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|