@reltio/components 1.4.1945 → 1.4.1947
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/cjs/AttributeListItem/AttributeListItem.spec.js +4 -4
- package/cjs/AttributesErrorsPanel/components/Error/Error.specs.js +1 -1
- package/cjs/AttributesFiltersBuilder/AttributesFiltersBuilder.test.js +8 -8
- package/cjs/AttributesFiltersBuilder/components/AttributeSelector/AttributeSelector.test.js +2 -2
- package/cjs/AttributesFiltersBuilder/components/RowActions/RowActions.test.js +3 -3
- package/cjs/AttributesFiltersButton/AttributesFiltersButton.test.js +1 -1
- package/cjs/AutoSizeList/AutoSizeList.test.js +27 -30
- package/cjs/BasicTable/BasicTable.test.js +26 -5
- package/cjs/BasicTable/IntegrationBasicTable.test.js +16 -5
- package/cjs/BasicTable/helpers.test.js +1 -1
- package/cjs/CollapseRowButton/CollapseRowButton.test.js +3 -3
- package/cjs/CommentsContainer/CommentsContainer.test.js +2 -2
- package/cjs/CustomDateRangeEditor/CustomDateRangeEditor.test.js +2 -2
- package/cjs/DataTypeValue/DataTypeValue.test.js +2 -25
- package/cjs/DataTypeValueEditor/useEditorContext.test.js +2 -2
- package/cjs/DependentLookupEditor/DependentLookupEditor.test.js +116 -70
- package/cjs/DropDownEditor/DropDownEditor.test.js +1 -1
- package/cjs/EditModeAttributesFactory/components/EditModeAttribute/EditModeAttribute.test.js +4 -27
- package/cjs/EditModeAttributesList/EditModeAttributesList.test.js +6 -3
- package/cjs/EditModeAttributesPager/EditModeAttributesPager.js +1 -2
- package/cjs/EditModeAttributesView/IntegrationEditModeAttributesView.test.js +28 -37
- package/cjs/EntitySelector/EntitySelector.test.js +13 -42
- package/cjs/EntitySelector/components/ClearIndicator/ClearIndicator.test.js +1 -1
- package/cjs/EntitySelector/components/EntityOption/EntityOption.test.js +1 -1
- package/cjs/EntitySelector/components/Group/Group.test.js +1 -1
- package/cjs/EntityUriLink/EntityUriLink.test.js +1 -0
- package/cjs/ErrorBoundary/ErrorBoundary.test.js +2 -0
- package/cjs/ExpandedValueTooltip/ExpandedValueTooltip.test.js +4 -1
- package/cjs/FilterButton/FilterButton.test.js +1 -1
- package/cjs/HOCs/withFilter/components/ColumnFilter/ColumnFilter.spec.js +3 -3
- package/cjs/HOCs/withTableContext/withTableContext.test.js +1 -1
- package/cjs/HierarchyNodeTitle/HierarchyNodeTitle.test.js +4 -27
- package/cjs/HierarchyNodeTitle/useEntityDetails.test.js +18 -32
- package/cjs/ImageAttributesGallery/ImageAttributesGallery.test.js +6 -4
- package/cjs/ImageAttributesGallery/components/HeaderRight/HeaderRight.test.js +1 -1
- package/cjs/ImageAttributesLine/ImageAttributesLine.test.js +110 -68
- package/cjs/ImageAttributesLineEditor/ImageAttributesLineEditor.test.js +4 -4
- package/cjs/ImageGalleryDialog/ImageGalleryDialog.specs.js +3 -3
- package/cjs/ImportButton/ImportButton.test.js +1 -1
- package/cjs/InlineAttributesPager/components/InlineNestedAttributesBlock/InlineNestedAttributesBlock.test.js +1 -1
- package/cjs/InlineAttributesPager/components/InlineSimpleAttributesBlock/InlineSimpleAttributesBlock.test.js +1 -1
- package/cjs/InlineComplexAttribute/InlineComplexAttribute.test.js +3 -3
- package/cjs/InlineSimpleAttribute/InlineSimpleAttribute.spec.js +31 -22
- package/cjs/LineChart/LineChart.test.js +1 -1
- package/cjs/Link/Link.test.js +1 -0
- package/cjs/LookupEditor/LookupEditor.test.js +3 -3
- package/cjs/LookupEditor/components/GroupedDropDownEditor/GroupedDropDownEditor.test.js +1 -1
- package/cjs/MapChart/MapChart.test.js +3 -3
- package/cjs/MetadataTypesSelector/MetadataTypesSelector.test.js +3 -3
- package/cjs/MoreAttributesButton/MoreAttributesButton.test.js +1 -1
- package/cjs/MultipleInput/MultipleInput.test.js +11 -11
- package/cjs/MultipliableSelect/MultipliableSelect.test.js +14 -8
- package/cjs/NestedAttributeEditor/NestedAttributeEditor.test.js +4 -27
- package/cjs/NumberEditor/NumberEditor.test.js +4 -4
- package/cjs/PieChart/PieChart.test.js +1 -1
- package/cjs/PivotingTooltip/IntegrationPivotingTooltip.test.js +11 -34
- package/cjs/PivotingTooltip/components/PivotingTooltipContent/PivotingTooltipContent.test.js +4 -30
- package/cjs/PivotingUriLink/PivotingUriLink.spec.js +1 -0
- package/cjs/ProfileBandNavigation/useSearchNavigation.test.js +3 -3
- package/cjs/ProfilesList/ProfilesList.spec.js +1 -1
- package/cjs/ReactSelectLoadMoreButton/ReactSelectLoadMoreButton.test.js +1 -1
- package/cjs/ReferenceAttributeEditor/ReferenceAttributeEditor.test.js +6 -30
- package/cjs/RelationEditor/IntegrationRelationEditor.test.js +1 -1
- package/cjs/RelationEditor/RelationEditor.test.js +20 -44
- package/cjs/ReltioMap/ReltioMap.spec.js +10 -8
- package/cjs/ReltioMap/components/EntityMarker/EntityMarker.spec.js +2 -26
- package/cjs/ScrollableTabs/ScrollableTabs.test.js +1 -1
- package/cjs/SearchInput/SearchInput.spec.js +2 -2
- package/cjs/SelectionPopup/SelectionPopup.spec.js +9 -12
- package/cjs/SelectorWithOnlyOptionAutoSelect/SelectorWithOnlyOptionAutoSelect.test.js +4 -4
- package/cjs/ShowLess/ShowLess.test.js +1 -1
- package/cjs/ShowMore/ShowMore.test.js +2 -2
- package/cjs/SideButtonsPanel/SideButtonsPanel.spec.js +3 -3
- package/cjs/SimpleAttribute/IntegrationSimpleAttribute.test.js +15 -34
- package/cjs/SimpleDropDownSelector/SimpleDropDownSelector.test.js +1 -1
- package/cjs/TableWithBars/TableWithBars.test.js +1 -1
- package/cjs/TreeChart/TreeChart.test.js +1 -1
- package/cjs/TypeaheadEditor/TypeaheadEditor.test.js +8 -1
- package/cjs/UploadFileButton/UploadFileButton.spec.js +103 -69
- package/cjs/VerticalHeadingsTable/components/TableCellWithDnd/TableCellWithDnd.test.js +4 -1
- package/cjs/VerticalHeadingsTable/components/TableRowWithDnd/TableRowWithDnd.test.js +3 -1
- package/cjs/features/activity-log/ActivitiesFactory/components/SearchActivity/SearchActivity.test.js +2 -2
- package/cjs/features/activity-log/ActivityExportButton/ActivityExportButton.specs.js +1 -25
- package/cjs/features/activity-log/ActivityFilterEditor/components/EntityChangedSelectors/EntityChangedSelectors.specs.js +1 -25
- package/cjs/features/activity-log/ActivityLog/ActivityLog.test.js +4 -0
- package/cjs/features/activity-log/ActivityLog/components/GroupItem/GroupItem.test.js +1 -1
- package/cjs/features/activity-log/ActivityLogFilter/ActivityLogFilter.specs.js +1 -2
- package/cjs/features/crosswalks/AttributesTable/AttributesTable.test.js +13 -13
- package/cjs/features/crosswalks/AttributesTable/IntegrationAttributesTable.test.js +5 -5
- package/cjs/features/crosswalks/AttributesTable/components/AddAttributesButton/AddAttributesButton.test.js +4 -4
- package/cjs/features/crosswalks/AttributesTable/components/ConfirmEditIgnoredDialog/ConfirmEditIgnoredDialog.test.js +5 -5
- package/cjs/features/crosswalks/AttributesTable/components/WinnerSourcesRenderer/WinnerSourcesRenderer.test.js +2 -2
- package/cjs/features/crosswalks/CrosswalkDragLayer/components/CrosswalkDragPreview/CrosswalkDragPreview.d.ts +2 -2
- package/cjs/features/crosswalks/CrosswalkDragLayer/components/CrosswalkDragPreview/CrosswalkDragPreview.js +27 -4
- package/cjs/features/crosswalks/CrosswalkRow/CrosswalkRow.test.js +15 -16
- package/cjs/features/crosswalks/ShowDependentLink/ShowDependentLink.test.js +1 -1
- package/cjs/features/crosswalks/SourceCrosswalksRow/SourceCrosswalksRow.test.js +2 -2
- package/cjs/features/crosswalks/hooks/useAttributeActions.test.js +95 -118
- package/cjs/features/crosswalks/hooks/useCrosswalkActions.test.js +38 -61
- package/cjs/features/crosswalks/hooks/useModifiedEntity.test.js +8 -8
- package/cjs/features/graph/DataModelGraph/hooks/useEdgeLabelsRenderer.test.js +2 -2
- package/cjs/features/history/ContributorsPanel/components/ContributorItem/ContributorItem.specs.js +5 -26
- package/cjs/features/history/HistoryGraph/components/HistoryLink/HistoryLink.specs.js +2 -2
- package/cjs/features/history/HistoryRow/HistoryRow.specs.js +2 -26
- package/cjs/features/history/HistoryTree/HistoryTree.specs.js +1 -1
- package/cjs/features/history/HistoryView/HistoryView.specs.js +1 -1
- package/cjs/features/history/helpers/filters.test.js +6 -6
- package/cjs/features/history/hooks/useHistory.test.js +23 -48
- package/cjs/features/workflow/AddWorkflowDialog/AddWorkflowDialog.spec.js +24 -8
- package/cjs/features/workflow/AssigneeSelector/AssigneeSelector.spec.js +1 -26
- package/cjs/features/workflow/WorkflowTaskCard/components/GenericWorkflowTaskCard/GenericWorkflowTaskCard.spec.js +4 -30
- package/cjs/features/workflow/hooks/useChangeRequest.specs.js +11 -36
- package/cjs/helpers/customScript.test.js +19 -19
- package/cjs/hooks/useAPI/useAPI.test.js +12 -12
- package/cjs/hooks/useBasicTableCellRenderer/CellRenderer.test.js +2 -1
- package/cjs/hooks/useCollapsibleTableRows/dataHelpers.test.js +1 -1
- package/cjs/hooks/useCollapsibleTableRows/useCollapsibleTableRows.test.js +1 -1
- package/cjs/hooks/useConfigPermissions/useConfigPermissions.specs.js +5 -29
- package/cjs/hooks/useCustomScripts/useCustomScripts.test.js +8 -8
- package/cjs/hooks/useLayoutResetter/useLayoutResetter.test.js +8 -8
- package/cjs/hooks/useMarkers/helpers.js +1 -2
- package/cjs/hooks/useReadableSearchState/useReadableSearchState.test.js +14 -44
- package/cjs/hooks/useRelationsLoader/useRelationsLoader.specs.js +3 -4
- package/cjs/hooks/useSavedStateForEntityType/useSavedStateForEntityType.test.js +4 -4
- package/cjs/hooks/useScrollToAttributeError/useScrollToAttributeError.test.js +1 -1
- package/cjs/hooks/useSegmentationRequest/index.d.ts +1 -0
- package/cjs/hooks/useSegmentationRequest/index.js +5 -0
- package/cjs/hooks/useSegmentationRequest/useSegmentationRequest.d.ts +9 -0
- package/cjs/hooks/useSegmentationRequest/useSegmentationRequest.js +32 -0
- package/cjs/hooks/useSnackbar/useSnackbar.test.js +24 -17
- package/cjs/index.d.ts +1 -0
- package/cjs/index.js +4 -2
- package/esm/AttributeListItem/AttributeListItem.spec.js +4 -4
- package/esm/AttributesErrorsPanel/components/Error/Error.specs.js +1 -1
- package/esm/AttributesFiltersBuilder/AttributesFiltersBuilder.test.js +8 -8
- package/esm/AttributesFiltersBuilder/components/AttributeSelector/AttributeSelector.test.js +2 -2
- package/esm/AttributesFiltersBuilder/components/RowActions/RowActions.test.js +3 -3
- package/esm/AttributesFiltersButton/AttributesFiltersButton.test.js +1 -1
- package/esm/AutoSizeList/AutoSizeList.test.js +28 -31
- package/esm/BasicTable/BasicTable.test.js +26 -5
- package/esm/BasicTable/IntegrationBasicTable.test.js +17 -6
- package/esm/BasicTable/helpers.test.js +1 -1
- package/esm/CollapseRowButton/CollapseRowButton.test.js +3 -3
- package/esm/CommentsContainer/CommentsContainer.test.js +2 -2
- package/esm/CustomDateRangeEditor/CustomDateRangeEditor.test.js +2 -2
- package/esm/DataTypeValue/DataTypeValue.test.js +2 -2
- package/esm/DataTypeValueEditor/useEditorContext.test.js +2 -2
- package/esm/DependentLookupEditor/DependentLookupEditor.test.js +116 -70
- package/esm/DropDownEditor/DropDownEditor.test.js +1 -1
- package/esm/EditModeAttributesFactory/components/EditModeAttribute/EditModeAttribute.test.js +4 -4
- package/esm/EditModeAttributesList/EditModeAttributesList.test.js +4 -1
- package/esm/EditModeAttributesPager/EditModeAttributesPager.js +1 -2
- package/esm/EditModeAttributesView/IntegrationEditModeAttributesView.test.js +30 -16
- package/esm/EntitySelector/EntitySelector.test.js +13 -19
- package/esm/EntitySelector/components/ClearIndicator/ClearIndicator.test.js +1 -1
- package/esm/EntitySelector/components/EntityOption/EntityOption.test.js +1 -1
- package/esm/EntitySelector/components/Group/Group.test.js +1 -1
- package/esm/EntityUriLink/EntityUriLink.test.js +1 -0
- package/esm/ErrorBoundary/ErrorBoundary.test.js +2 -0
- package/esm/ExpandedValueTooltip/ExpandedValueTooltip.test.js +4 -1
- package/esm/FilterButton/FilterButton.test.js +1 -1
- package/esm/HOCs/withFilter/components/ColumnFilter/ColumnFilter.spec.js +3 -3
- package/esm/HOCs/withTableContext/withTableContext.test.js +1 -1
- package/esm/HierarchyNodeTitle/HierarchyNodeTitle.test.js +4 -4
- package/esm/HierarchyNodeTitle/useEntityDetails.test.js +19 -10
- package/esm/ImageAttributesGallery/ImageAttributesGallery.test.js +6 -4
- package/esm/ImageAttributesGallery/components/HeaderRight/HeaderRight.test.js +1 -1
- package/esm/ImageAttributesLine/ImageAttributesLine.test.js +110 -68
- package/esm/ImageAttributesLineEditor/ImageAttributesLineEditor.test.js +4 -4
- package/esm/ImageGalleryDialog/ImageGalleryDialog.specs.js +3 -3
- package/esm/ImportButton/ImportButton.test.js +1 -1
- package/esm/InlineAttributesPager/components/InlineNestedAttributesBlock/InlineNestedAttributesBlock.test.js +1 -1
- package/esm/InlineAttributesPager/components/InlineSimpleAttributesBlock/InlineSimpleAttributesBlock.test.js +1 -1
- package/esm/InlineComplexAttribute/InlineComplexAttribute.test.js +3 -3
- package/esm/InlineSimpleAttribute/InlineSimpleAttribute.spec.js +32 -23
- package/esm/LineChart/LineChart.test.js +1 -1
- package/esm/Link/Link.test.js +1 -0
- package/esm/LookupEditor/LookupEditor.test.js +3 -3
- package/esm/LookupEditor/components/GroupedDropDownEditor/GroupedDropDownEditor.test.js +1 -1
- package/esm/MapChart/MapChart.test.js +3 -3
- package/esm/MetadataTypesSelector/MetadataTypesSelector.test.js +3 -3
- package/esm/MoreAttributesButton/MoreAttributesButton.test.js +1 -1
- package/esm/MultipleInput/MultipleInput.test.js +11 -11
- package/esm/MultipliableSelect/MultipliableSelect.test.js +14 -8
- package/esm/NestedAttributeEditor/NestedAttributeEditor.test.js +4 -4
- package/esm/NumberEditor/NumberEditor.test.js +4 -4
- package/esm/PieChart/PieChart.test.js +1 -1
- package/esm/PivotingTooltip/IntegrationPivotingTooltip.test.js +11 -11
- package/esm/PivotingTooltip/components/PivotingTooltipContent/PivotingTooltipContent.test.js +4 -7
- package/esm/PivotingUriLink/PivotingUriLink.spec.js +1 -0
- package/esm/ProfileBandNavigation/useSearchNavigation.test.js +3 -3
- package/esm/ProfilesList/ProfilesList.spec.js +1 -1
- package/esm/ReactSelectLoadMoreButton/ReactSelectLoadMoreButton.test.js +1 -1
- package/esm/ReferenceAttributeEditor/ReferenceAttributeEditor.test.js +7 -8
- package/esm/RelationEditor/IntegrationRelationEditor.test.js +1 -1
- package/esm/RelationEditor/RelationEditor.test.js +21 -22
- package/esm/ReltioMap/ReltioMap.spec.js +11 -9
- package/esm/ReltioMap/components/EntityMarker/EntityMarker.spec.js +3 -4
- package/esm/ScrollableTabs/ScrollableTabs.test.js +1 -1
- package/esm/SearchInput/SearchInput.spec.js +2 -2
- package/esm/SelectionPopup/SelectionPopup.spec.js +9 -12
- package/esm/SelectorWithOnlyOptionAutoSelect/SelectorWithOnlyOptionAutoSelect.test.js +4 -4
- package/esm/ShowLess/ShowLess.test.js +1 -1
- package/esm/ShowMore/ShowMore.test.js +2 -2
- package/esm/SideButtonsPanel/SideButtonsPanel.spec.js +3 -3
- package/esm/SimpleAttribute/IntegrationSimpleAttribute.test.js +16 -12
- package/esm/SimpleDropDownSelector/SimpleDropDownSelector.test.js +1 -1
- package/esm/TableWithBars/TableWithBars.test.js +1 -1
- package/esm/TreeChart/TreeChart.test.js +1 -1
- package/esm/TypeaheadEditor/TypeaheadEditor.test.js +8 -1
- package/esm/UploadFileButton/UploadFileButton.spec.js +103 -69
- package/esm/VerticalHeadingsTable/components/TableCellWithDnd/TableCellWithDnd.test.js +4 -1
- package/esm/VerticalHeadingsTable/components/TableRowWithDnd/TableRowWithDnd.test.js +3 -1
- package/esm/features/activity-log/ActivitiesFactory/components/SearchActivity/SearchActivity.test.js +2 -2
- package/esm/features/activity-log/ActivityExportButton/ActivityExportButton.specs.js +1 -2
- package/esm/features/activity-log/ActivityFilterEditor/components/EntityChangedSelectors/EntityChangedSelectors.specs.js +2 -3
- package/esm/features/activity-log/ActivityLog/ActivityLog.test.js +4 -0
- package/esm/features/activity-log/ActivityLog/components/GroupItem/GroupItem.test.js +1 -1
- package/esm/features/activity-log/ActivityLogFilter/ActivityLogFilter.specs.js +1 -2
- package/esm/features/crosswalks/AttributesTable/AttributesTable.test.js +13 -13
- package/esm/features/crosswalks/AttributesTable/IntegrationAttributesTable.test.js +5 -5
- package/esm/features/crosswalks/AttributesTable/components/AddAttributesButton/AddAttributesButton.test.js +4 -4
- package/esm/features/crosswalks/AttributesTable/components/ConfirmEditIgnoredDialog/ConfirmEditIgnoredDialog.test.js +5 -5
- package/esm/features/crosswalks/AttributesTable/components/WinnerSourcesRenderer/WinnerSourcesRenderer.test.js +2 -2
- package/esm/features/crosswalks/CrosswalkDragLayer/components/CrosswalkDragPreview/CrosswalkDragPreview.d.ts +2 -2
- package/esm/features/crosswalks/CrosswalkDragLayer/components/CrosswalkDragPreview/CrosswalkDragPreview.js +4 -3
- package/esm/features/crosswalks/CrosswalkRow/CrosswalkRow.test.js +15 -16
- package/esm/features/crosswalks/ShowDependentLink/ShowDependentLink.test.js +1 -1
- package/esm/features/crosswalks/SourceCrosswalksRow/SourceCrosswalksRow.test.js +2 -2
- package/esm/features/crosswalks/hooks/useAttributeActions.test.js +95 -95
- package/esm/features/crosswalks/hooks/useCrosswalkActions.test.js +38 -38
- package/esm/features/crosswalks/hooks/useModifiedEntity.test.js +8 -8
- package/esm/features/graph/DataModelGraph/hooks/useEdgeLabelsRenderer.test.js +2 -2
- package/esm/features/history/ContributorsPanel/components/ContributorItem/ContributorItem.specs.js +5 -3
- package/esm/features/history/HistoryGraph/components/HistoryLink/HistoryLink.specs.js +2 -2
- package/esm/features/history/HistoryRow/HistoryRow.specs.js +2 -3
- package/esm/features/history/HistoryTree/HistoryTree.specs.js +1 -1
- package/esm/features/history/HistoryView/HistoryView.specs.js +1 -1
- package/esm/features/history/helpers/filters.test.js +6 -6
- package/esm/features/history/hooks/useHistory.test.js +23 -25
- package/esm/features/workflow/AddWorkflowDialog/AddWorkflowDialog.spec.js +25 -9
- package/esm/features/workflow/AssigneeSelector/AssigneeSelector.spec.js +1 -3
- package/esm/features/workflow/WorkflowTaskCard/components/GenericWorkflowTaskCard/GenericWorkflowTaskCard.spec.js +5 -8
- package/esm/features/workflow/hooks/useChangeRequest.specs.js +11 -13
- package/esm/helpers/customScript.test.js +19 -19
- package/esm/hooks/useAPI/useAPI.test.js +12 -12
- package/esm/hooks/useBasicTableCellRenderer/CellRenderer.test.js +2 -1
- package/esm/hooks/useCollapsibleTableRows/dataHelpers.test.js +1 -1
- package/esm/hooks/useCollapsibleTableRows/useCollapsibleTableRows.test.js +1 -1
- package/esm/hooks/useConfigPermissions/useConfigPermissions.specs.js +6 -7
- package/esm/hooks/useCustomScripts/useCustomScripts.test.js +8 -8
- package/esm/hooks/useLayoutResetter/useLayoutResetter.test.js +9 -9
- package/esm/hooks/useMarkers/helpers.js +1 -2
- package/esm/hooks/useReadableSearchState/useReadableSearchState.test.js +8 -15
- package/esm/hooks/useRelationsLoader/useRelationsLoader.specs.js +1 -2
- package/esm/hooks/useSavedStateForEntityType/useSavedStateForEntityType.test.js +4 -4
- package/esm/hooks/useScrollToAttributeError/useScrollToAttributeError.test.js +1 -1
- package/esm/hooks/useSegmentationRequest/index.d.ts +1 -0
- package/esm/hooks/useSegmentationRequest/index.js +1 -0
- package/esm/hooks/useSegmentationRequest/useSegmentationRequest.d.ts +9 -0
- package/esm/hooks/useSegmentationRequest/useSegmentationRequest.js +28 -0
- package/esm/hooks/useSnackbar/useSnackbar.test.js +25 -18
- package/esm/index.d.ts +1 -0
- package/esm/index.js +1 -0
- package/package.json +2 -2
|
@@ -10,29 +10,6 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
-
if (k2 === undefined) k2 = k;
|
|
15
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
-
}
|
|
19
|
-
Object.defineProperty(o, k2, desc);
|
|
20
|
-
}) : (function(o, m, k, k2) {
|
|
21
|
-
if (k2 === undefined) k2 = k;
|
|
22
|
-
o[k2] = m[k];
|
|
23
|
-
}));
|
|
24
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
-
}) : function(o, v) {
|
|
27
|
-
o["default"] = v;
|
|
28
|
-
});
|
|
29
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
-
if (mod && mod.__esModule) return mod;
|
|
31
|
-
var result = {};
|
|
32
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
-
__setModuleDefault(result, mod);
|
|
34
|
-
return result;
|
|
35
|
-
};
|
|
36
13
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
37
14
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
38
15
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -73,7 +50,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
73
50
|
var useAttributeActions_1 = require("./useAttributeActions");
|
|
74
51
|
var test_utils_1 = require("react-dom/test-utils");
|
|
75
52
|
var react_hooks_1 = require("@testing-library/react-hooks");
|
|
76
|
-
var
|
|
53
|
+
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
77
54
|
jest.mock('@reltio/mdm-sdk', function () { return (__assign(__assign({}, jest.requireActual('@reltio/mdm-sdk')), { entityCumulativeDelete: jest.fn(), entityCumulativeUpdate: jest.fn(), ignoreAttribute: jest.fn(), pinAttribute: jest.fn(), removeRelation: jest.fn(), updateAttribute: jest.fn(), createAttribute: jest.fn() })); });
|
|
78
55
|
describe('useAttributeActions', function () {
|
|
79
56
|
var initialProps = {
|
|
@@ -85,43 +62,43 @@ describe('useAttributeActions', function () {
|
|
|
85
62
|
return (0, react_hooks_1.renderHook)(useAttributeActions_1.useAttributeActions, { initialProps: initialProps }).result.current;
|
|
86
63
|
};
|
|
87
64
|
var resolveSuccess, resolveError;
|
|
88
|
-
|
|
65
|
+
mdm_sdk_1.entityCumulativeDelete.mockImplementation(function () {
|
|
89
66
|
return new Promise(function (_resolve, _reject) {
|
|
90
67
|
resolveSuccess = function () { return _resolve({ uri: 'entities/1', type: 'configuration/entityTypes/HCP' }); };
|
|
91
68
|
resolveError = function () { return _reject({ errorMessage: 'Some error' }); };
|
|
92
69
|
});
|
|
93
70
|
});
|
|
94
|
-
|
|
71
|
+
mdm_sdk_1.entityCumulativeUpdate.mockImplementation(function () {
|
|
95
72
|
return new Promise(function (_resolve, _reject) {
|
|
96
73
|
resolveSuccess = function () { return _resolve({ uri: 'relations/03xNaHt', type: 'configuration/relationTypes/HCPtoHCA' }); };
|
|
97
74
|
resolveError = function () { return _reject({ errorMessage: 'Some error' }); };
|
|
98
75
|
});
|
|
99
76
|
});
|
|
100
|
-
|
|
77
|
+
mdm_sdk_1.removeRelation.mockImplementation(function () {
|
|
101
78
|
return new Promise(function (_resolve, _reject) {
|
|
102
79
|
resolveSuccess = function () { return _resolve({ status: 'success' }); };
|
|
103
80
|
resolveError = function () { return _reject({ errorMessage: 'Some error' }); };
|
|
104
81
|
});
|
|
105
82
|
});
|
|
106
|
-
|
|
83
|
+
mdm_sdk_1.ignoreAttribute.mockImplementation(function () {
|
|
107
84
|
return new Promise(function (_resolve, _reject) {
|
|
108
85
|
resolveSuccess = function (attributeValue) { return _resolve(attributeValue); };
|
|
109
86
|
resolveError = function () { return _reject({ errorMessage: 'Some error' }); };
|
|
110
87
|
});
|
|
111
88
|
});
|
|
112
|
-
|
|
89
|
+
mdm_sdk_1.pinAttribute.mockImplementation(function () {
|
|
113
90
|
return new Promise(function (_resolve, _reject) {
|
|
114
91
|
resolveSuccess = function (attributeValue) { return _resolve(attributeValue); };
|
|
115
92
|
resolveError = function () { return _reject({ errorMessage: 'Some error' }); };
|
|
116
93
|
});
|
|
117
94
|
});
|
|
118
|
-
|
|
95
|
+
mdm_sdk_1.updateAttribute.mockImplementation(function () {
|
|
119
96
|
return new Promise(function (_resolve, _reject) {
|
|
120
97
|
resolveSuccess = function (attributeValue) { return _resolve(attributeValue); };
|
|
121
98
|
resolveError = function () { return _reject({ errorMessage: 'Some error' }); };
|
|
122
99
|
});
|
|
123
100
|
});
|
|
124
|
-
|
|
101
|
+
mdm_sdk_1.createAttribute.mockImplementation(function () {
|
|
125
102
|
return new Promise(function (_resolve, _reject) {
|
|
126
103
|
resolveSuccess = function (attributeValue) { return _resolve(attributeValue); };
|
|
127
104
|
resolveError = function () { return _reject({ errorMessage: 'Some error' }); };
|
|
@@ -179,8 +156,8 @@ describe('useAttributeActions', function () {
|
|
|
179
156
|
]
|
|
180
157
|
};
|
|
181
158
|
deleteAttribute(deleteEvent);
|
|
182
|
-
expect(
|
|
183
|
-
expect(initialProps.onLoad).
|
|
159
|
+
expect(mdm_sdk_1.entityCumulativeDelete).toHaveBeenCalledWith(requestParams);
|
|
160
|
+
expect(initialProps.onLoad).toHaveBeenCalled();
|
|
184
161
|
return [4 /*yield*/, (0, test_utils_1.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
185
162
|
return __generator(this, function (_a) {
|
|
186
163
|
resolveSuccess();
|
|
@@ -189,9 +166,9 @@ describe('useAttributeActions', function () {
|
|
|
189
166
|
}); })];
|
|
190
167
|
case 1:
|
|
191
168
|
_a.sent();
|
|
192
|
-
expect(initialProps.onSuccess).
|
|
169
|
+
expect(initialProps.onSuccess).toHaveBeenCalled();
|
|
193
170
|
deleteAttribute(deleteEvent);
|
|
194
|
-
expect(
|
|
171
|
+
expect(mdm_sdk_1.entityCumulativeDelete).toHaveBeenCalledWith(requestParams);
|
|
195
172
|
return [4 /*yield*/, (0, test_utils_1.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
196
173
|
return __generator(this, function (_a) {
|
|
197
174
|
resolveError();
|
|
@@ -200,7 +177,7 @@ describe('useAttributeActions', function () {
|
|
|
200
177
|
}); })];
|
|
201
178
|
case 2:
|
|
202
179
|
_a.sent();
|
|
203
|
-
expect(initialProps.onError).
|
|
180
|
+
expect(initialProps.onError).toHaveBeenCalledWith({ errorMessage: 'Some error' });
|
|
204
181
|
return [2 /*return*/];
|
|
205
182
|
}
|
|
206
183
|
});
|
|
@@ -278,8 +255,8 @@ describe('useAttributeActions', function () {
|
|
|
278
255
|
]
|
|
279
256
|
};
|
|
280
257
|
deleteAttribute(deleteEvent);
|
|
281
|
-
expect(
|
|
282
|
-
expect(initialProps.onLoad).
|
|
258
|
+
expect(mdm_sdk_1.entityCumulativeDelete).toHaveBeenCalledWith(requestParams);
|
|
259
|
+
expect(initialProps.onLoad).toHaveBeenCalled();
|
|
283
260
|
return [4 /*yield*/, (0, test_utils_1.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
284
261
|
return __generator(this, function (_a) {
|
|
285
262
|
resolveSuccess();
|
|
@@ -288,9 +265,9 @@ describe('useAttributeActions', function () {
|
|
|
288
265
|
}); })];
|
|
289
266
|
case 1:
|
|
290
267
|
_a.sent();
|
|
291
|
-
expect(initialProps.onSuccess).
|
|
268
|
+
expect(initialProps.onSuccess).toHaveBeenCalled();
|
|
292
269
|
deleteAttribute(deleteEvent);
|
|
293
|
-
expect(
|
|
270
|
+
expect(mdm_sdk_1.entityCumulativeDelete).toHaveBeenCalledWith(requestParams);
|
|
294
271
|
return [4 /*yield*/, (0, test_utils_1.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
295
272
|
return __generator(this, function (_a) {
|
|
296
273
|
resolveError();
|
|
@@ -299,7 +276,7 @@ describe('useAttributeActions', function () {
|
|
|
299
276
|
}); })];
|
|
300
277
|
case 2:
|
|
301
278
|
_a.sent();
|
|
302
|
-
expect(initialProps.onError).
|
|
279
|
+
expect(initialProps.onError).toHaveBeenCalledWith({ errorMessage: 'Some error' });
|
|
303
280
|
return [2 /*return*/];
|
|
304
281
|
}
|
|
305
282
|
});
|
|
@@ -394,8 +371,8 @@ describe('useAttributeActions', function () {
|
|
|
394
371
|
]
|
|
395
372
|
};
|
|
396
373
|
deleteAttribute(deleteEvent);
|
|
397
|
-
expect(
|
|
398
|
-
expect(initialProps.onLoad).
|
|
374
|
+
expect(mdm_sdk_1.removeRelation).toHaveBeenCalledWith('relations/1');
|
|
375
|
+
expect(initialProps.onLoad).toHaveBeenCalled();
|
|
399
376
|
return [4 /*yield*/, (0, test_utils_1.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
400
377
|
return __generator(this, function (_a) {
|
|
401
378
|
resolveSuccess();
|
|
@@ -404,9 +381,9 @@ describe('useAttributeActions', function () {
|
|
|
404
381
|
}); })];
|
|
405
382
|
case 1:
|
|
406
383
|
_a.sent();
|
|
407
|
-
expect(initialProps.onSuccess).
|
|
384
|
+
expect(initialProps.onSuccess).toHaveBeenCalled();
|
|
408
385
|
deleteAttribute(deleteEvent);
|
|
409
|
-
expect(
|
|
386
|
+
expect(mdm_sdk_1.removeRelation).toHaveBeenCalledWith('relations/1');
|
|
410
387
|
return [4 /*yield*/, (0, test_utils_1.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
411
388
|
return __generator(this, function (_a) {
|
|
412
389
|
resolveError();
|
|
@@ -415,7 +392,7 @@ describe('useAttributeActions', function () {
|
|
|
415
392
|
}); })];
|
|
416
393
|
case 2:
|
|
417
394
|
_a.sent();
|
|
418
|
-
expect(initialProps.onError).
|
|
395
|
+
expect(initialProps.onError).toHaveBeenCalledWith({ errorMessage: 'Some error' });
|
|
419
396
|
return [2 /*return*/];
|
|
420
397
|
}
|
|
421
398
|
});
|
|
@@ -467,7 +444,7 @@ describe('useAttributeActions', function () {
|
|
|
467
444
|
],
|
|
468
445
|
uri: 'relations/03xNaHt'
|
|
469
446
|
};
|
|
470
|
-
expect(
|
|
447
|
+
expect(mdm_sdk_1.entityCumulativeUpdate).toHaveBeenCalledWith(requestParams);
|
|
471
448
|
expect(initialProps.onLoad).toHaveBeenCalled();
|
|
472
449
|
expect(initialProps.onSuccess).not.toHaveBeenCalled();
|
|
473
450
|
return [4 /*yield*/, (0, test_utils_1.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -480,7 +457,7 @@ describe('useAttributeActions', function () {
|
|
|
480
457
|
_a.sent();
|
|
481
458
|
expect(initialProps.onSuccess).toHaveBeenCalled();
|
|
482
459
|
deleteAttribute(deleteEvent);
|
|
483
|
-
expect(
|
|
460
|
+
expect(mdm_sdk_1.entityCumulativeUpdate).toHaveBeenCalledWith(requestParams);
|
|
484
461
|
expect(initialProps.onError).not.toHaveBeenCalled();
|
|
485
462
|
return [4 /*yield*/, (0, test_utils_1.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
486
463
|
return __generator(this, function (_a) {
|
|
@@ -496,11 +473,11 @@ describe('useAttributeActions', function () {
|
|
|
496
473
|
});
|
|
497
474
|
}); });
|
|
498
475
|
it('should return correct pin action for attribute', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
499
|
-
var
|
|
476
|
+
var pinAttributeAction, attributeValue;
|
|
500
477
|
return __generator(this, function (_a) {
|
|
501
478
|
switch (_a.label) {
|
|
502
479
|
case 0:
|
|
503
|
-
|
|
480
|
+
pinAttributeAction = getActions().pinAttribute;
|
|
504
481
|
attributeValue = {
|
|
505
482
|
uri: 'entities/1/attributes/CountryCode/1',
|
|
506
483
|
type: 'configuration/entityTypes/HCP/attributes/CountryCode',
|
|
@@ -508,12 +485,12 @@ describe('useAttributeActions', function () {
|
|
|
508
485
|
lookupCode: 'IT',
|
|
509
486
|
ov: true
|
|
510
487
|
};
|
|
511
|
-
|
|
512
|
-
expect(
|
|
488
|
+
pinAttributeAction({ attributeValue: attributeValue });
|
|
489
|
+
expect(mdm_sdk_1.pinAttribute).toHaveBeenCalledWith({
|
|
513
490
|
attributeUri: 'entities/1/attributes/CountryCode/1',
|
|
514
491
|
value: true
|
|
515
492
|
});
|
|
516
|
-
expect(initialProps.onLoad).
|
|
493
|
+
expect(initialProps.onLoad).toHaveBeenCalled();
|
|
517
494
|
return [4 /*yield*/, (0, test_utils_1.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
518
495
|
return __generator(this, function (_a) {
|
|
519
496
|
resolveSuccess(__assign(__assign({}, attributeValue), { pin: true }));
|
|
@@ -522,11 +499,11 @@ describe('useAttributeActions', function () {
|
|
|
522
499
|
}); })];
|
|
523
500
|
case 1:
|
|
524
501
|
_a.sent();
|
|
525
|
-
expect(initialProps.onSuccess).
|
|
526
|
-
|
|
502
|
+
expect(initialProps.onSuccess).toHaveBeenCalled();
|
|
503
|
+
pinAttributeAction({
|
|
527
504
|
attributeValue: __assign(__assign({}, attributeValue), { pin: true })
|
|
528
505
|
});
|
|
529
|
-
expect(
|
|
506
|
+
expect(mdm_sdk_1.pinAttribute).toHaveBeenCalledWith({
|
|
530
507
|
attributeUri: 'entities/1/attributes/CountryCode/1',
|
|
531
508
|
value: false
|
|
532
509
|
});
|
|
@@ -538,17 +515,17 @@ describe('useAttributeActions', function () {
|
|
|
538
515
|
}); })];
|
|
539
516
|
case 2:
|
|
540
517
|
_a.sent();
|
|
541
|
-
expect(initialProps.onError).
|
|
518
|
+
expect(initialProps.onError).toHaveBeenCalledWith({ errorMessage: 'Some error' });
|
|
542
519
|
return [2 /*return*/];
|
|
543
520
|
}
|
|
544
521
|
});
|
|
545
522
|
}); });
|
|
546
523
|
it('should return correct ignore action for attribute', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
547
|
-
var
|
|
524
|
+
var ignoreAttributeAction, attributeValue;
|
|
548
525
|
return __generator(this, function (_a) {
|
|
549
526
|
switch (_a.label) {
|
|
550
527
|
case 0:
|
|
551
|
-
|
|
528
|
+
ignoreAttributeAction = getActions().ignoreAttribute;
|
|
552
529
|
attributeValue = {
|
|
553
530
|
uri: 'entities/1/attributes/CountryCode/1',
|
|
554
531
|
type: 'configuration/entityTypes/HCP/attributes/CountryCode',
|
|
@@ -556,12 +533,12 @@ describe('useAttributeActions', function () {
|
|
|
556
533
|
lookupCode: 'IT',
|
|
557
534
|
ov: true
|
|
558
535
|
};
|
|
559
|
-
|
|
560
|
-
expect(
|
|
536
|
+
ignoreAttributeAction({ attributeValue: attributeValue });
|
|
537
|
+
expect(mdm_sdk_1.ignoreAttribute).toHaveBeenCalledWith({
|
|
561
538
|
attributeUri: 'entities/1/attributes/CountryCode/1',
|
|
562
539
|
value: true
|
|
563
540
|
});
|
|
564
|
-
expect(initialProps.onLoad).
|
|
541
|
+
expect(initialProps.onLoad).toHaveBeenCalled();
|
|
565
542
|
return [4 /*yield*/, (0, test_utils_1.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
566
543
|
return __generator(this, function (_a) {
|
|
567
544
|
resolveSuccess(__assign(__assign({}, attributeValue), { ignored: true }));
|
|
@@ -570,11 +547,11 @@ describe('useAttributeActions', function () {
|
|
|
570
547
|
}); })];
|
|
571
548
|
case 1:
|
|
572
549
|
_a.sent();
|
|
573
|
-
expect(initialProps.onSuccess).
|
|
574
|
-
|
|
550
|
+
expect(initialProps.onSuccess).toHaveBeenCalled();
|
|
551
|
+
ignoreAttributeAction({
|
|
575
552
|
attributeValue: __assign(__assign({}, attributeValue), { ignored: true })
|
|
576
553
|
});
|
|
577
|
-
expect(
|
|
554
|
+
expect(mdm_sdk_1.ignoreAttribute).toHaveBeenCalledWith({
|
|
578
555
|
attributeUri: 'entities/1/attributes/CountryCode/1',
|
|
579
556
|
value: false
|
|
580
557
|
});
|
|
@@ -586,17 +563,17 @@ describe('useAttributeActions', function () {
|
|
|
586
563
|
}); })];
|
|
587
564
|
case 2:
|
|
588
565
|
_a.sent();
|
|
589
|
-
expect(initialProps.onError).
|
|
566
|
+
expect(initialProps.onError).toHaveBeenCalledWith({ errorMessage: 'Some error' });
|
|
590
567
|
return [2 /*return*/];
|
|
591
568
|
}
|
|
592
569
|
});
|
|
593
570
|
}); });
|
|
594
571
|
it('should return correct update action for not lookup attribute', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
595
|
-
var
|
|
572
|
+
var updateAttributeAction, editEvent;
|
|
596
573
|
return __generator(this, function (_a) {
|
|
597
574
|
switch (_a.label) {
|
|
598
575
|
case 0:
|
|
599
|
-
|
|
576
|
+
updateAttributeAction = getActions().updateAttribute;
|
|
600
577
|
editEvent = {
|
|
601
578
|
attributeValue: {
|
|
602
579
|
uri: 'entities/1/attributes/AddressLine/1',
|
|
@@ -621,14 +598,14 @@ describe('useAttributeActions', function () {
|
|
|
621
598
|
}
|
|
622
599
|
}
|
|
623
600
|
};
|
|
624
|
-
|
|
625
|
-
expect(
|
|
601
|
+
updateAttributeAction(editEvent);
|
|
602
|
+
expect(mdm_sdk_1.updateAttribute).toHaveBeenCalledWith({
|
|
626
603
|
attributeUri: 'entities/1/attributes/AddressLine/1',
|
|
627
604
|
sourceUri: 'configuration/sources/Reltio',
|
|
628
605
|
crosswalkValue: 'nQpZyQt',
|
|
629
606
|
value: 'Pushkina 1'
|
|
630
607
|
});
|
|
631
|
-
expect(initialProps.onLoad).
|
|
608
|
+
expect(initialProps.onLoad).toHaveBeenCalled();
|
|
632
609
|
return [4 /*yield*/, (0, test_utils_1.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
633
610
|
return __generator(this, function (_a) {
|
|
634
611
|
resolveSuccess(__assign({}, editEvent.attributeValue));
|
|
@@ -637,11 +614,11 @@ describe('useAttributeActions', function () {
|
|
|
637
614
|
}); })];
|
|
638
615
|
case 1:
|
|
639
616
|
_a.sent();
|
|
640
|
-
expect(
|
|
641
|
-
expect(
|
|
642
|
-
expect(initialProps.onSuccess).
|
|
643
|
-
|
|
644
|
-
expect(
|
|
617
|
+
expect(mdm_sdk_1.pinAttribute).not.toHaveBeenCalled();
|
|
618
|
+
expect(mdm_sdk_1.ignoreAttribute).not.toHaveBeenCalled();
|
|
619
|
+
expect(initialProps.onSuccess).toHaveBeenCalled();
|
|
620
|
+
updateAttributeAction(editEvent);
|
|
621
|
+
expect(mdm_sdk_1.updateAttribute).toHaveBeenCalledWith({
|
|
645
622
|
attributeUri: 'entities/1/attributes/AddressLine/1',
|
|
646
623
|
sourceUri: 'configuration/sources/Reltio',
|
|
647
624
|
crosswalkValue: 'nQpZyQt',
|
|
@@ -655,17 +632,17 @@ describe('useAttributeActions', function () {
|
|
|
655
632
|
}); })];
|
|
656
633
|
case 2:
|
|
657
634
|
_a.sent();
|
|
658
|
-
expect(initialProps.onError).
|
|
635
|
+
expect(initialProps.onError).toHaveBeenCalledWith({ errorMessage: 'Some error' });
|
|
659
636
|
return [2 /*return*/];
|
|
660
637
|
}
|
|
661
638
|
});
|
|
662
639
|
}); });
|
|
663
640
|
it('should keep ignored flag on attribute update', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
664
|
-
var
|
|
641
|
+
var updateAttributeAction, editEvent;
|
|
665
642
|
return __generator(this, function (_a) {
|
|
666
643
|
switch (_a.label) {
|
|
667
644
|
case 0:
|
|
668
|
-
|
|
645
|
+
updateAttributeAction = getActions().updateAttribute;
|
|
669
646
|
editEvent = {
|
|
670
647
|
attributeValue: {
|
|
671
648
|
uri: 'entities/1/attributes/AddressLine/1',
|
|
@@ -691,15 +668,15 @@ describe('useAttributeActions', function () {
|
|
|
691
668
|
}
|
|
692
669
|
}
|
|
693
670
|
};
|
|
694
|
-
|
|
695
|
-
expect(
|
|
671
|
+
updateAttributeAction(editEvent);
|
|
672
|
+
expect(mdm_sdk_1.updateAttribute).toHaveBeenCalledWith({
|
|
696
673
|
attributeUri: 'entities/1/attributes/AddressLine/1',
|
|
697
674
|
sourceUri: 'configuration/sources/Reltio',
|
|
698
675
|
crosswalkValue: 'nQpZyQt',
|
|
699
676
|
value: 'Pushkina 1'
|
|
700
677
|
});
|
|
701
|
-
expect(
|
|
702
|
-
expect(initialProps.onLoad).
|
|
678
|
+
expect(mdm_sdk_1.pinAttribute).not.toHaveBeenCalled();
|
|
679
|
+
expect(initialProps.onLoad).toHaveBeenCalled();
|
|
703
680
|
return [4 /*yield*/, (0, test_utils_1.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
704
681
|
return __generator(this, function (_a) {
|
|
705
682
|
resolveSuccess(__assign({}, editEvent.attributeValue));
|
|
@@ -708,7 +685,7 @@ describe('useAttributeActions', function () {
|
|
|
708
685
|
}); })];
|
|
709
686
|
case 1:
|
|
710
687
|
_a.sent();
|
|
711
|
-
expect(
|
|
688
|
+
expect(mdm_sdk_1.ignoreAttribute).toHaveBeenCalledWith({
|
|
712
689
|
attributeUri: 'entities/1/attributes/AddressLine/1',
|
|
713
690
|
value: true
|
|
714
691
|
});
|
|
@@ -720,17 +697,17 @@ describe('useAttributeActions', function () {
|
|
|
720
697
|
}); })];
|
|
721
698
|
case 2:
|
|
722
699
|
_a.sent();
|
|
723
|
-
expect(initialProps.onSuccess).
|
|
700
|
+
expect(initialProps.onSuccess).toHaveBeenCalled();
|
|
724
701
|
return [2 /*return*/];
|
|
725
702
|
}
|
|
726
703
|
});
|
|
727
704
|
}); });
|
|
728
705
|
it('should return correct update action for lookup attribute', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
729
|
-
var
|
|
706
|
+
var updateAttributeAction, editEvent;
|
|
730
707
|
return __generator(this, function (_a) {
|
|
731
708
|
switch (_a.label) {
|
|
732
709
|
case 0:
|
|
733
|
-
|
|
710
|
+
updateAttributeAction = getActions().updateAttribute;
|
|
734
711
|
editEvent = {
|
|
735
712
|
attributeValue: {
|
|
736
713
|
uri: 'entities/1/attributes/CountryCode/1',
|
|
@@ -757,14 +734,14 @@ describe('useAttributeActions', function () {
|
|
|
757
734
|
}
|
|
758
735
|
}
|
|
759
736
|
};
|
|
760
|
-
|
|
761
|
-
expect(
|
|
737
|
+
updateAttributeAction(editEvent);
|
|
738
|
+
expect(mdm_sdk_1.updateAttribute).toHaveBeenCalledWith({
|
|
762
739
|
attributeUri: 'entities/1/attributes/CountryCode/1',
|
|
763
740
|
sourceUri: 'configuration/sources/Reltio',
|
|
764
741
|
crosswalkValue: 'nQpZyQt',
|
|
765
742
|
value: 'IT'
|
|
766
743
|
});
|
|
767
|
-
expect(initialProps.onLoad).
|
|
744
|
+
expect(initialProps.onLoad).toHaveBeenCalled();
|
|
768
745
|
return [4 /*yield*/, (0, test_utils_1.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
769
746
|
return __generator(this, function (_a) {
|
|
770
747
|
resolveSuccess(__assign({}, editEvent.attributeValue));
|
|
@@ -773,9 +750,9 @@ describe('useAttributeActions', function () {
|
|
|
773
750
|
}); })];
|
|
774
751
|
case 1:
|
|
775
752
|
_a.sent();
|
|
776
|
-
expect(initialProps.onSuccess).
|
|
777
|
-
|
|
778
|
-
expect(
|
|
753
|
+
expect(initialProps.onSuccess).toHaveBeenCalled();
|
|
754
|
+
updateAttributeAction(editEvent);
|
|
755
|
+
expect(mdm_sdk_1.updateAttribute).toHaveBeenCalledWith({
|
|
779
756
|
attributeUri: 'entities/1/attributes/CountryCode/1',
|
|
780
757
|
sourceUri: 'configuration/sources/Reltio',
|
|
781
758
|
crosswalkValue: 'nQpZyQt',
|
|
@@ -789,17 +766,17 @@ describe('useAttributeActions', function () {
|
|
|
789
766
|
}); })];
|
|
790
767
|
case 2:
|
|
791
768
|
_a.sent();
|
|
792
|
-
expect(initialProps.onError).
|
|
769
|
+
expect(initialProps.onError).toHaveBeenCalledWith({ errorMessage: 'Some error' });
|
|
793
770
|
return [2 /*return*/];
|
|
794
771
|
}
|
|
795
772
|
});
|
|
796
773
|
}); });
|
|
797
774
|
it('should return correct create action for not lookup attribute', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
798
|
-
var
|
|
775
|
+
var createAttributeAction, attributeValue, crosswalk;
|
|
799
776
|
return __generator(this, function (_a) {
|
|
800
777
|
switch (_a.label) {
|
|
801
778
|
case 0:
|
|
802
|
-
|
|
779
|
+
createAttributeAction = getActions().createAttribute;
|
|
803
780
|
attributeValue = {
|
|
804
781
|
uri: 'entities/1/attributes/CountryCode/$$$uri1',
|
|
805
782
|
type: 'configuration/entityTypes/HCP/attributes/CountryCode',
|
|
@@ -818,15 +795,15 @@ describe('useAttributeActions', function () {
|
|
|
818
795
|
'entities/1/attributes/Date/1': '2018-11-29T05:39:56.445Z'
|
|
819
796
|
}
|
|
820
797
|
};
|
|
821
|
-
|
|
822
|
-
expect(
|
|
798
|
+
createAttributeAction({ attributeValue: attributeValue, crosswalk: crosswalk });
|
|
799
|
+
expect(mdm_sdk_1.createAttribute).toHaveBeenCalledWith({
|
|
823
800
|
attributeUri: 'entities/1/attributes/CountryCode/$$$uri1',
|
|
824
801
|
sourceUri: 'configuration/sources/Reltio',
|
|
825
802
|
crosswalkValue: 'nQpZyQt',
|
|
826
803
|
crosswalkSourceTable: undefined,
|
|
827
804
|
value: 'Italy'
|
|
828
805
|
});
|
|
829
|
-
expect(initialProps.onLoad).
|
|
806
|
+
expect(initialProps.onLoad).toHaveBeenCalled();
|
|
830
807
|
return [4 /*yield*/, (0, test_utils_1.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
831
808
|
return __generator(this, function (_a) {
|
|
832
809
|
resolveSuccess([{ index: 0, successful: true, object: {} }]);
|
|
@@ -835,8 +812,8 @@ describe('useAttributeActions', function () {
|
|
|
835
812
|
}); })];
|
|
836
813
|
case 1:
|
|
837
814
|
_a.sent();
|
|
838
|
-
expect(initialProps.onSuccess).
|
|
839
|
-
|
|
815
|
+
expect(initialProps.onSuccess).toHaveBeenCalled();
|
|
816
|
+
createAttributeAction({ attributeValue: attributeValue, crosswalk: crosswalk });
|
|
840
817
|
return [4 /*yield*/, (0, test_utils_1.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
841
818
|
return __generator(this, function (_a) {
|
|
842
819
|
resolveError();
|
|
@@ -845,17 +822,17 @@ describe('useAttributeActions', function () {
|
|
|
845
822
|
}); })];
|
|
846
823
|
case 2:
|
|
847
824
|
_a.sent();
|
|
848
|
-
expect(initialProps.onError).
|
|
825
|
+
expect(initialProps.onError).toHaveBeenCalledWith({ errorMessage: 'Some error' });
|
|
849
826
|
return [2 /*return*/];
|
|
850
827
|
}
|
|
851
828
|
});
|
|
852
829
|
}); });
|
|
853
830
|
it('should return correct create action for lookup attribute', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
854
|
-
var
|
|
831
|
+
var createAttributeAction, attributeValue, crosswalk;
|
|
855
832
|
return __generator(this, function (_a) {
|
|
856
833
|
switch (_a.label) {
|
|
857
834
|
case 0:
|
|
858
|
-
|
|
835
|
+
createAttributeAction = getActions().createAttribute;
|
|
859
836
|
attributeValue = {
|
|
860
837
|
uri: 'entities/1/attributes/CountryCode/$$$uri1',
|
|
861
838
|
type: 'configuration/entityTypes/HCP/attributes/CountryCode',
|
|
@@ -875,15 +852,15 @@ describe('useAttributeActions', function () {
|
|
|
875
852
|
'entities/1/attributes/Date/1': '2018-11-29T05:39:56.445Z'
|
|
876
853
|
}
|
|
877
854
|
};
|
|
878
|
-
|
|
879
|
-
expect(
|
|
855
|
+
createAttributeAction({ attributeValue: attributeValue, crosswalk: crosswalk });
|
|
856
|
+
expect(mdm_sdk_1.createAttribute).toHaveBeenCalledWith({
|
|
880
857
|
attributeUri: 'entities/1/attributes/CountryCode/$$$uri1',
|
|
881
858
|
sourceUri: 'configuration/sources/Reltio',
|
|
882
859
|
crosswalkValue: 'nQpZyQt',
|
|
883
860
|
crosswalkSourceTable: undefined,
|
|
884
861
|
value: 'IT'
|
|
885
862
|
});
|
|
886
|
-
expect(initialProps.onLoad).
|
|
863
|
+
expect(initialProps.onLoad).toHaveBeenCalled();
|
|
887
864
|
return [4 /*yield*/, (0, test_utils_1.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
888
865
|
return __generator(this, function (_a) {
|
|
889
866
|
resolveSuccess([{ index: 0, successful: true, object: {} }]);
|
|
@@ -892,8 +869,8 @@ describe('useAttributeActions', function () {
|
|
|
892
869
|
}); })];
|
|
893
870
|
case 1:
|
|
894
871
|
_a.sent();
|
|
895
|
-
expect(initialProps.onSuccess).
|
|
896
|
-
|
|
872
|
+
expect(initialProps.onSuccess).toHaveBeenCalled();
|
|
873
|
+
createAttributeAction({ attributeValue: attributeValue, crosswalk: crosswalk });
|
|
897
874
|
return [4 /*yield*/, (0, test_utils_1.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
898
875
|
return __generator(this, function (_a) {
|
|
899
876
|
resolveError();
|
|
@@ -902,17 +879,17 @@ describe('useAttributeActions', function () {
|
|
|
902
879
|
}); })];
|
|
903
880
|
case 2:
|
|
904
881
|
_a.sent();
|
|
905
|
-
expect(initialProps.onError).
|
|
882
|
+
expect(initialProps.onError).toHaveBeenCalledWith({ errorMessage: 'Some error' });
|
|
906
883
|
return [2 /*return*/];
|
|
907
884
|
}
|
|
908
885
|
});
|
|
909
886
|
}); });
|
|
910
887
|
it('should return correct create action for lookup attribute inside nested', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
911
|
-
var
|
|
888
|
+
var createAttributeAction, attributeValue, crosswalk;
|
|
912
889
|
return __generator(this, function (_a) {
|
|
913
890
|
switch (_a.label) {
|
|
914
891
|
case 0:
|
|
915
|
-
|
|
892
|
+
createAttributeAction = getActions().createAttribute;
|
|
916
893
|
attributeValue = {
|
|
917
894
|
value: {
|
|
918
895
|
CountryCode: [
|
|
@@ -945,8 +922,8 @@ describe('useAttributeActions', function () {
|
|
|
945
922
|
'entities/03caeDZ/attributes/CountryCode/og2irm1': '2024-03-21T10:31:37.206Z'
|
|
946
923
|
}
|
|
947
924
|
};
|
|
948
|
-
|
|
949
|
-
expect(
|
|
925
|
+
createAttributeAction({ attributeValue: attributeValue, crosswalk: crosswalk });
|
|
926
|
+
expect(mdm_sdk_1.createAttribute).toHaveBeenCalledWith({
|
|
950
927
|
attributeUri: 'entities/03caeDZ/attributes/UseCase1/uri$$K6aSzmeM8knmWyNT1711463312035',
|
|
951
928
|
sourceUri: 'configuration/sources/Reltio',
|
|
952
929
|
crosswalkValue: '03caeDZ',
|
|
@@ -962,7 +939,7 @@ describe('useAttributeActions', function () {
|
|
|
962
939
|
]
|
|
963
940
|
}
|
|
964
941
|
});
|
|
965
|
-
expect(initialProps.onLoad).
|
|
942
|
+
expect(initialProps.onLoad).toHaveBeenCalled();
|
|
966
943
|
return [4 /*yield*/, (0, test_utils_1.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
967
944
|
return __generator(this, function (_a) {
|
|
968
945
|
resolveSuccess([{ index: 0, successful: true, object: {} }]);
|
|
@@ -971,8 +948,8 @@ describe('useAttributeActions', function () {
|
|
|
971
948
|
}); })];
|
|
972
949
|
case 1:
|
|
973
950
|
_a.sent();
|
|
974
|
-
expect(initialProps.onSuccess).
|
|
975
|
-
|
|
951
|
+
expect(initialProps.onSuccess).toHaveBeenCalled();
|
|
952
|
+
createAttributeAction({ attributeValue: attributeValue, crosswalk: crosswalk });
|
|
976
953
|
return [4 /*yield*/, (0, test_utils_1.act)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
977
954
|
return __generator(this, function (_a) {
|
|
978
955
|
resolveError();
|
|
@@ -981,7 +958,7 @@ describe('useAttributeActions', function () {
|
|
|
981
958
|
}); })];
|
|
982
959
|
case 2:
|
|
983
960
|
_a.sent();
|
|
984
|
-
expect(initialProps.onError).
|
|
961
|
+
expect(initialProps.onError).toHaveBeenCalledWith({ errorMessage: 'Some error' });
|
|
985
962
|
return [2 /*return*/];
|
|
986
963
|
}
|
|
987
964
|
});
|