@reltio/components 1.4.2071 → 1.4.2073
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/AttributesView/AttributesView.js +1 -1
- package/ColumnsSettings/components/ColumnsSettingsPopup/ColumnsSettingsPopup.d.ts +2 -3
- package/ColumnsSettings/helpers.d.ts +3 -1
- package/ColumnsSettings/types.d.ts +8 -0
- package/CommentsContainer/CommentsContainer.js +1 -1
- package/ConfigureColumnsPopup/ConfigureColumnsPopup.d.ts +23 -40
- package/ConfigureColumnsPopup/ConfigureColumnsPopup.js +6 -26
- package/EditModeAttributesList/EditModeAttributesList.js +1 -1
- package/EditModeAttributesPager/EditModeAttributesPager.test.js +1 -1
- package/EditModeAttributesPager/components/AttributeRenderer/AttributeRenderer.js +1 -1
- package/MetadataTypesSelector/MetadataTypesSelector.d.ts +2 -1
- package/MetadataTypesSelector/components/SelectMetadataTypesList/SelectMetadataTypesList.d.ts +5 -6
- package/MoreAttributesButton/useMoreAttributesItems.d.ts +1 -1
- package/ReadOnlyAttributesList/ReadOnlyAttributesList.js +1 -1
- package/ReadOnlyAttributesPager/ReadOnlyAttributesPager.js +1 -1
- package/ReadOnlyAttributesView/ReadOnlyAttributesView.js +1 -1
- package/ScrollableTabs/ScrollableTabs.test.js +69 -19
- package/SearchHighlighter/SearchHighlighter.test.js +18 -7
- package/SelectAttributesList/SelectAttributesList.d.ts +11 -6
- package/SelectAttributesList/SelectAttributesList.js +5 -2
- package/SelectorWithOnlyOptionAutoSelect/SelectorWithOnlyOptionAutoSelect.test.js +109 -60
- package/SidePanelContentHeader/SidePanelContentHeader.js +2 -2
- package/SidePanelContentHeader/SidePanelContentHeader.test.js +104 -0
- package/SidePanelEmptyState/SidePanelEmptyState.js +1 -1
- package/SidePanelEmptyState/SidePanelEmptyState.test.js +24 -0
- package/SimpleAttribute/SimpleAttribute.js +1 -1
- package/SimpleAttribute/SimpleAttribute.test.js +155 -80
- package/SimpleAttributeEditor/SimpleAttributeEditor.test.js +339 -330
- package/SimpleAttributeEditor/useAttributeValuePermissions.js +1 -1
- package/SimpleDropDownSelector/SimpleDropDownSelector.test.js +86 -10
- package/SimpleDropDownSelector/components/DropDownPlaceholder/DropDownPlaceholder.js +1 -1
- package/SimpleDropDownSelector/components/DropDownValue/DropDownValue.js +1 -1
- package/SimpleMatchRulesBlock/SimpleMatchRulesBlock.test.js +128 -32
- package/SmallIconButton/SmallIconButton.test.js +98 -25
- package/TableWithBars/TableWithBars.test.js +98 -60
- package/TableWithBars/components/AttributeCellRenderer/AttributeCellRenderer.js +1 -1
- package/TableWithBars/components/HeadCellRenderer/HeadCellRenderer.js +1 -1
- package/Tags/Tags.d.ts +0 -1
- package/Tags/Tags.test.js +8 -7
- package/TransitiveMatchBlock/TransitiveMatchBlock.test.js +78 -22
- package/TransitiveMatchRule/TransitiveMatchRule.test.js +78 -37
- package/TransitiveMatchRulesTooltip/TransitiveMatchRulesTooltip.js +1 -1
- package/TransitiveMatchRulesTooltip/TransitiveMatchRulesTooltip.test.js +12 -18
- package/UploadFileButton/UploadFileButton.d.ts +2 -2
- package/UploadFileButton/UploadFileButton.test.js +199 -0
- package/UploadImageDialog/UploadImageDialog.test.js +1 -0
- package/UploadImageDialog/components/DividerWithText/DividerWithText.js +1 -1
- package/UploadImageDialog/components/ErrorSnackbar/ErrorSnackbar.test.js +80 -22
- package/UploadImageDialog/components/ImageByUrlField/ImageByUrlField.js +1 -1
- package/UploadImageDialog/components/ImageByUrlField/ImageByUrlField.test.js +162 -49
- package/ValueChip/ValueChip.test.js +7 -23
- package/VirtualGroupedList/VirtualGroupedList.d.ts +19 -31
- package/VirtualGroupedList/VirtualGroupedList.js +11 -36
- package/VirtualGroupedList/VirtualGroupedList.test.js +224 -0
- package/VirtualGroupedList/helpers.d.ts +7 -2
- package/VirtualGroupedList/helpers.js +3 -1
- package/VirtualGroupedList/index.d.ts +1 -1
- package/VirtualGroupedList/types.d.ts +10 -6
- package/VirtualGroupedList/useScrollToFocusItem.d.ts +8 -5
- package/WhiteSearchInput/{WhiteSearchInput.spec.js → WhiteSearchInput.test.js} +3 -8
- package/cjs/AttributesView/AttributesView.js +2 -2
- package/cjs/ColumnsSettings/components/ColumnsSettingsPopup/ColumnsSettingsPopup.d.ts +2 -3
- package/cjs/ColumnsSettings/helpers.d.ts +3 -1
- package/cjs/ColumnsSettings/types.d.ts +8 -0
- package/cjs/ColumnsSettings/types.js +2 -0
- package/cjs/CommentsContainer/CommentsContainer.js +1 -1
- package/cjs/ConfigureColumnsPopup/ConfigureColumnsPopup.d.ts +23 -40
- package/cjs/ConfigureColumnsPopup/ConfigureColumnsPopup.js +6 -26
- package/cjs/EditModeAttributesList/EditModeAttributesList.js +2 -2
- package/cjs/EditModeAttributesPager/EditModeAttributesPager.test.js +2 -2
- package/cjs/EditModeAttributesPager/components/AttributeRenderer/AttributeRenderer.js +2 -2
- package/cjs/MetadataTypesSelector/MetadataTypesSelector.d.ts +2 -1
- package/cjs/MetadataTypesSelector/components/SelectMetadataTypesList/SelectMetadataTypesList.d.ts +5 -6
- package/cjs/MoreAttributesButton/useMoreAttributesItems.d.ts +1 -1
- package/cjs/ReadOnlyAttributesList/ReadOnlyAttributesList.js +2 -2
- package/cjs/ReadOnlyAttributesPager/ReadOnlyAttributesPager.js +2 -2
- package/cjs/ReadOnlyAttributesView/ReadOnlyAttributesView.js +2 -2
- package/cjs/ScrollableTabs/ScrollableTabs.test.js +69 -19
- package/cjs/SearchHighlighter/SearchHighlighter.test.js +18 -7
- package/cjs/SelectAttributesList/SelectAttributesList.d.ts +11 -6
- package/cjs/SelectAttributesList/SelectAttributesList.js +5 -2
- package/cjs/SelectorWithOnlyOptionAutoSelect/SelectorWithOnlyOptionAutoSelect.test.js +109 -60
- package/cjs/SidePanelContentHeader/SidePanelContentHeader.js +2 -2
- package/cjs/SidePanelContentHeader/SidePanelContentHeader.test.js +109 -0
- package/cjs/SidePanelEmptyState/SidePanelEmptyState.js +1 -1
- package/cjs/SidePanelEmptyState/SidePanelEmptyState.test.js +29 -0
- package/cjs/SimpleAttribute/SimpleAttribute.js +1 -1
- package/cjs/SimpleAttribute/SimpleAttribute.test.js +155 -80
- package/cjs/SimpleAttributeEditor/SimpleAttributeEditor.test.js +338 -352
- package/cjs/SimpleAttributeEditor/useAttributeValuePermissions.js +2 -2
- package/cjs/SimpleDropDownSelector/SimpleDropDownSelector.test.js +86 -10
- package/cjs/SimpleDropDownSelector/components/DropDownPlaceholder/DropDownPlaceholder.js +1 -1
- package/cjs/SimpleDropDownSelector/components/DropDownValue/DropDownValue.js +1 -1
- package/cjs/SimpleMatchRulesBlock/SimpleMatchRulesBlock.test.js +127 -31
- package/cjs/SmallIconButton/SmallIconButton.test.js +98 -25
- package/cjs/TableWithBars/TableWithBars.test.js +98 -60
- package/cjs/TableWithBars/components/AttributeCellRenderer/AttributeCellRenderer.js +1 -1
- package/cjs/TableWithBars/components/HeadCellRenderer/HeadCellRenderer.js +1 -1
- package/cjs/Tags/Tags.d.ts +0 -1
- package/cjs/Tags/Tags.test.js +8 -7
- package/cjs/TransitiveMatchBlock/TransitiveMatchBlock.test.js +77 -21
- package/cjs/TransitiveMatchRule/TransitiveMatchRule.test.js +78 -37
- package/cjs/TransitiveMatchRulesTooltip/TransitiveMatchRulesTooltip.js +1 -1
- package/cjs/TransitiveMatchRulesTooltip/TransitiveMatchRulesTooltip.test.js +12 -18
- package/cjs/UploadFileButton/UploadFileButton.d.ts +2 -2
- package/cjs/UploadFileButton/UploadFileButton.test.js +204 -0
- package/cjs/UploadImageDialog/UploadImageDialog.test.js +1 -0
- package/cjs/UploadImageDialog/components/DividerWithText/DividerWithText.js +1 -1
- package/cjs/UploadImageDialog/components/ErrorSnackbar/ErrorSnackbar.test.js +80 -22
- package/cjs/UploadImageDialog/components/ImageByUrlField/ImageByUrlField.js +1 -1
- package/cjs/UploadImageDialog/components/ImageByUrlField/ImageByUrlField.test.js +162 -49
- package/cjs/ValueChip/ValueChip.test.js +7 -23
- package/cjs/VirtualGroupedList/VirtualGroupedList.d.ts +19 -31
- package/cjs/VirtualGroupedList/VirtualGroupedList.js +11 -36
- package/cjs/VirtualGroupedList/VirtualGroupedList.test.js +252 -0
- package/cjs/VirtualGroupedList/helpers.d.ts +7 -2
- package/cjs/VirtualGroupedList/helpers.js +3 -1
- package/cjs/VirtualGroupedList/index.d.ts +1 -1
- package/cjs/VirtualGroupedList/types.d.ts +10 -6
- package/cjs/VirtualGroupedList/useScrollToFocusItem.d.ts +8 -5
- package/cjs/WhiteSearchInput/{WhiteSearchInput.spec.js → WhiteSearchInput.test.js} +3 -8
- package/cjs/features/activity-log/ActivitiesFactory/ActivitiesFactory.js +1 -0
- package/cjs/features/activity-log/ActivitiesFactory/ActivitiesFactory.test.js +5 -0
- package/cjs/features/activity-log/ActivityFilterEditor/helpers.js +2 -1
- package/cjs/features/activity-log/ActivityFilterEditor/helpers.test.js +3 -1
- package/cjs/features/activity-log/ActivityLogFilter/ActivityLogFilter.test.js +16 -15
- package/cjs/features/activity-log/types.d.ts +1 -0
- package/cjs/features/activity-log/types.js +1 -0
- package/cjs/features/activity-log/utils/activities.js +1 -0
- package/cjs/features/activity-log/utils/filters.js +5 -1
- package/cjs/features/activity-log/utils/filters.test.js +4 -2
- package/cjs/features/crosswalks/hooks/useAttributeActions.test.js +24 -25
- package/cjs/features/crosswalks/hooks/useCrosswalkActions.test.js +10 -11
- package/cjs/features/history/types.d.ts +1 -0
- package/cjs/features/workflow/hooks/useChangeRequest.test.js +5 -6
- package/cjs/hooks/useCommentsEntitiesMap/useCommentsEntitiesMap.test.js +8 -9
- package/cjs/hooks/useKeyboardNavigation/useKeyboardNavigation.d.ts +9 -13
- package/features/activity-log/ActivitiesFactory/ActivitiesFactory.js +1 -0
- package/features/activity-log/ActivitiesFactory/ActivitiesFactory.test.js +5 -0
- package/features/activity-log/ActivityFilterEditor/helpers.js +2 -1
- package/features/activity-log/ActivityFilterEditor/helpers.test.js +3 -1
- package/features/activity-log/ActivityLogFilter/ActivityLogFilter.test.js +16 -15
- package/features/activity-log/types.d.ts +1 -0
- package/features/activity-log/types.js +1 -0
- package/features/activity-log/utils/activities.js +1 -0
- package/features/activity-log/utils/filters.js +5 -1
- package/features/activity-log/utils/filters.test.js +4 -2
- package/features/crosswalks/hooks/useAttributeActions.test.js +1 -2
- package/features/crosswalks/hooks/useCrosswalkActions.test.js +1 -2
- package/features/history/types.d.ts +1 -0
- package/features/workflow/hooks/useChangeRequest.test.js +1 -2
- package/hooks/useCommentsEntitiesMap/useCommentsEntitiesMap.test.js +1 -2
- package/hooks/useKeyboardNavigation/useKeyboardNavigation.d.ts +9 -13
- package/package.json +1 -1
- package/SidePanelContentHeader/SidePanelContentHeader.spec.js +0 -49
- package/SidePanelEmptyState/SidePanelEmptyState.spec.js +0 -24
- package/SimpleAttributeEditor/SimpleAttributeEditorWithoutPermissions.test.js +0 -103
- package/SimpleDropDownSelector/components/DropDownPlaceholder/DropDownPlaceholder.test.js +0 -13
- package/TableWithBars/components/AttributeCellRenderer/AttributeCellRenderer.test.js +0 -21
- package/TableWithBars/components/HeadCellRenderer/HeadCellRenderer.test.js +0 -20
- package/UploadFileButton/UploadFileButton.spec.js +0 -219
- package/UploadImageDialog/components/DividerWithText/DividerWithText.test.js +0 -9
- package/VirtualGroupedList/VirtualGroupedList.spec.js +0 -282
- package/cjs/SidePanelContentHeader/SidePanelContentHeader.spec.js +0 -54
- package/cjs/SidePanelEmptyState/SidePanelEmptyState.spec.d.ts +0 -1
- package/cjs/SidePanelEmptyState/SidePanelEmptyState.spec.js +0 -29
- package/cjs/SimpleAttributeEditor/SimpleAttributeEditorWithoutPermissions.test.d.ts +0 -1
- package/cjs/SimpleAttributeEditor/SimpleAttributeEditorWithoutPermissions.test.js +0 -108
- package/cjs/SimpleDropDownSelector/components/DropDownPlaceholder/DropDownPlaceholder.test.d.ts +0 -1
- package/cjs/SimpleDropDownSelector/components/DropDownPlaceholder/DropDownPlaceholder.test.js +0 -18
- package/cjs/TableWithBars/components/AttributeCellRenderer/AttributeCellRenderer.test.d.ts +0 -1
- package/cjs/TableWithBars/components/AttributeCellRenderer/AttributeCellRenderer.test.js +0 -26
- package/cjs/TableWithBars/components/HeadCellRenderer/HeadCellRenderer.test.d.ts +0 -1
- package/cjs/TableWithBars/components/HeadCellRenderer/HeadCellRenderer.test.js +0 -25
- package/cjs/UploadFileButton/UploadFileButton.spec.d.ts +0 -1
- package/cjs/UploadFileButton/UploadFileButton.spec.js +0 -224
- package/cjs/UploadImageDialog/components/DividerWithText/DividerWithText.test.d.ts +0 -1
- package/cjs/UploadImageDialog/components/DividerWithText/DividerWithText.test.js +0 -14
- package/cjs/VirtualGroupedList/VirtualGroupedList.spec.d.ts +0 -1
- package/cjs/VirtualGroupedList/VirtualGroupedList.spec.js +0 -287
- package/cjs/WhiteSearchInput/WhiteSearchInput.spec.d.ts +0 -1
- /package/{SidePanelContentHeader/SidePanelContentHeader.spec.d.ts → ColumnsSettings/types.js} +0 -0
- /package/{SidePanelEmptyState/SidePanelEmptyState.spec.d.ts → SidePanelContentHeader/SidePanelContentHeader.test.d.ts} +0 -0
- /package/{SimpleAttributeEditor/SimpleAttributeEditorWithoutPermissions.test.d.ts → SidePanelEmptyState/SidePanelEmptyState.test.d.ts} +0 -0
- /package/{SimpleDropDownSelector/components/DropDownPlaceholder/DropDownPlaceholder.test.d.ts → UploadFileButton/UploadFileButton.test.d.ts} +0 -0
- /package/{TableWithBars/components/AttributeCellRenderer/AttributeCellRenderer.test.d.ts → VirtualGroupedList/VirtualGroupedList.test.d.ts} +0 -0
- /package/{TableWithBars/components/HeadCellRenderer/HeadCellRenderer.test.d.ts → WhiteSearchInput/WhiteSearchInput.test.d.ts} +0 -0
- /package/{UploadFileButton/UploadFileButton.spec.d.ts → cjs/SidePanelContentHeader/SidePanelContentHeader.test.d.ts} +0 -0
- /package/{UploadImageDialog/components/DividerWithText/DividerWithText.test.d.ts → cjs/SidePanelEmptyState/SidePanelEmptyState.test.d.ts} +0 -0
- /package/{VirtualGroupedList/VirtualGroupedList.spec.d.ts → cjs/UploadFileButton/UploadFileButton.test.d.ts} +0 -0
- /package/{WhiteSearchInput/WhiteSearchInput.spec.d.ts → cjs/VirtualGroupedList/VirtualGroupedList.test.d.ts} +0 -0
- /package/cjs/{SidePanelContentHeader/SidePanelContentHeader.spec.d.ts → WhiteSearchInput/WhiteSearchInput.test.d.ts} +0 -0
- /package/cjs/contexts/{AllwaysVisibleAttributesContext → AlwaysVisibleAttributesContext}/index.d.ts +0 -0
- /package/cjs/contexts/{AllwaysVisibleAttributesContext → AlwaysVisibleAttributesContext}/index.js +0 -0
- /package/contexts/{AllwaysVisibleAttributesContext → AlwaysVisibleAttributesContext}/index.d.ts +0 -0
- /package/contexts/{AllwaysVisibleAttributesContext → AlwaysVisibleAttributesContext}/index.js +0 -0
|
@@ -10,89 +10,162 @@ 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
|
|
19
|
-
var
|
|
20
|
-
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
21
|
-
var DataTypeValue_1 = require("../DataTypeValue");
|
|
22
|
-
var SimpleAttribute_1 = require("./SimpleAttribute");
|
|
54
|
+
var react_2 = require("@testing-library/react");
|
|
55
|
+
var user_event_1 = __importDefault(require("@testing-library/user-event"));
|
|
23
56
|
var classnames_1 = require("../constants/classnames");
|
|
24
|
-
var CommentsContainer_1 = require("../CommentsContainer");
|
|
25
57
|
var HistoryAppearanceContext_1 = require("../contexts/HistoryAppearanceContext");
|
|
26
|
-
var PivotingTooltip_1 = require("../PivotingTooltip");
|
|
27
58
|
var HighlightedValuesContext_1 = require("../contexts/HighlightedValuesContext");
|
|
59
|
+
var PivotingAttributeContext_1 = require("../contexts/PivotingAttributeContext");
|
|
60
|
+
var SimpleAttribute_1 = require("./SimpleAttribute");
|
|
61
|
+
var CollaborationContext_1 = require("../contexts/CollaborationContext");
|
|
28
62
|
describe('SimpleAttribute tests', function () {
|
|
29
|
-
var
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
63
|
+
var defaultProps = {
|
|
64
|
+
attributeType: { type: 'String', name: 'Name', uri: 'URI' },
|
|
65
|
+
attributeValue: { value: '123', uri: 'entities/16U21B8f/attributes/Name/2sAfjGOIh' }
|
|
66
|
+
};
|
|
67
|
+
var defaultCollaborationContextValue = {
|
|
68
|
+
commentsMap: {},
|
|
69
|
+
currentComment: null
|
|
70
|
+
};
|
|
71
|
+
var defaultContextValues = {
|
|
72
|
+
collaboration: defaultCollaborationContextValue,
|
|
73
|
+
pivotingAttribute: undefined,
|
|
74
|
+
highlightedValues: {
|
|
75
|
+
highlightedValuesUris: [],
|
|
76
|
+
highlightedClassName: 'test'
|
|
77
|
+
},
|
|
78
|
+
historyDiff: {}
|
|
79
|
+
};
|
|
80
|
+
var setUp = function (props, contextValues) {
|
|
81
|
+
if (props === void 0) { props = {}; }
|
|
82
|
+
if (contextValues === void 0) { contextValues = {}; }
|
|
83
|
+
var user = user_event_1.default.setup();
|
|
84
|
+
var _a = __assign(__assign({}, defaultContextValues), contextValues), pivotingAttribute = _a.pivotingAttribute, highlightedValues = _a.highlightedValues, historyDiff = _a.historyDiff, collaboration = _a.collaboration;
|
|
85
|
+
var Providers = function (_a) {
|
|
86
|
+
var children = _a.children;
|
|
87
|
+
return (react_1.default.createElement(CollaborationContext_1.CollaborationContext.Provider, { value: collaboration },
|
|
88
|
+
react_1.default.createElement(PivotingAttributeContext_1.PivotingAttributeContext.Provider, { value: pivotingAttribute },
|
|
89
|
+
react_1.default.createElement(HighlightedValuesContext_1.HighlightedValuesContext.Provider, { value: highlightedValues },
|
|
90
|
+
react_1.default.createElement(HistoryAppearanceContext_1.HistoryDiffContext.Provider, { value: historyDiff }, children)))));
|
|
91
|
+
};
|
|
92
|
+
return __assign({ user: user }, (0, react_2.render)(react_1.default.createElement(SimpleAttribute_1.SimpleAttribute, __assign({}, defaultProps, props)), { wrapper: Providers }));
|
|
34
93
|
};
|
|
35
94
|
it('should render DataTypeValue', function () {
|
|
36
|
-
var
|
|
95
|
+
var attributeType = { type: 'String', name: 'Name', uri: 'URI' };
|
|
37
96
|
var attributeValue = { value: '123', uri: 'entities/16U21B8f/attributes/Name/2sAfjGOIh' };
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
expect(dataTypeValue.length).toBe(1);
|
|
41
|
-
expect(dataTypeValue.prop('value')).toEqual(attributeValue.value);
|
|
42
|
-
expect(dataTypeValue.prop('dataTypeDefinition')).toEqual({ type: 'String', uri: 'URI', name: 'Name' });
|
|
97
|
+
setUp({ attributeType: attributeType, attributeValue: attributeValue });
|
|
98
|
+
expect(react_2.screen.getByTestId('reltio-attribute-value')).toHaveTextContent('123');
|
|
43
99
|
});
|
|
44
|
-
it('should
|
|
45
|
-
var
|
|
100
|
+
it('should render lookup correctly', function () {
|
|
101
|
+
var attributeType = { type: 'String', dependentLookupCode: 'Code', name: 'Name', uri: 'URI', access: ['READ'] };
|
|
46
102
|
var attributeValue = {
|
|
47
|
-
value: '
|
|
48
|
-
lookupCode: '
|
|
49
|
-
rawLookupCode: '
|
|
103
|
+
value: 'India',
|
|
104
|
+
lookupCode: 'IN',
|
|
105
|
+
rawLookupCode: 'IND',
|
|
50
106
|
uri: 'entities/16U21B8f/attributes/Name/2sAfjGOIh'
|
|
51
107
|
};
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
expect(dataTypeValue.length).toBe(1);
|
|
55
|
-
expect(dataTypeValue.prop('value')).toEqual((0, ramda_1.pick)(['value', 'lookupCode'], attributeValue));
|
|
56
|
-
expect(dataTypeValue.prop('dataTypeDefinition')).toEqual(__assign({ access: ['READ'], type: 'String', dependentLookupCode: 'Code', uri: 'URI', name: 'Name' }, { type: mdm_sdk_1.DataTypes.TYPE_DEPENDENT_LOOKUP }));
|
|
57
|
-
});
|
|
58
|
-
it('should render CommentsContainer inside COMMENTS_CONTAINER_VISIBILITY_AREA with correct uri', function () {
|
|
59
|
-
var attrType = { type: 'String', name: 'Name', uri: 'uri1' };
|
|
60
|
-
var attributeValue = { value: '123', uri: 'entities/uri1/attributes/ABCD' };
|
|
61
|
-
var component = (0, enzyme_1.shallow)(react_1.default.createElement(SimpleAttribute_1.SimpleAttribute, { attributeType: attrType, attributeValue: attributeValue }));
|
|
62
|
-
var commentsContainer = component.find(".".concat(classnames_1.COMMENTS_CONTAINER_VISIBILITY_AREA)).find(CommentsContainer_1.CommentsContainer);
|
|
63
|
-
expect(commentsContainer.length).toBe(1);
|
|
64
|
-
expect(commentsContainer.prop('uri')).toBe(attributeValue.uri);
|
|
65
|
-
expect(commentsContainer.prop('relatedObjectUris')).toEqual(['entities/uri1']);
|
|
66
|
-
expect(commentsContainer.prop('objectType')).toBe(mdm_sdk_1.CollaborationObjectTypes.ENTITY_ATTRIBUTE);
|
|
108
|
+
setUp({ attributeType: attributeType, attributeValue: attributeValue });
|
|
109
|
+
expect(react_2.screen.getByTestId('reltio-attribute-value')).toHaveTextContent('India (IN)');
|
|
67
110
|
});
|
|
68
111
|
it('should not render CommentsContainer if "inlined" prop is true', function () {
|
|
69
|
-
var
|
|
112
|
+
var attributeType = { type: 'String', name: 'Name', uri: 'uri1' };
|
|
70
113
|
var attributeValue = { value: '123', uri: 'uri1' };
|
|
71
|
-
|
|
72
|
-
expect(
|
|
73
|
-
expect(component.find(CommentsContainer_1.CommentsContainer).length).toBe(0);
|
|
114
|
+
setUp({ attributeType: attributeType, attributeValue: attributeValue, inlined: true });
|
|
115
|
+
expect(react_2.screen.queryByTestId('comments-container-visibility-area')).not.toBeInTheDocument();
|
|
74
116
|
});
|
|
75
117
|
it('should provide history className', function () {
|
|
76
118
|
var attrType = { type: 'String', name: 'Name', uri: 'testAttributeUri' };
|
|
77
119
|
var attributeValue = { value: '123', uri: 'testAttributeUri' };
|
|
78
|
-
var
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
react_1.default.createElement(SimpleAttribute_1.SimpleAttribute, { attributeType: attrType, attributeValue: attributeValue })));
|
|
87
|
-
expect(component.find(PivotingTooltip_1.PivotingTooltip)).toHaveLength(1);
|
|
120
|
+
var historyDiff = {
|
|
121
|
+
appearance: { testAttributeUri: 'INSERT_ATTRIBUTE' },
|
|
122
|
+
attributes: {},
|
|
123
|
+
roles: [],
|
|
124
|
+
tags: []
|
|
125
|
+
};
|
|
126
|
+
setUp({ attributeType: attrType, attributeValue: attributeValue }, { historyDiff: historyDiff });
|
|
127
|
+
expect(react_2.screen.getByTestId('reltio-attribute-value')).toHaveClass('insertAttribute');
|
|
88
128
|
});
|
|
129
|
+
it('should render PivotingTooltip with history', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
130
|
+
var attrType, attributeValue, historyDiff, pivotingAttribute;
|
|
131
|
+
return __generator(this, function (_a) {
|
|
132
|
+
attrType = { type: 'String', name: 'Name', uri: 'testAttributeUri' };
|
|
133
|
+
attributeValue = { value: '123', uri: 'entities/16U21B8f/attributes/Name/2sAfjGOIh' };
|
|
134
|
+
historyDiff = {
|
|
135
|
+
appearance: { testAttributeUri: 'INSERT_ATTRIBUTE' },
|
|
136
|
+
attributes: {},
|
|
137
|
+
roles: [],
|
|
138
|
+
tags: []
|
|
139
|
+
};
|
|
140
|
+
pivotingAttribute = [{ uri: 'testAttributeUri' }];
|
|
141
|
+
setUp({ attributeType: attrType, attributeValue: attributeValue }, { historyDiff: historyDiff, pivotingAttribute: pivotingAttribute });
|
|
142
|
+
expect(react_2.screen.getByTestId('SvgPivotingIcon')).toBeInTheDocument();
|
|
143
|
+
expect(react_2.screen.getByRole('link')).toHaveTextContent('123');
|
|
144
|
+
return [2 /*return*/];
|
|
145
|
+
});
|
|
146
|
+
}); });
|
|
89
147
|
it('should render PivotingTooltip without history', function () {
|
|
90
|
-
var
|
|
148
|
+
var attributeType = { type: 'String', name: 'Name', uri: 'testAttributeUri' };
|
|
91
149
|
var attributeValue = { value: '123', uri: 'entities/16U21B8f/attributes/Name/2sAfjGOIh' };
|
|
92
|
-
var
|
|
93
|
-
|
|
150
|
+
var pivotingAttribute = [{ uri: 'testAttributeUri' }];
|
|
151
|
+
setUp({ attributeType: attributeType, attributeValue: attributeValue }, { historyDiff: {}, pivotingAttribute: pivotingAttribute });
|
|
152
|
+
expect(react_2.screen.getByTestId('SvgPivotingIcon')).toBeInTheDocument();
|
|
153
|
+
expect(react_2.screen.getByRole('link')).toHaveTextContent('123');
|
|
94
154
|
});
|
|
95
|
-
it('should
|
|
155
|
+
it('should render comments correctly for entity type', function () {
|
|
156
|
+
var attributeType = { type: 'String', name: 'Name', uri: 'uri1' };
|
|
157
|
+
var attributeValue = { value: '123', uri: 'entities/uri1/attributes/ABCD' };
|
|
158
|
+
var commentsMap = {
|
|
159
|
+
'entities/uri1/attributes/ABCD': [{ commentId: 'commentId', status: 'open', replies: 0 }]
|
|
160
|
+
};
|
|
161
|
+
setUp({ attributeType: attributeType, attributeValue: attributeValue }, { collaboration: __assign(__assign({}, defaultCollaborationContextValue), { commentsMap: commentsMap }) });
|
|
162
|
+
expect(react_2.screen.getByTestId('comments-container-visibility-area')).toHaveClass(classnames_1.COMMENTS_CONTAINER_VISIBILITY_AREA);
|
|
163
|
+
expect(react_2.screen.getByText('123')).toBeInTheDocument();
|
|
164
|
+
expect(react_2.screen.getByTestId('comments-container')).toBeInTheDocument();
|
|
165
|
+
expect(react_2.screen.getByTestId('SvgAddComment')).toBeInTheDocument();
|
|
166
|
+
expect(react_2.screen.getByTestId('reltio-comment-button')).toBeInTheDocument();
|
|
167
|
+
});
|
|
168
|
+
it('should render comments correctly for relation type', function () {
|
|
96
169
|
var attributeType = {
|
|
97
170
|
uri: 'configuration/relationTypes/HCPtoHCP/attributes/AffiliationStatus',
|
|
98
171
|
type: 'String',
|
|
@@ -105,49 +178,51 @@ describe('SimpleAttribute tests', function () {
|
|
|
105
178
|
value: 'Active',
|
|
106
179
|
ov: true
|
|
107
180
|
};
|
|
108
|
-
var
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
expect(
|
|
117
|
-
expect(
|
|
181
|
+
var commentsMap = {
|
|
182
|
+
'relations/12rMNliU/attributes/AffiliationSubType/3e6txxgYJ': [
|
|
183
|
+
{ commentId: 'commentId', status: 'open', replies: 0 }
|
|
184
|
+
]
|
|
185
|
+
};
|
|
186
|
+
setUp({ attributeType: attributeType, attributeValue: attributeValue }, { collaboration: __assign(__assign({}, defaultCollaborationContextValue), { commentsMap: commentsMap }) });
|
|
187
|
+
expect(react_2.screen.getByTestId('comments-container-visibility-area')).toHaveClass(classnames_1.COMMENTS_CONTAINER_VISIBILITY_AREA);
|
|
188
|
+
expect(react_2.screen.getByTestId('comments-container')).toBeInTheDocument();
|
|
189
|
+
expect(react_2.screen.getByTestId('SvgAddComment')).toBeInTheDocument();
|
|
190
|
+
expect(react_2.screen.getByTestId('reltio-comment-button')).toBeInTheDocument();
|
|
118
191
|
});
|
|
119
192
|
it('should render highlighted label', function () {
|
|
120
193
|
var attributeType = { type: 'String', name: 'Name', uri: 'testAttributeUri', label: 'Affiliation Status' };
|
|
121
194
|
var attributeValue = { value: '123', uri: 'entities/16U21B8f/attributes/Name/2sAfjGOIh' };
|
|
122
|
-
var
|
|
195
|
+
var highlightedValues = {
|
|
123
196
|
highlightedValuesUris: [attributeValue.uri],
|
|
124
197
|
highlightedClassName: 'hlClassName'
|
|
125
198
|
};
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
expect(
|
|
199
|
+
setUp({ attributeType: attributeType, attributeValue: attributeValue }, { highlightedValues: highlightedValues });
|
|
200
|
+
var container = react_2.screen.getByTestId('comments-container-visibility-area');
|
|
201
|
+
expect(container).toHaveClass('hlClassName');
|
|
202
|
+
expect(container).toHaveTextContent('123');
|
|
129
203
|
});
|
|
130
204
|
it('should render label without highlights', function () {
|
|
131
205
|
var attributeType = { type: 'String', name: 'Name', uri: 'testAttributeUri', label: 'Affiliation Status' };
|
|
132
206
|
var attributeValue = { value: '123', uri: 'entities/16U21B8f/attributes/Name/2sAfjGOIh' };
|
|
133
|
-
var
|
|
207
|
+
var highlightedValues = {
|
|
134
208
|
highlightedValuesUris: ['testAttributeUr'],
|
|
135
209
|
highlightedClassName: 'hlClassName'
|
|
136
210
|
};
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
expect(
|
|
211
|
+
setUp({ attributeType: attributeType, attributeValue: attributeValue }, { highlightedValues: highlightedValues });
|
|
212
|
+
var container = react_2.screen.getByTestId('comments-container-visibility-area');
|
|
213
|
+
expect(container).not.toHaveClass('hlClassName');
|
|
214
|
+
expect(container).toHaveTextContent('123');
|
|
140
215
|
});
|
|
141
216
|
it('should add ovFalse style if inlined is true', function () {
|
|
142
|
-
var
|
|
217
|
+
var attributeType = { type: 'String', name: 'Name', uri: 'uri1' };
|
|
143
218
|
var attributeValue = { value: '123', uri: 'uri1', ov: false };
|
|
144
|
-
|
|
145
|
-
expect(
|
|
219
|
+
setUp({ attributeType: attributeType, attributeValue: attributeValue, inlined: true });
|
|
220
|
+
expect(react_2.screen.getByTestId('reltio-attribute-value')).toHaveClass('ovFalse');
|
|
146
221
|
});
|
|
147
222
|
it('should add ovFalse style if inlined is false', function () {
|
|
148
|
-
var
|
|
223
|
+
var attributeType = { type: 'String', name: 'Name', uri: 'uri1' };
|
|
149
224
|
var attributeValue = { value: '123', uri: 'uri1', ov: false };
|
|
150
|
-
|
|
151
|
-
expect(
|
|
225
|
+
setUp({ attributeType: attributeType, attributeValue: attributeValue, inlined: false });
|
|
226
|
+
expect(react_2.screen.getByTestId('reltio-attribute-value')).toHaveClass('ovFalse');
|
|
152
227
|
});
|
|
153
228
|
});
|