@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
|
@@ -48,7 +48,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
48
48
|
import { useAttributeActions } from './useAttributeActions';
|
|
49
49
|
import { act } from 'react-dom/test-utils';
|
|
50
50
|
import { renderHook } from '@testing-library/react-hooks';
|
|
51
|
-
import
|
|
51
|
+
import { createAttribute, entityCumulativeDelete, entityCumulativeUpdate, ignoreAttribute, pinAttribute, removeRelation, updateAttribute } from '@reltio/mdm-sdk';
|
|
52
52
|
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() })); });
|
|
53
53
|
describe('useAttributeActions', function () {
|
|
54
54
|
var initialProps = {
|
|
@@ -60,43 +60,43 @@ describe('useAttributeActions', function () {
|
|
|
60
60
|
return renderHook(useAttributeActions, { initialProps: initialProps }).result.current;
|
|
61
61
|
};
|
|
62
62
|
var resolveSuccess, resolveError;
|
|
63
|
-
|
|
63
|
+
entityCumulativeDelete.mockImplementation(function () {
|
|
64
64
|
return new Promise(function (_resolve, _reject) {
|
|
65
65
|
resolveSuccess = function () { return _resolve({ uri: 'entities/1', type: 'configuration/entityTypes/HCP' }); };
|
|
66
66
|
resolveError = function () { return _reject({ errorMessage: 'Some error' }); };
|
|
67
67
|
});
|
|
68
68
|
});
|
|
69
|
-
|
|
69
|
+
entityCumulativeUpdate.mockImplementation(function () {
|
|
70
70
|
return new Promise(function (_resolve, _reject) {
|
|
71
71
|
resolveSuccess = function () { return _resolve({ uri: 'relations/03xNaHt', type: 'configuration/relationTypes/HCPtoHCA' }); };
|
|
72
72
|
resolveError = function () { return _reject({ errorMessage: 'Some error' }); };
|
|
73
73
|
});
|
|
74
74
|
});
|
|
75
|
-
|
|
75
|
+
removeRelation.mockImplementation(function () {
|
|
76
76
|
return new Promise(function (_resolve, _reject) {
|
|
77
77
|
resolveSuccess = function () { return _resolve({ status: 'success' }); };
|
|
78
78
|
resolveError = function () { return _reject({ errorMessage: 'Some error' }); };
|
|
79
79
|
});
|
|
80
80
|
});
|
|
81
|
-
|
|
81
|
+
ignoreAttribute.mockImplementation(function () {
|
|
82
82
|
return new Promise(function (_resolve, _reject) {
|
|
83
83
|
resolveSuccess = function (attributeValue) { return _resolve(attributeValue); };
|
|
84
84
|
resolveError = function () { return _reject({ errorMessage: 'Some error' }); };
|
|
85
85
|
});
|
|
86
86
|
});
|
|
87
|
-
|
|
87
|
+
pinAttribute.mockImplementation(function () {
|
|
88
88
|
return new Promise(function (_resolve, _reject) {
|
|
89
89
|
resolveSuccess = function (attributeValue) { return _resolve(attributeValue); };
|
|
90
90
|
resolveError = function () { return _reject({ errorMessage: 'Some error' }); };
|
|
91
91
|
});
|
|
92
92
|
});
|
|
93
|
-
|
|
93
|
+
updateAttribute.mockImplementation(function () {
|
|
94
94
|
return new Promise(function (_resolve, _reject) {
|
|
95
95
|
resolveSuccess = function (attributeValue) { return _resolve(attributeValue); };
|
|
96
96
|
resolveError = function () { return _reject({ errorMessage: 'Some error' }); };
|
|
97
97
|
});
|
|
98
98
|
});
|
|
99
|
-
|
|
99
|
+
createAttribute.mockImplementation(function () {
|
|
100
100
|
return new Promise(function (_resolve, _reject) {
|
|
101
101
|
resolveSuccess = function (attributeValue) { return _resolve(attributeValue); };
|
|
102
102
|
resolveError = function () { return _reject({ errorMessage: 'Some error' }); };
|
|
@@ -154,8 +154,8 @@ describe('useAttributeActions', function () {
|
|
|
154
154
|
]
|
|
155
155
|
};
|
|
156
156
|
deleteAttribute(deleteEvent);
|
|
157
|
-
expect(
|
|
158
|
-
expect(initialProps.onLoad).
|
|
157
|
+
expect(entityCumulativeDelete).toHaveBeenCalledWith(requestParams);
|
|
158
|
+
expect(initialProps.onLoad).toHaveBeenCalled();
|
|
159
159
|
return [4 /*yield*/, act(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
160
160
|
return __generator(this, function (_a) {
|
|
161
161
|
resolveSuccess();
|
|
@@ -164,9 +164,9 @@ describe('useAttributeActions', function () {
|
|
|
164
164
|
}); })];
|
|
165
165
|
case 1:
|
|
166
166
|
_a.sent();
|
|
167
|
-
expect(initialProps.onSuccess).
|
|
167
|
+
expect(initialProps.onSuccess).toHaveBeenCalled();
|
|
168
168
|
deleteAttribute(deleteEvent);
|
|
169
|
-
expect(
|
|
169
|
+
expect(entityCumulativeDelete).toHaveBeenCalledWith(requestParams);
|
|
170
170
|
return [4 /*yield*/, act(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
171
171
|
return __generator(this, function (_a) {
|
|
172
172
|
resolveError();
|
|
@@ -175,7 +175,7 @@ describe('useAttributeActions', function () {
|
|
|
175
175
|
}); })];
|
|
176
176
|
case 2:
|
|
177
177
|
_a.sent();
|
|
178
|
-
expect(initialProps.onError).
|
|
178
|
+
expect(initialProps.onError).toHaveBeenCalledWith({ errorMessage: 'Some error' });
|
|
179
179
|
return [2 /*return*/];
|
|
180
180
|
}
|
|
181
181
|
});
|
|
@@ -253,8 +253,8 @@ describe('useAttributeActions', function () {
|
|
|
253
253
|
]
|
|
254
254
|
};
|
|
255
255
|
deleteAttribute(deleteEvent);
|
|
256
|
-
expect(
|
|
257
|
-
expect(initialProps.onLoad).
|
|
256
|
+
expect(entityCumulativeDelete).toHaveBeenCalledWith(requestParams);
|
|
257
|
+
expect(initialProps.onLoad).toHaveBeenCalled();
|
|
258
258
|
return [4 /*yield*/, act(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
259
259
|
return __generator(this, function (_a) {
|
|
260
260
|
resolveSuccess();
|
|
@@ -263,9 +263,9 @@ describe('useAttributeActions', function () {
|
|
|
263
263
|
}); })];
|
|
264
264
|
case 1:
|
|
265
265
|
_a.sent();
|
|
266
|
-
expect(initialProps.onSuccess).
|
|
266
|
+
expect(initialProps.onSuccess).toHaveBeenCalled();
|
|
267
267
|
deleteAttribute(deleteEvent);
|
|
268
|
-
expect(
|
|
268
|
+
expect(entityCumulativeDelete).toHaveBeenCalledWith(requestParams);
|
|
269
269
|
return [4 /*yield*/, act(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
270
270
|
return __generator(this, function (_a) {
|
|
271
271
|
resolveError();
|
|
@@ -274,7 +274,7 @@ describe('useAttributeActions', function () {
|
|
|
274
274
|
}); })];
|
|
275
275
|
case 2:
|
|
276
276
|
_a.sent();
|
|
277
|
-
expect(initialProps.onError).
|
|
277
|
+
expect(initialProps.onError).toHaveBeenCalledWith({ errorMessage: 'Some error' });
|
|
278
278
|
return [2 /*return*/];
|
|
279
279
|
}
|
|
280
280
|
});
|
|
@@ -369,8 +369,8 @@ describe('useAttributeActions', function () {
|
|
|
369
369
|
]
|
|
370
370
|
};
|
|
371
371
|
deleteAttribute(deleteEvent);
|
|
372
|
-
expect(
|
|
373
|
-
expect(initialProps.onLoad).
|
|
372
|
+
expect(removeRelation).toHaveBeenCalledWith('relations/1');
|
|
373
|
+
expect(initialProps.onLoad).toHaveBeenCalled();
|
|
374
374
|
return [4 /*yield*/, act(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
375
375
|
return __generator(this, function (_a) {
|
|
376
376
|
resolveSuccess();
|
|
@@ -379,9 +379,9 @@ describe('useAttributeActions', function () {
|
|
|
379
379
|
}); })];
|
|
380
380
|
case 1:
|
|
381
381
|
_a.sent();
|
|
382
|
-
expect(initialProps.onSuccess).
|
|
382
|
+
expect(initialProps.onSuccess).toHaveBeenCalled();
|
|
383
383
|
deleteAttribute(deleteEvent);
|
|
384
|
-
expect(
|
|
384
|
+
expect(removeRelation).toHaveBeenCalledWith('relations/1');
|
|
385
385
|
return [4 /*yield*/, act(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
386
386
|
return __generator(this, function (_a) {
|
|
387
387
|
resolveError();
|
|
@@ -390,7 +390,7 @@ describe('useAttributeActions', function () {
|
|
|
390
390
|
}); })];
|
|
391
391
|
case 2:
|
|
392
392
|
_a.sent();
|
|
393
|
-
expect(initialProps.onError).
|
|
393
|
+
expect(initialProps.onError).toHaveBeenCalledWith({ errorMessage: 'Some error' });
|
|
394
394
|
return [2 /*return*/];
|
|
395
395
|
}
|
|
396
396
|
});
|
|
@@ -442,7 +442,7 @@ describe('useAttributeActions', function () {
|
|
|
442
442
|
],
|
|
443
443
|
uri: 'relations/03xNaHt'
|
|
444
444
|
};
|
|
445
|
-
expect(
|
|
445
|
+
expect(entityCumulativeUpdate).toHaveBeenCalledWith(requestParams);
|
|
446
446
|
expect(initialProps.onLoad).toHaveBeenCalled();
|
|
447
447
|
expect(initialProps.onSuccess).not.toHaveBeenCalled();
|
|
448
448
|
return [4 /*yield*/, act(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -455,7 +455,7 @@ describe('useAttributeActions', function () {
|
|
|
455
455
|
_a.sent();
|
|
456
456
|
expect(initialProps.onSuccess).toHaveBeenCalled();
|
|
457
457
|
deleteAttribute(deleteEvent);
|
|
458
|
-
expect(
|
|
458
|
+
expect(entityCumulativeUpdate).toHaveBeenCalledWith(requestParams);
|
|
459
459
|
expect(initialProps.onError).not.toHaveBeenCalled();
|
|
460
460
|
return [4 /*yield*/, act(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
461
461
|
return __generator(this, function (_a) {
|
|
@@ -471,11 +471,11 @@ describe('useAttributeActions', function () {
|
|
|
471
471
|
});
|
|
472
472
|
}); });
|
|
473
473
|
it('should return correct pin action for attribute', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
474
|
-
var
|
|
474
|
+
var pinAttributeAction, attributeValue;
|
|
475
475
|
return __generator(this, function (_a) {
|
|
476
476
|
switch (_a.label) {
|
|
477
477
|
case 0:
|
|
478
|
-
|
|
478
|
+
pinAttributeAction = getActions().pinAttribute;
|
|
479
479
|
attributeValue = {
|
|
480
480
|
uri: 'entities/1/attributes/CountryCode/1',
|
|
481
481
|
type: 'configuration/entityTypes/HCP/attributes/CountryCode',
|
|
@@ -483,12 +483,12 @@ describe('useAttributeActions', function () {
|
|
|
483
483
|
lookupCode: 'IT',
|
|
484
484
|
ov: true
|
|
485
485
|
};
|
|
486
|
-
|
|
487
|
-
expect(
|
|
486
|
+
pinAttributeAction({ attributeValue: attributeValue });
|
|
487
|
+
expect(pinAttribute).toHaveBeenCalledWith({
|
|
488
488
|
attributeUri: 'entities/1/attributes/CountryCode/1',
|
|
489
489
|
value: true
|
|
490
490
|
});
|
|
491
|
-
expect(initialProps.onLoad).
|
|
491
|
+
expect(initialProps.onLoad).toHaveBeenCalled();
|
|
492
492
|
return [4 /*yield*/, act(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
493
493
|
return __generator(this, function (_a) {
|
|
494
494
|
resolveSuccess(__assign(__assign({}, attributeValue), { pin: true }));
|
|
@@ -497,11 +497,11 @@ describe('useAttributeActions', function () {
|
|
|
497
497
|
}); })];
|
|
498
498
|
case 1:
|
|
499
499
|
_a.sent();
|
|
500
|
-
expect(initialProps.onSuccess).
|
|
501
|
-
|
|
500
|
+
expect(initialProps.onSuccess).toHaveBeenCalled();
|
|
501
|
+
pinAttributeAction({
|
|
502
502
|
attributeValue: __assign(__assign({}, attributeValue), { pin: true })
|
|
503
503
|
});
|
|
504
|
-
expect(
|
|
504
|
+
expect(pinAttribute).toHaveBeenCalledWith({
|
|
505
505
|
attributeUri: 'entities/1/attributes/CountryCode/1',
|
|
506
506
|
value: false
|
|
507
507
|
});
|
|
@@ -513,17 +513,17 @@ describe('useAttributeActions', function () {
|
|
|
513
513
|
}); })];
|
|
514
514
|
case 2:
|
|
515
515
|
_a.sent();
|
|
516
|
-
expect(initialProps.onError).
|
|
516
|
+
expect(initialProps.onError).toHaveBeenCalledWith({ errorMessage: 'Some error' });
|
|
517
517
|
return [2 /*return*/];
|
|
518
518
|
}
|
|
519
519
|
});
|
|
520
520
|
}); });
|
|
521
521
|
it('should return correct ignore action for attribute', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
522
|
-
var
|
|
522
|
+
var ignoreAttributeAction, attributeValue;
|
|
523
523
|
return __generator(this, function (_a) {
|
|
524
524
|
switch (_a.label) {
|
|
525
525
|
case 0:
|
|
526
|
-
|
|
526
|
+
ignoreAttributeAction = getActions().ignoreAttribute;
|
|
527
527
|
attributeValue = {
|
|
528
528
|
uri: 'entities/1/attributes/CountryCode/1',
|
|
529
529
|
type: 'configuration/entityTypes/HCP/attributes/CountryCode',
|
|
@@ -531,12 +531,12 @@ describe('useAttributeActions', function () {
|
|
|
531
531
|
lookupCode: 'IT',
|
|
532
532
|
ov: true
|
|
533
533
|
};
|
|
534
|
-
|
|
535
|
-
expect(
|
|
534
|
+
ignoreAttributeAction({ attributeValue: attributeValue });
|
|
535
|
+
expect(ignoreAttribute).toHaveBeenCalledWith({
|
|
536
536
|
attributeUri: 'entities/1/attributes/CountryCode/1',
|
|
537
537
|
value: true
|
|
538
538
|
});
|
|
539
|
-
expect(initialProps.onLoad).
|
|
539
|
+
expect(initialProps.onLoad).toHaveBeenCalled();
|
|
540
540
|
return [4 /*yield*/, act(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
541
541
|
return __generator(this, function (_a) {
|
|
542
542
|
resolveSuccess(__assign(__assign({}, attributeValue), { ignored: true }));
|
|
@@ -545,11 +545,11 @@ describe('useAttributeActions', function () {
|
|
|
545
545
|
}); })];
|
|
546
546
|
case 1:
|
|
547
547
|
_a.sent();
|
|
548
|
-
expect(initialProps.onSuccess).
|
|
549
|
-
|
|
548
|
+
expect(initialProps.onSuccess).toHaveBeenCalled();
|
|
549
|
+
ignoreAttributeAction({
|
|
550
550
|
attributeValue: __assign(__assign({}, attributeValue), { ignored: true })
|
|
551
551
|
});
|
|
552
|
-
expect(
|
|
552
|
+
expect(ignoreAttribute).toHaveBeenCalledWith({
|
|
553
553
|
attributeUri: 'entities/1/attributes/CountryCode/1',
|
|
554
554
|
value: false
|
|
555
555
|
});
|
|
@@ -561,17 +561,17 @@ describe('useAttributeActions', function () {
|
|
|
561
561
|
}); })];
|
|
562
562
|
case 2:
|
|
563
563
|
_a.sent();
|
|
564
|
-
expect(initialProps.onError).
|
|
564
|
+
expect(initialProps.onError).toHaveBeenCalledWith({ errorMessage: 'Some error' });
|
|
565
565
|
return [2 /*return*/];
|
|
566
566
|
}
|
|
567
567
|
});
|
|
568
568
|
}); });
|
|
569
569
|
it('should return correct update action for not lookup attribute', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
570
|
-
var
|
|
570
|
+
var updateAttributeAction, editEvent;
|
|
571
571
|
return __generator(this, function (_a) {
|
|
572
572
|
switch (_a.label) {
|
|
573
573
|
case 0:
|
|
574
|
-
|
|
574
|
+
updateAttributeAction = getActions().updateAttribute;
|
|
575
575
|
editEvent = {
|
|
576
576
|
attributeValue: {
|
|
577
577
|
uri: 'entities/1/attributes/AddressLine/1',
|
|
@@ -596,14 +596,14 @@ describe('useAttributeActions', function () {
|
|
|
596
596
|
}
|
|
597
597
|
}
|
|
598
598
|
};
|
|
599
|
-
|
|
600
|
-
expect(
|
|
599
|
+
updateAttributeAction(editEvent);
|
|
600
|
+
expect(updateAttribute).toHaveBeenCalledWith({
|
|
601
601
|
attributeUri: 'entities/1/attributes/AddressLine/1',
|
|
602
602
|
sourceUri: 'configuration/sources/Reltio',
|
|
603
603
|
crosswalkValue: 'nQpZyQt',
|
|
604
604
|
value: 'Pushkina 1'
|
|
605
605
|
});
|
|
606
|
-
expect(initialProps.onLoad).
|
|
606
|
+
expect(initialProps.onLoad).toHaveBeenCalled();
|
|
607
607
|
return [4 /*yield*/, act(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
608
608
|
return __generator(this, function (_a) {
|
|
609
609
|
resolveSuccess(__assign({}, editEvent.attributeValue));
|
|
@@ -612,11 +612,11 @@ describe('useAttributeActions', function () {
|
|
|
612
612
|
}); })];
|
|
613
613
|
case 1:
|
|
614
614
|
_a.sent();
|
|
615
|
-
expect(
|
|
616
|
-
expect(
|
|
617
|
-
expect(initialProps.onSuccess).
|
|
618
|
-
|
|
619
|
-
expect(
|
|
615
|
+
expect(pinAttribute).not.toHaveBeenCalled();
|
|
616
|
+
expect(ignoreAttribute).not.toHaveBeenCalled();
|
|
617
|
+
expect(initialProps.onSuccess).toHaveBeenCalled();
|
|
618
|
+
updateAttributeAction(editEvent);
|
|
619
|
+
expect(updateAttribute).toHaveBeenCalledWith({
|
|
620
620
|
attributeUri: 'entities/1/attributes/AddressLine/1',
|
|
621
621
|
sourceUri: 'configuration/sources/Reltio',
|
|
622
622
|
crosswalkValue: 'nQpZyQt',
|
|
@@ -630,17 +630,17 @@ describe('useAttributeActions', function () {
|
|
|
630
630
|
}); })];
|
|
631
631
|
case 2:
|
|
632
632
|
_a.sent();
|
|
633
|
-
expect(initialProps.onError).
|
|
633
|
+
expect(initialProps.onError).toHaveBeenCalledWith({ errorMessage: 'Some error' });
|
|
634
634
|
return [2 /*return*/];
|
|
635
635
|
}
|
|
636
636
|
});
|
|
637
637
|
}); });
|
|
638
638
|
it('should keep ignored flag on attribute update', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
639
|
-
var
|
|
639
|
+
var updateAttributeAction, editEvent;
|
|
640
640
|
return __generator(this, function (_a) {
|
|
641
641
|
switch (_a.label) {
|
|
642
642
|
case 0:
|
|
643
|
-
|
|
643
|
+
updateAttributeAction = getActions().updateAttribute;
|
|
644
644
|
editEvent = {
|
|
645
645
|
attributeValue: {
|
|
646
646
|
uri: 'entities/1/attributes/AddressLine/1',
|
|
@@ -666,15 +666,15 @@ describe('useAttributeActions', function () {
|
|
|
666
666
|
}
|
|
667
667
|
}
|
|
668
668
|
};
|
|
669
|
-
|
|
670
|
-
expect(
|
|
669
|
+
updateAttributeAction(editEvent);
|
|
670
|
+
expect(updateAttribute).toHaveBeenCalledWith({
|
|
671
671
|
attributeUri: 'entities/1/attributes/AddressLine/1',
|
|
672
672
|
sourceUri: 'configuration/sources/Reltio',
|
|
673
673
|
crosswalkValue: 'nQpZyQt',
|
|
674
674
|
value: 'Pushkina 1'
|
|
675
675
|
});
|
|
676
|
-
expect(
|
|
677
|
-
expect(initialProps.onLoad).
|
|
676
|
+
expect(pinAttribute).not.toHaveBeenCalled();
|
|
677
|
+
expect(initialProps.onLoad).toHaveBeenCalled();
|
|
678
678
|
return [4 /*yield*/, act(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
679
679
|
return __generator(this, function (_a) {
|
|
680
680
|
resolveSuccess(__assign({}, editEvent.attributeValue));
|
|
@@ -683,7 +683,7 @@ describe('useAttributeActions', function () {
|
|
|
683
683
|
}); })];
|
|
684
684
|
case 1:
|
|
685
685
|
_a.sent();
|
|
686
|
-
expect(
|
|
686
|
+
expect(ignoreAttribute).toHaveBeenCalledWith({
|
|
687
687
|
attributeUri: 'entities/1/attributes/AddressLine/1',
|
|
688
688
|
value: true
|
|
689
689
|
});
|
|
@@ -695,17 +695,17 @@ describe('useAttributeActions', function () {
|
|
|
695
695
|
}); })];
|
|
696
696
|
case 2:
|
|
697
697
|
_a.sent();
|
|
698
|
-
expect(initialProps.onSuccess).
|
|
698
|
+
expect(initialProps.onSuccess).toHaveBeenCalled();
|
|
699
699
|
return [2 /*return*/];
|
|
700
700
|
}
|
|
701
701
|
});
|
|
702
702
|
}); });
|
|
703
703
|
it('should return correct update action for lookup attribute', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
704
|
-
var
|
|
704
|
+
var updateAttributeAction, editEvent;
|
|
705
705
|
return __generator(this, function (_a) {
|
|
706
706
|
switch (_a.label) {
|
|
707
707
|
case 0:
|
|
708
|
-
|
|
708
|
+
updateAttributeAction = getActions().updateAttribute;
|
|
709
709
|
editEvent = {
|
|
710
710
|
attributeValue: {
|
|
711
711
|
uri: 'entities/1/attributes/CountryCode/1',
|
|
@@ -732,14 +732,14 @@ describe('useAttributeActions', function () {
|
|
|
732
732
|
}
|
|
733
733
|
}
|
|
734
734
|
};
|
|
735
|
-
|
|
736
|
-
expect(
|
|
735
|
+
updateAttributeAction(editEvent);
|
|
736
|
+
expect(updateAttribute).toHaveBeenCalledWith({
|
|
737
737
|
attributeUri: 'entities/1/attributes/CountryCode/1',
|
|
738
738
|
sourceUri: 'configuration/sources/Reltio',
|
|
739
739
|
crosswalkValue: 'nQpZyQt',
|
|
740
740
|
value: 'IT'
|
|
741
741
|
});
|
|
742
|
-
expect(initialProps.onLoad).
|
|
742
|
+
expect(initialProps.onLoad).toHaveBeenCalled();
|
|
743
743
|
return [4 /*yield*/, act(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
744
744
|
return __generator(this, function (_a) {
|
|
745
745
|
resolveSuccess(__assign({}, editEvent.attributeValue));
|
|
@@ -748,9 +748,9 @@ describe('useAttributeActions', function () {
|
|
|
748
748
|
}); })];
|
|
749
749
|
case 1:
|
|
750
750
|
_a.sent();
|
|
751
|
-
expect(initialProps.onSuccess).
|
|
752
|
-
|
|
753
|
-
expect(
|
|
751
|
+
expect(initialProps.onSuccess).toHaveBeenCalled();
|
|
752
|
+
updateAttributeAction(editEvent);
|
|
753
|
+
expect(updateAttribute).toHaveBeenCalledWith({
|
|
754
754
|
attributeUri: 'entities/1/attributes/CountryCode/1',
|
|
755
755
|
sourceUri: 'configuration/sources/Reltio',
|
|
756
756
|
crosswalkValue: 'nQpZyQt',
|
|
@@ -764,17 +764,17 @@ describe('useAttributeActions', function () {
|
|
|
764
764
|
}); })];
|
|
765
765
|
case 2:
|
|
766
766
|
_a.sent();
|
|
767
|
-
expect(initialProps.onError).
|
|
767
|
+
expect(initialProps.onError).toHaveBeenCalledWith({ errorMessage: 'Some error' });
|
|
768
768
|
return [2 /*return*/];
|
|
769
769
|
}
|
|
770
770
|
});
|
|
771
771
|
}); });
|
|
772
772
|
it('should return correct create action for not lookup attribute', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
773
|
-
var
|
|
773
|
+
var createAttributeAction, attributeValue, crosswalk;
|
|
774
774
|
return __generator(this, function (_a) {
|
|
775
775
|
switch (_a.label) {
|
|
776
776
|
case 0:
|
|
777
|
-
|
|
777
|
+
createAttributeAction = getActions().createAttribute;
|
|
778
778
|
attributeValue = {
|
|
779
779
|
uri: 'entities/1/attributes/CountryCode/$$$uri1',
|
|
780
780
|
type: 'configuration/entityTypes/HCP/attributes/CountryCode',
|
|
@@ -793,15 +793,15 @@ describe('useAttributeActions', function () {
|
|
|
793
793
|
'entities/1/attributes/Date/1': '2018-11-29T05:39:56.445Z'
|
|
794
794
|
}
|
|
795
795
|
};
|
|
796
|
-
|
|
797
|
-
expect(
|
|
796
|
+
createAttributeAction({ attributeValue: attributeValue, crosswalk: crosswalk });
|
|
797
|
+
expect(createAttribute).toHaveBeenCalledWith({
|
|
798
798
|
attributeUri: 'entities/1/attributes/CountryCode/$$$uri1',
|
|
799
799
|
sourceUri: 'configuration/sources/Reltio',
|
|
800
800
|
crosswalkValue: 'nQpZyQt',
|
|
801
801
|
crosswalkSourceTable: undefined,
|
|
802
802
|
value: 'Italy'
|
|
803
803
|
});
|
|
804
|
-
expect(initialProps.onLoad).
|
|
804
|
+
expect(initialProps.onLoad).toHaveBeenCalled();
|
|
805
805
|
return [4 /*yield*/, act(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
806
806
|
return __generator(this, function (_a) {
|
|
807
807
|
resolveSuccess([{ index: 0, successful: true, object: {} }]);
|
|
@@ -810,8 +810,8 @@ describe('useAttributeActions', function () {
|
|
|
810
810
|
}); })];
|
|
811
811
|
case 1:
|
|
812
812
|
_a.sent();
|
|
813
|
-
expect(initialProps.onSuccess).
|
|
814
|
-
|
|
813
|
+
expect(initialProps.onSuccess).toHaveBeenCalled();
|
|
814
|
+
createAttributeAction({ attributeValue: attributeValue, crosswalk: crosswalk });
|
|
815
815
|
return [4 /*yield*/, act(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
816
816
|
return __generator(this, function (_a) {
|
|
817
817
|
resolveError();
|
|
@@ -820,17 +820,17 @@ describe('useAttributeActions', function () {
|
|
|
820
820
|
}); })];
|
|
821
821
|
case 2:
|
|
822
822
|
_a.sent();
|
|
823
|
-
expect(initialProps.onError).
|
|
823
|
+
expect(initialProps.onError).toHaveBeenCalledWith({ errorMessage: 'Some error' });
|
|
824
824
|
return [2 /*return*/];
|
|
825
825
|
}
|
|
826
826
|
});
|
|
827
827
|
}); });
|
|
828
828
|
it('should return correct create action for lookup attribute', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
829
|
-
var
|
|
829
|
+
var createAttributeAction, attributeValue, crosswalk;
|
|
830
830
|
return __generator(this, function (_a) {
|
|
831
831
|
switch (_a.label) {
|
|
832
832
|
case 0:
|
|
833
|
-
|
|
833
|
+
createAttributeAction = getActions().createAttribute;
|
|
834
834
|
attributeValue = {
|
|
835
835
|
uri: 'entities/1/attributes/CountryCode/$$$uri1',
|
|
836
836
|
type: 'configuration/entityTypes/HCP/attributes/CountryCode',
|
|
@@ -850,15 +850,15 @@ describe('useAttributeActions', function () {
|
|
|
850
850
|
'entities/1/attributes/Date/1': '2018-11-29T05:39:56.445Z'
|
|
851
851
|
}
|
|
852
852
|
};
|
|
853
|
-
|
|
854
|
-
expect(
|
|
853
|
+
createAttributeAction({ attributeValue: attributeValue, crosswalk: crosswalk });
|
|
854
|
+
expect(createAttribute).toHaveBeenCalledWith({
|
|
855
855
|
attributeUri: 'entities/1/attributes/CountryCode/$$$uri1',
|
|
856
856
|
sourceUri: 'configuration/sources/Reltio',
|
|
857
857
|
crosswalkValue: 'nQpZyQt',
|
|
858
858
|
crosswalkSourceTable: undefined,
|
|
859
859
|
value: 'IT'
|
|
860
860
|
});
|
|
861
|
-
expect(initialProps.onLoad).
|
|
861
|
+
expect(initialProps.onLoad).toHaveBeenCalled();
|
|
862
862
|
return [4 /*yield*/, act(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
863
863
|
return __generator(this, function (_a) {
|
|
864
864
|
resolveSuccess([{ index: 0, successful: true, object: {} }]);
|
|
@@ -867,8 +867,8 @@ describe('useAttributeActions', function () {
|
|
|
867
867
|
}); })];
|
|
868
868
|
case 1:
|
|
869
869
|
_a.sent();
|
|
870
|
-
expect(initialProps.onSuccess).
|
|
871
|
-
|
|
870
|
+
expect(initialProps.onSuccess).toHaveBeenCalled();
|
|
871
|
+
createAttributeAction({ attributeValue: attributeValue, crosswalk: crosswalk });
|
|
872
872
|
return [4 /*yield*/, act(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
873
873
|
return __generator(this, function (_a) {
|
|
874
874
|
resolveError();
|
|
@@ -877,17 +877,17 @@ describe('useAttributeActions', function () {
|
|
|
877
877
|
}); })];
|
|
878
878
|
case 2:
|
|
879
879
|
_a.sent();
|
|
880
|
-
expect(initialProps.onError).
|
|
880
|
+
expect(initialProps.onError).toHaveBeenCalledWith({ errorMessage: 'Some error' });
|
|
881
881
|
return [2 /*return*/];
|
|
882
882
|
}
|
|
883
883
|
});
|
|
884
884
|
}); });
|
|
885
885
|
it('should return correct create action for lookup attribute inside nested', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
886
|
-
var
|
|
886
|
+
var createAttributeAction, attributeValue, crosswalk;
|
|
887
887
|
return __generator(this, function (_a) {
|
|
888
888
|
switch (_a.label) {
|
|
889
889
|
case 0:
|
|
890
|
-
|
|
890
|
+
createAttributeAction = getActions().createAttribute;
|
|
891
891
|
attributeValue = {
|
|
892
892
|
value: {
|
|
893
893
|
CountryCode: [
|
|
@@ -920,8 +920,8 @@ describe('useAttributeActions', function () {
|
|
|
920
920
|
'entities/03caeDZ/attributes/CountryCode/og2irm1': '2024-03-21T10:31:37.206Z'
|
|
921
921
|
}
|
|
922
922
|
};
|
|
923
|
-
|
|
924
|
-
expect(
|
|
923
|
+
createAttributeAction({ attributeValue: attributeValue, crosswalk: crosswalk });
|
|
924
|
+
expect(createAttribute).toHaveBeenCalledWith({
|
|
925
925
|
attributeUri: 'entities/03caeDZ/attributes/UseCase1/uri$$K6aSzmeM8knmWyNT1711463312035',
|
|
926
926
|
sourceUri: 'configuration/sources/Reltio',
|
|
927
927
|
crosswalkValue: '03caeDZ',
|
|
@@ -937,7 +937,7 @@ describe('useAttributeActions', function () {
|
|
|
937
937
|
]
|
|
938
938
|
}
|
|
939
939
|
});
|
|
940
|
-
expect(initialProps.onLoad).
|
|
940
|
+
expect(initialProps.onLoad).toHaveBeenCalled();
|
|
941
941
|
return [4 /*yield*/, act(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
942
942
|
return __generator(this, function (_a) {
|
|
943
943
|
resolveSuccess([{ index: 0, successful: true, object: {} }]);
|
|
@@ -946,8 +946,8 @@ describe('useAttributeActions', function () {
|
|
|
946
946
|
}); })];
|
|
947
947
|
case 1:
|
|
948
948
|
_a.sent();
|
|
949
|
-
expect(initialProps.onSuccess).
|
|
950
|
-
|
|
949
|
+
expect(initialProps.onSuccess).toHaveBeenCalled();
|
|
950
|
+
createAttributeAction({ attributeValue: attributeValue, crosswalk: crosswalk });
|
|
951
951
|
return [4 /*yield*/, act(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
952
952
|
return __generator(this, function (_a) {
|
|
953
953
|
resolveError();
|
|
@@ -956,7 +956,7 @@ describe('useAttributeActions', function () {
|
|
|
956
956
|
}); })];
|
|
957
957
|
case 2:
|
|
958
958
|
_a.sent();
|
|
959
|
-
expect(initialProps.onError).
|
|
959
|
+
expect(initialProps.onError).toHaveBeenCalledWith({ errorMessage: 'Some error' });
|
|
960
960
|
return [2 /*return*/];
|
|
961
961
|
}
|
|
962
962
|
});
|