@reltio/components 1.4.1945 → 1.4.1946
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/useSnackbar/useSnackbar.test.js +24 -17
- 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/useSnackbar/useSnackbar.test.js +25 -18
- package/package.json +2 -2
|
@@ -48,7 +48,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
48
48
|
import { useCrosswalkActions } from './useCrosswalkActions';
|
|
49
49
|
import { act } from 'react-dom/test-utils';
|
|
50
50
|
import { renderHook } from '@testing-library/react-hooks';
|
|
51
|
-
import
|
|
51
|
+
import { addCrosswalk, addCrosswalkInContributor, editCrosswalkAttribute, deleteCrosswalkAttribute, deleteCrosswalk } from '@reltio/mdm-sdk';
|
|
52
52
|
jest.mock('@reltio/mdm-sdk', function () { return (__assign(__assign({}, jest.requireActual('@reltio/mdm-sdk')), { addCrosswalk: jest.fn(), addCrosswalkInContributor: jest.fn(), editCrosswalkAttribute: jest.fn(), deleteCrosswalkAttribute: jest.fn(), deleteCrosswalk: jest.fn() })); });
|
|
53
53
|
describe('useCrosswalkActions tests', function () {
|
|
54
54
|
var initialProps = {
|
|
@@ -63,7 +63,7 @@ describe('useCrosswalkActions tests', function () {
|
|
|
63
63
|
uri: 'entities/123',
|
|
64
64
|
type: 'configuration/entityTypes/HCP'
|
|
65
65
|
};
|
|
66
|
-
|
|
66
|
+
addCrosswalk.mockImplementation(function () {
|
|
67
67
|
return new Promise(function (_resolve) {
|
|
68
68
|
resolveSuccess = function () {
|
|
69
69
|
return _resolve([{ index: 0, object: { uri: 'relation/1', type: 'type', value: '1' }, successful: true }]);
|
|
@@ -73,7 +73,7 @@ describe('useCrosswalkActions tests', function () {
|
|
|
73
73
|
};
|
|
74
74
|
});
|
|
75
75
|
});
|
|
76
|
-
|
|
76
|
+
addCrosswalkInContributor.mockImplementation(function () {
|
|
77
77
|
return new Promise(function (_resolve) {
|
|
78
78
|
resolveSuccess = function () { return _resolve([{ index: 0, object: entity, successful: true }]); };
|
|
79
79
|
resolveError = function () {
|
|
@@ -81,7 +81,7 @@ describe('useCrosswalkActions tests', function () {
|
|
|
81
81
|
};
|
|
82
82
|
});
|
|
83
83
|
});
|
|
84
|
-
|
|
84
|
+
editCrosswalkAttribute.mockImplementation(function () {
|
|
85
85
|
return new Promise(function (_resolve) {
|
|
86
86
|
resolveSuccess = function () { return _resolve([{ index: 0, object: entity, successful: true }]); };
|
|
87
87
|
resolveError = function () {
|
|
@@ -89,7 +89,7 @@ describe('useCrosswalkActions tests', function () {
|
|
|
89
89
|
};
|
|
90
90
|
});
|
|
91
91
|
});
|
|
92
|
-
|
|
92
|
+
deleteCrosswalkAttribute.mockImplementation(function () {
|
|
93
93
|
return new Promise(function (_resolve) {
|
|
94
94
|
resolveSuccess = function () { return _resolve([{ index: 0, object: { status: 'success' }, successful: true }]); };
|
|
95
95
|
resolveError = function () {
|
|
@@ -97,18 +97,18 @@ describe('useCrosswalkActions tests', function () {
|
|
|
97
97
|
};
|
|
98
98
|
});
|
|
99
99
|
});
|
|
100
|
-
|
|
100
|
+
deleteCrosswalk.mockImplementation(function () {
|
|
101
101
|
return new Promise(function (_resolve, _reject) {
|
|
102
102
|
resolveSuccess = function () { return _resolve({ status: 'success' }); };
|
|
103
103
|
resolveError = function () { return _reject({ errorMessage: 'Operation failed with error' }); };
|
|
104
104
|
});
|
|
105
105
|
});
|
|
106
106
|
it('should return correct add action', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
107
|
-
var
|
|
107
|
+
var addCrosswalkAction, addEvent;
|
|
108
108
|
return __generator(this, function (_a) {
|
|
109
109
|
switch (_a.label) {
|
|
110
110
|
case 0:
|
|
111
|
-
|
|
111
|
+
addCrosswalkAction = getActions().addCrosswalk;
|
|
112
112
|
addEvent = {
|
|
113
113
|
entity: entity,
|
|
114
114
|
crosswalk: {
|
|
@@ -116,8 +116,8 @@ describe('useCrosswalkActions tests', function () {
|
|
|
116
116
|
value: 'test'
|
|
117
117
|
}
|
|
118
118
|
};
|
|
119
|
-
|
|
120
|
-
expect(
|
|
119
|
+
addCrosswalkAction(addEvent);
|
|
120
|
+
expect(addCrosswalk).toHaveBeenCalledWith({
|
|
121
121
|
entityUri: entity.uri,
|
|
122
122
|
crosswalk: addEvent.crosswalk
|
|
123
123
|
});
|
|
@@ -129,9 +129,9 @@ describe('useCrosswalkActions tests', function () {
|
|
|
129
129
|
}); })];
|
|
130
130
|
case 1:
|
|
131
131
|
_a.sent();
|
|
132
|
-
expect(initialProps.onSuccess).
|
|
133
|
-
|
|
134
|
-
expect(
|
|
132
|
+
expect(initialProps.onSuccess).toHaveBeenCalled();
|
|
133
|
+
addCrosswalkAction(addEvent);
|
|
134
|
+
expect(addCrosswalk).toHaveBeenCalledWith({
|
|
135
135
|
entityUri: entity.uri,
|
|
136
136
|
crosswalk: addEvent.crosswalk
|
|
137
137
|
});
|
|
@@ -143,17 +143,17 @@ describe('useCrosswalkActions tests', function () {
|
|
|
143
143
|
}); })];
|
|
144
144
|
case 2:
|
|
145
145
|
_a.sent();
|
|
146
|
-
expect(initialProps.onError).
|
|
146
|
+
expect(initialProps.onError).toHaveBeenCalledWith({ errorMessage: 'Operation failed with error' });
|
|
147
147
|
return [2 /*return*/];
|
|
148
148
|
}
|
|
149
149
|
});
|
|
150
150
|
}); });
|
|
151
151
|
it('should return correct add in contributor action', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
152
|
-
var
|
|
152
|
+
var addCrosswalkAction, addInContributorEvent;
|
|
153
153
|
return __generator(this, function (_a) {
|
|
154
154
|
switch (_a.label) {
|
|
155
155
|
case 0:
|
|
156
|
-
|
|
156
|
+
addCrosswalkAction = getActions().addCrosswalk;
|
|
157
157
|
addInContributorEvent = {
|
|
158
158
|
entity: entity,
|
|
159
159
|
contributorCrosswalk: {
|
|
@@ -169,8 +169,8 @@ describe('useCrosswalkActions tests', function () {
|
|
|
169
169
|
deleteDate: '123'
|
|
170
170
|
}
|
|
171
171
|
};
|
|
172
|
-
|
|
173
|
-
expect(
|
|
172
|
+
addCrosswalkAction(addInContributorEvent);
|
|
173
|
+
expect(addCrosswalkInContributor).toHaveBeenCalledWith({
|
|
174
174
|
entityTypeUri: entity.type,
|
|
175
175
|
contributorCrosswalkType: addInContributorEvent.contributorCrosswalk.type,
|
|
176
176
|
contributorCrosswalkValue: addInContributorEvent.contributorCrosswalk.value,
|
|
@@ -188,9 +188,9 @@ describe('useCrosswalkActions tests', function () {
|
|
|
188
188
|
}); })];
|
|
189
189
|
case 1:
|
|
190
190
|
_a.sent();
|
|
191
|
-
expect(initialProps.onSuccess).
|
|
192
|
-
|
|
193
|
-
expect(
|
|
191
|
+
expect(initialProps.onSuccess).toHaveBeenCalled();
|
|
192
|
+
addCrosswalkAction(addInContributorEvent);
|
|
193
|
+
expect(addCrosswalkInContributor).toHaveBeenCalledWith({
|
|
194
194
|
entityTypeUri: entity.type,
|
|
195
195
|
contributorCrosswalkType: addInContributorEvent.contributorCrosswalk.type,
|
|
196
196
|
contributorCrosswalkValue: addInContributorEvent.contributorCrosswalk.value,
|
|
@@ -208,7 +208,7 @@ describe('useCrosswalkActions tests', function () {
|
|
|
208
208
|
}); })];
|
|
209
209
|
case 2:
|
|
210
210
|
_a.sent();
|
|
211
|
-
expect(initialProps.onError).
|
|
211
|
+
expect(initialProps.onError).toHaveBeenCalledWith({ errorMessage: 'Operation failed with error' });
|
|
212
212
|
return [2 /*return*/];
|
|
213
213
|
}
|
|
214
214
|
});
|
|
@@ -226,7 +226,7 @@ describe('useCrosswalkActions tests', function () {
|
|
|
226
226
|
value: '1631905200000'
|
|
227
227
|
};
|
|
228
228
|
editCrosswalk(editEvent);
|
|
229
|
-
expect(
|
|
229
|
+
expect(editCrosswalkAttribute).toHaveBeenCalledWith(editEvent);
|
|
230
230
|
return [4 /*yield*/, act(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
231
231
|
return __generator(this, function (_a) {
|
|
232
232
|
resolveSuccess();
|
|
@@ -235,9 +235,9 @@ describe('useCrosswalkActions tests', function () {
|
|
|
235
235
|
}); })];
|
|
236
236
|
case 1:
|
|
237
237
|
_a.sent();
|
|
238
|
-
expect(initialProps.onSuccess).
|
|
238
|
+
expect(initialProps.onSuccess).toHaveBeenCalled();
|
|
239
239
|
editCrosswalk(editEvent);
|
|
240
|
-
expect(
|
|
240
|
+
expect(editCrosswalkAttribute).toHaveBeenCalledWith(editEvent);
|
|
241
241
|
return [4 /*yield*/, act(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
242
242
|
return __generator(this, function (_a) {
|
|
243
243
|
resolveError();
|
|
@@ -246,7 +246,7 @@ describe('useCrosswalkActions tests', function () {
|
|
|
246
246
|
}); })];
|
|
247
247
|
case 2:
|
|
248
248
|
_a.sent();
|
|
249
|
-
expect(initialProps.onError).
|
|
249
|
+
expect(initialProps.onError).toHaveBeenCalledWith({ errorMessage: 'Operation failed with error' });
|
|
250
250
|
return [2 /*return*/];
|
|
251
251
|
}
|
|
252
252
|
});
|
|
@@ -263,7 +263,7 @@ describe('useCrosswalkActions tests', function () {
|
|
|
263
263
|
attributeName: 'deleteDate'
|
|
264
264
|
};
|
|
265
265
|
editCrosswalk(deleteAttributeEvent);
|
|
266
|
-
expect(
|
|
266
|
+
expect(deleteCrosswalkAttribute).toHaveBeenCalledWith(deleteAttributeEvent);
|
|
267
267
|
return [4 /*yield*/, act(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
268
268
|
return __generator(this, function (_a) {
|
|
269
269
|
resolveSuccess();
|
|
@@ -272,9 +272,9 @@ describe('useCrosswalkActions tests', function () {
|
|
|
272
272
|
}); })];
|
|
273
273
|
case 1:
|
|
274
274
|
_a.sent();
|
|
275
|
-
expect(initialProps.onSuccess).
|
|
275
|
+
expect(initialProps.onSuccess).toHaveBeenCalled();
|
|
276
276
|
editCrosswalk(deleteAttributeEvent);
|
|
277
|
-
expect(
|
|
277
|
+
expect(deleteCrosswalkAttribute).toHaveBeenCalledWith(deleteAttributeEvent);
|
|
278
278
|
return [4 /*yield*/, act(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
279
279
|
return __generator(this, function (_a) {
|
|
280
280
|
resolveError();
|
|
@@ -283,23 +283,23 @@ describe('useCrosswalkActions tests', function () {
|
|
|
283
283
|
}); })];
|
|
284
284
|
case 2:
|
|
285
285
|
_a.sent();
|
|
286
|
-
expect(initialProps.onError).
|
|
286
|
+
expect(initialProps.onError).toHaveBeenCalledWith({ errorMessage: 'Operation failed with error' });
|
|
287
287
|
return [2 /*return*/];
|
|
288
288
|
}
|
|
289
289
|
});
|
|
290
290
|
}); });
|
|
291
291
|
it('should return correct delete crosswalk action', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
292
|
-
var
|
|
292
|
+
var deleteCrosswalkAction, deleteEvent;
|
|
293
293
|
return __generator(this, function (_a) {
|
|
294
294
|
switch (_a.label) {
|
|
295
295
|
case 0:
|
|
296
|
-
|
|
296
|
+
deleteCrosswalkAction = getActions().deleteCrosswalk;
|
|
297
297
|
deleteEvent = {
|
|
298
298
|
entityUri: 'entities/123',
|
|
299
299
|
crosswalkId: '370iIXrRf'
|
|
300
300
|
};
|
|
301
|
-
|
|
302
|
-
expect(
|
|
301
|
+
deleteCrosswalkAction(deleteEvent);
|
|
302
|
+
expect(deleteCrosswalk).toHaveBeenCalledWith(deleteEvent);
|
|
303
303
|
return [4 /*yield*/, act(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
304
304
|
return __generator(this, function (_a) {
|
|
305
305
|
resolveSuccess();
|
|
@@ -308,9 +308,9 @@ describe('useCrosswalkActions tests', function () {
|
|
|
308
308
|
}); })];
|
|
309
309
|
case 1:
|
|
310
310
|
_a.sent();
|
|
311
|
-
expect(initialProps.onSuccess).
|
|
312
|
-
|
|
313
|
-
expect(
|
|
311
|
+
expect(initialProps.onSuccess).toHaveBeenCalled();
|
|
312
|
+
deleteCrosswalkAction(deleteEvent);
|
|
313
|
+
expect(deleteCrosswalk).toHaveBeenCalledWith(deleteEvent);
|
|
314
314
|
return [4 /*yield*/, act(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
315
315
|
return __generator(this, function (_a) {
|
|
316
316
|
resolveError();
|
|
@@ -319,7 +319,7 @@ describe('useCrosswalkActions tests', function () {
|
|
|
319
319
|
}); })];
|
|
320
320
|
case 2:
|
|
321
321
|
_a.sent();
|
|
322
|
-
expect(initialProps.onError).
|
|
322
|
+
expect(initialProps.onError).toHaveBeenCalledWith({ errorMessage: 'Operation failed with error' });
|
|
323
323
|
return [2 /*return*/];
|
|
324
324
|
}
|
|
325
325
|
});
|
|
@@ -116,7 +116,7 @@ describe('useModifiedEntity', function () {
|
|
|
116
116
|
expect(onSuccess).toBe(initialProps.onModify);
|
|
117
117
|
var error = new Error();
|
|
118
118
|
onError === null || onError === void 0 ? void 0 : onError(error);
|
|
119
|
-
expect(initialProps.onError).
|
|
119
|
+
expect(initialProps.onError).toHaveBeenCalledWith(error);
|
|
120
120
|
});
|
|
121
121
|
it('should return unmodified entity on first render', function () {
|
|
122
122
|
var modifiedEntity = getModifiedEntity().modifiedEntity;
|
|
@@ -227,7 +227,7 @@ describe('useModifiedEntity', function () {
|
|
|
227
227
|
act(function () {
|
|
228
228
|
onDeleteAttribute(deleteEvent);
|
|
229
229
|
});
|
|
230
|
-
expect(attributeActions.deleteAttribute).
|
|
230
|
+
expect(attributeActions.deleteAttribute).toHaveBeenCalledWith(deleteEvent);
|
|
231
231
|
});
|
|
232
232
|
it('should return correct delete handler for temporary attribute', function () {
|
|
233
233
|
var _a = getModifiedEntity(), onAddAttribute = _a.onAddAttribute, onDeleteAttribute = _a.onDeleteAttribute, result = _a.result;
|
|
@@ -260,7 +260,7 @@ describe('useModifiedEntity', function () {
|
|
|
260
260
|
crosswalks: [crosswalk]
|
|
261
261
|
});
|
|
262
262
|
});
|
|
263
|
-
expect(attributeActions.deleteAttribute).not.
|
|
263
|
+
expect(attributeActions.deleteAttribute).not.toHaveBeenCalled();
|
|
264
264
|
expect(result.current.modifiedEntity).toEqual(entity);
|
|
265
265
|
expect(result.current.crosswalksMap).toEqual(initCrosswalksMap);
|
|
266
266
|
});
|
|
@@ -279,7 +279,7 @@ describe('useModifiedEntity', function () {
|
|
|
279
279
|
act(function () {
|
|
280
280
|
onEditAttribute(editEvent);
|
|
281
281
|
});
|
|
282
|
-
expect(attributeActions.updateAttribute).
|
|
282
|
+
expect(attributeActions.updateAttribute).toHaveBeenCalledWith(editEvent);
|
|
283
283
|
});
|
|
284
284
|
it('should return correct edit handler for temporary simple attribute', function () {
|
|
285
285
|
var _a, _b;
|
|
@@ -313,8 +313,8 @@ describe('useModifiedEntity', function () {
|
|
|
313
313
|
act(function () {
|
|
314
314
|
onEditAttribute(editEvent);
|
|
315
315
|
});
|
|
316
|
-
expect(attributeActions.updateAttribute).not.
|
|
317
|
-
expect(attributeActions.createAttribute).
|
|
316
|
+
expect(attributeActions.updateAttribute).not.toHaveBeenCalled();
|
|
317
|
+
expect(attributeActions.createAttribute).toHaveBeenCalledWith({
|
|
318
318
|
attributeValue: __assign(__assign({}, (_b = result.current.modifiedEntity.attributes) === null || _b === void 0 ? void 0 : _b.Simple[1]), { value: 'new value' }),
|
|
319
319
|
crosswalk: crosswalk
|
|
320
320
|
});
|
|
@@ -367,8 +367,8 @@ describe('useModifiedEntity', function () {
|
|
|
367
367
|
attributeValue: __assign(__assign({}, (_a = result.current.modifiedEntity.attributes) === null || _a === void 0 ? void 0 : _a.Nested[1].value.SubNested[0]), { value: 'new value' })
|
|
368
368
|
});
|
|
369
369
|
});
|
|
370
|
-
expect(attributeActions.updateAttribute).not.
|
|
371
|
-
expect(attributeActions.createAttribute).
|
|
370
|
+
expect(attributeActions.updateAttribute).not.toHaveBeenCalled();
|
|
371
|
+
expect(attributeActions.createAttribute).toHaveBeenCalledWith({
|
|
372
372
|
attributeValue: __assign(__assign({}, (_a = result.current.modifiedEntity.attributes) === null || _a === void 0 ? void 0 : _a.Nested[1]), { value: {
|
|
373
373
|
SubNested: [
|
|
374
374
|
__assign(__assign({}, (_b = result.current.modifiedEntity.attributes) === null || _b === void 0 ? void 0 : _b.Nested[1].value.SubNested[0]), { value: 'new value' })
|
|
@@ -126,9 +126,9 @@ describe('useEdgeLabelsRenderer tests', function () {
|
|
|
126
126
|
hoversRenderer(hoversCanvasContext);
|
|
127
127
|
});
|
|
128
128
|
expect(getCanvasContextEventTypes(hoversCanvasContext)).toEqual(expect.arrayContaining(['beginPath', 'arc', 'fill']));
|
|
129
|
-
expect(hoversCanvasContext.arc).
|
|
129
|
+
expect(hoversCanvasContext.arc).toHaveBeenCalledTimes(1);
|
|
130
130
|
expect(hoversCanvasContext.arc).toHaveBeenCalledWith(150, 100, 2.8, 0, 2 * Math.PI);
|
|
131
|
-
expect(drawLabel).
|
|
131
|
+
expect(drawLabel).toHaveBeenCalledTimes(1);
|
|
132
132
|
expect(drawLabel).toHaveBeenCalledWith(hoversCanvasContext, { label: '1', size: 4, x: 150, y: 100 }, { labelColor: 'black', labelSize: 12 * 1.2 }, { backgroundColor: 'rgba(250, 250, 250, 1)' });
|
|
133
133
|
});
|
|
134
134
|
it('mousemove event should work correctly if cursor over edge caption', function () {
|
package/esm/features/history/ContributorsPanel/components/ContributorItem/ContributorItem.specs.js
CHANGED
|
@@ -48,7 +48,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
48
48
|
import React from 'react';
|
|
49
49
|
import { render, screen } from '@testing-library/react';
|
|
50
50
|
import userEvent from '@testing-library/user-event';
|
|
51
|
-
import
|
|
51
|
+
import { getContributorColor } from '@reltio/mdm-sdk';
|
|
52
52
|
import { ContributorItem } from './ContributorItem';
|
|
53
53
|
jest.mock('@reltio/mdm-sdk', function () { return (__assign(__assign({}, jest.requireActual('@reltio/mdm-sdk')), { getContributorColor: jest.fn() })); });
|
|
54
54
|
describe('ContributorItem tests', function () {
|
|
@@ -57,7 +57,9 @@ describe('ContributorItem tests', function () {
|
|
|
57
57
|
isSelected: true,
|
|
58
58
|
onClick: jest.fn()
|
|
59
59
|
};
|
|
60
|
-
|
|
60
|
+
beforeEach(function () {
|
|
61
|
+
getContributorColor.mockReturnValue('#FFFFFF');
|
|
62
|
+
});
|
|
61
63
|
var setUp = function (props) {
|
|
62
64
|
if (props === void 0) { props = {}; }
|
|
63
65
|
var user = userEvent.setup();
|
|
@@ -65,7 +67,7 @@ describe('ContributorItem tests', function () {
|
|
|
65
67
|
};
|
|
66
68
|
it('should render correct default state', function () {
|
|
67
69
|
setUp();
|
|
68
|
-
expect(
|
|
70
|
+
expect(getContributorColor).toHaveBeenCalledWith(defaultProps.value);
|
|
69
71
|
var contributorItem = screen.getByTestId('reltio-contributor-item');
|
|
70
72
|
expect(contributorItem).toHaveClass('icon', 'active', 'clickable');
|
|
71
73
|
expect(contributorItem).not.toHaveClass('inactive');
|
|
@@ -28,7 +28,7 @@ describe('HistoryLink tests', function () {
|
|
|
28
28
|
});
|
|
29
29
|
it('should render correctly', function () {
|
|
30
30
|
var wrapper = shallow(React.createElement(HistoryLink, __assign({}, props)));
|
|
31
|
-
expect(getHistoryLinkCurveSpy).
|
|
31
|
+
expect(getHistoryLinkCurveSpy).toHaveBeenCalledWith(props.x, props.y, props.toX, props.toY);
|
|
32
32
|
expect(wrapper.find('path').length).toBe(1);
|
|
33
33
|
expect(wrapper.find('path').props()).toMatchObject({
|
|
34
34
|
d: getHistoryLinkCurveSpy.mock.results[0].value,
|
|
@@ -40,7 +40,7 @@ describe('HistoryLink tests', function () {
|
|
|
40
40
|
});
|
|
41
41
|
it('should render dashed path if isDashed === true', function () {
|
|
42
42
|
var wrapper = shallow(React.createElement(HistoryLink, __assign({}, props, { isDashed: true })));
|
|
43
|
-
expect(getHistoryLinkCurveSpy).
|
|
43
|
+
expect(getHistoryLinkCurveSpy).toHaveBeenCalledWith(props.x, props.y, props.toX, props.toY);
|
|
44
44
|
expect(wrapper.find('path').length).toBe(1);
|
|
45
45
|
expect(wrapper.find('path').prop('strokeDasharray')).toBe('3,3');
|
|
46
46
|
});
|
|
@@ -12,9 +12,9 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
import React from 'react';
|
|
13
13
|
import i18n from 'ui-i18n';
|
|
14
14
|
import { shallow } from 'enzyme';
|
|
15
|
-
import * as mdmSdk from '@reltio/mdm-sdk';
|
|
16
15
|
import { HistoryChangeTypes } from '../types';
|
|
17
16
|
import { getActivityLabel } from '../../activity-log';
|
|
17
|
+
import { getContributorColor } from '@reltio/mdm-sdk';
|
|
18
18
|
import { HistoryRow } from './HistoryRow';
|
|
19
19
|
jest.mock('@reltio/mdm-sdk', function () { return (__assign(__assign({}, jest.requireActual('@reltio/mdm-sdk')), { getContributorColor: jest.fn() })); });
|
|
20
20
|
describe('HistoryRow tests', function () {
|
|
@@ -31,13 +31,12 @@ describe('HistoryRow tests', function () {
|
|
|
31
31
|
isSelected: false,
|
|
32
32
|
onClick: onClick
|
|
33
33
|
};
|
|
34
|
-
var getContributorColorMock = jest.spyOn(mdmSdk, 'getContributorColor');
|
|
35
34
|
beforeAll(function () {
|
|
36
35
|
jest.clearAllMocks();
|
|
37
36
|
});
|
|
38
37
|
it('should render correctly', function () {
|
|
39
38
|
var wrapper = shallow(React.createElement(HistoryRow, __assign({}, props)));
|
|
40
|
-
expect(
|
|
39
|
+
expect(getContributorColor).toHaveBeenCalledWith(props.change.uri);
|
|
41
40
|
expect(wrapper.find('.historyRow').length).toBe(1);
|
|
42
41
|
var header = wrapper.find('.rowHeader');
|
|
43
42
|
expect(header.length).toBe(1);
|
|
@@ -139,7 +139,7 @@ describe('HistoryTree tests', function () {
|
|
|
139
139
|
return [4 /*yield*/, user.click(screen.getByText('Show more'))];
|
|
140
140
|
case 1:
|
|
141
141
|
_a.sent();
|
|
142
|
-
expect(defaultProps.onLoadMore).
|
|
142
|
+
expect(defaultProps.onLoadMore).toHaveBeenCalled();
|
|
143
143
|
return [2 /*return*/];
|
|
144
144
|
}
|
|
145
145
|
});
|
|
@@ -62,7 +62,7 @@ describe('HistoryView tests', function () {
|
|
|
62
62
|
.mockReturnValue({ historyData: historyData, findPreviousChange: findPreviousChange });
|
|
63
63
|
it('should render correct default state', function () {
|
|
64
64
|
var wrapper = mount(React.createElement(HistoryView, __assign({}, props)));
|
|
65
|
-
expect(useHistoryTreeMock).
|
|
65
|
+
expect(useHistoryTreeMock).toHaveBeenCalledWith({
|
|
66
66
|
entityUri: props.entityUri,
|
|
67
67
|
historyChanges: props.historyWithTotal.changes,
|
|
68
68
|
selectedUris: props.contributorsUris
|
|
@@ -87,26 +87,26 @@ describe('filters helpers tests', function () {
|
|
|
87
87
|
expect(buildHistoryFilterString(filter)).toEqual(expectedResult + ' and ' + defaultFilterString);
|
|
88
88
|
});
|
|
89
89
|
it('should build date range within filter correctly', function () {
|
|
90
|
-
|
|
91
|
-
jest.spyOn(Date, 'now').mockReturnValue(1636703406900 - tzOffset);
|
|
90
|
+
jest.spyOn(Date, 'now').mockReturnValue(1636703406900);
|
|
92
91
|
var filter = {
|
|
93
92
|
dateRange: {
|
|
94
93
|
type: 'within',
|
|
95
94
|
period: [4, 'months']
|
|
96
95
|
}
|
|
97
96
|
};
|
|
98
|
-
|
|
97
|
+
var expectedTimestamp = moment.utc(1636703406900).subtract(4, 'months').valueOf();
|
|
98
|
+
expect(buildHistoryFilterString(filter)).toEqual("(gte(timestamp, ".concat(expectedTimestamp, ")) and ").concat(defaultFilterString));
|
|
99
99
|
});
|
|
100
100
|
it('should build date range ago filter correctly', function () {
|
|
101
|
-
|
|
102
|
-
jest.spyOn(Date, 'now').mockReturnValue(1636703406900 - tzOffset);
|
|
101
|
+
jest.spyOn(Date, 'now').mockReturnValue(1636703406900);
|
|
103
102
|
var filter = {
|
|
104
103
|
dateRange: {
|
|
105
104
|
type: 'ago',
|
|
106
105
|
period: [4, 'months']
|
|
107
106
|
}
|
|
108
107
|
};
|
|
109
|
-
|
|
108
|
+
var expectedTimestamp = moment.utc(1636703406900).subtract(4, 'months').valueOf();
|
|
109
|
+
expect(buildHistoryFilterString(filter)).toEqual("(lte(timestamp, ".concat(expectedTimestamp, ")) and ").concat(defaultFilterString));
|
|
110
110
|
});
|
|
111
111
|
it('should build date range between filter correctly', function () {
|
|
112
112
|
var filter = {
|
|
@@ -55,14 +55,12 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
55
55
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
56
56
|
};
|
|
57
57
|
import { renderHook, act } from '@testing-library/react-hooks';
|
|
58
|
-
import * as mdmSdk from '@reltio/mdm-sdk';
|
|
59
|
-
import { useHistory } from './useHistory';
|
|
60
58
|
import { HistoryActivityType } from '../types';
|
|
59
|
+
import { getHistoricUris, getHistoryWithTotal } from '@reltio/mdm-sdk';
|
|
61
60
|
import { buildHistoryFilterString } from '../helpers/filters';
|
|
61
|
+
import { useHistory } from './useHistory';
|
|
62
62
|
jest.mock('@reltio/mdm-sdk', function () { return (__assign(__assign({}, jest.requireActual('@reltio/mdm-sdk')), { getHistoricUris: jest.fn(), getHistoryWithTotal: jest.fn() })); });
|
|
63
63
|
describe('useHistory behavior', function () {
|
|
64
|
-
var getHistoricUrisSpy = jest.spyOn(mdmSdk, 'getHistoricUris');
|
|
65
|
-
var getHistoryWithTotalSpy = jest.spyOn(mdmSdk, 'getHistoryWithTotal');
|
|
66
64
|
var defaultEntity = {
|
|
67
65
|
uri: '123',
|
|
68
66
|
type: 'configuration/entityTypes/HCP',
|
|
@@ -96,12 +94,12 @@ describe('useHistory behavior', function () {
|
|
|
96
94
|
var resolveHistoricUris;
|
|
97
95
|
var resolveHistoryWithTotal;
|
|
98
96
|
beforeAll(function () {
|
|
99
|
-
|
|
97
|
+
getHistoricUris.mockImplementation(function () {
|
|
100
98
|
return new Promise(function (resolve) {
|
|
101
99
|
resolveHistoricUris = function (data) { return resolve(data); };
|
|
102
100
|
});
|
|
103
101
|
});
|
|
104
|
-
|
|
102
|
+
getHistoryWithTotal.mockImplementation(function () {
|
|
105
103
|
return new Promise(function (resolve) {
|
|
106
104
|
resolveHistoryWithTotal = function (data) { return resolve(data); };
|
|
107
105
|
});
|
|
@@ -142,8 +140,8 @@ describe('useHistory behavior', function () {
|
|
|
142
140
|
historicUris: historicUris,
|
|
143
141
|
historyWithTotal: historyWithTotal
|
|
144
142
|
});
|
|
145
|
-
expect(
|
|
146
|
-
expect(
|
|
143
|
+
expect(getHistoricUris).toHaveBeenCalledWith({ entityUri: defaultEntity.uri });
|
|
144
|
+
expect(getHistoryWithTotal).toHaveBeenCalledWith({
|
|
147
145
|
entityUri: defaultEntity.uri,
|
|
148
146
|
historicUris: historicUris,
|
|
149
147
|
filter: defaultFilterString,
|
|
@@ -162,8 +160,8 @@ describe('useHistory behavior', function () {
|
|
|
162
160
|
historicUris: null,
|
|
163
161
|
historyWithTotal: null
|
|
164
162
|
});
|
|
165
|
-
expect(
|
|
166
|
-
expect(
|
|
163
|
+
expect(getHistoricUris).not.toHaveBeenCalled();
|
|
164
|
+
expect(getHistoryWithTotal).not.toHaveBeenCalled();
|
|
167
165
|
});
|
|
168
166
|
it('should not call getHistoricUris and getHistoryWithTotal if enabled is false', function () {
|
|
169
167
|
var result = setUp({ enabled: false }).result;
|
|
@@ -172,8 +170,8 @@ describe('useHistory behavior', function () {
|
|
|
172
170
|
historicUris: null,
|
|
173
171
|
historyWithTotal: null
|
|
174
172
|
});
|
|
175
|
-
expect(
|
|
176
|
-
expect(
|
|
173
|
+
expect(getHistoricUris).not.toHaveBeenCalled();
|
|
174
|
+
expect(getHistoryWithTotal).not.toHaveBeenCalled();
|
|
177
175
|
});
|
|
178
176
|
it('should set new history and reset history page filter when setHistoryFilter called', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
179
177
|
var filter, result;
|
|
@@ -235,7 +233,7 @@ describe('useHistory behavior', function () {
|
|
|
235
233
|
historyWithTotal: bigHistoryWithTotal,
|
|
236
234
|
historyFilter: filter
|
|
237
235
|
});
|
|
238
|
-
expect(
|
|
236
|
+
expect(getHistoryWithTotal).toHaveBeenLastCalledWith({
|
|
239
237
|
entityUri: defaultEntity.uri,
|
|
240
238
|
historicUris: historicUris,
|
|
241
239
|
max: 32,
|
|
@@ -243,7 +241,7 @@ describe('useHistory behavior', function () {
|
|
|
243
241
|
showAll: true,
|
|
244
242
|
filter: buildHistoryFilterString(filter)
|
|
245
243
|
});
|
|
246
|
-
expect(
|
|
244
|
+
expect(getHistoricUris).toHaveBeenCalledTimes(1);
|
|
247
245
|
return [2 /*return*/];
|
|
248
246
|
}
|
|
249
247
|
});
|
|
@@ -306,7 +304,7 @@ describe('useHistory behavior', function () {
|
|
|
306
304
|
historicUris: historicUris,
|
|
307
305
|
historyFilter: defaultFilter
|
|
308
306
|
});
|
|
309
|
-
expect(
|
|
307
|
+
expect(getHistoryWithTotal).toHaveBeenLastCalledWith({
|
|
310
308
|
entityUri: defaultEntity.uri,
|
|
311
309
|
historicUris: historicUris,
|
|
312
310
|
max: 32,
|
|
@@ -315,7 +313,7 @@ describe('useHistory behavior', function () {
|
|
|
315
313
|
showAll: true,
|
|
316
314
|
filter: buildHistoryFilterString(defaultFilter)
|
|
317
315
|
});
|
|
318
|
-
expect(
|
|
316
|
+
expect(getHistoricUris).toHaveBeenCalledTimes(1);
|
|
319
317
|
return [2 /*return*/];
|
|
320
318
|
}
|
|
321
319
|
});
|
|
@@ -378,7 +376,7 @@ describe('useHistory behavior', function () {
|
|
|
378
376
|
act(function () {
|
|
379
377
|
result.current.onLoadMore();
|
|
380
378
|
});
|
|
381
|
-
expect(
|
|
379
|
+
expect(getHistoryWithTotal).toHaveBeenLastCalledWith({
|
|
382
380
|
entityUri: defaultEntity.uri,
|
|
383
381
|
historicUris: historicUris,
|
|
384
382
|
max: 32,
|
|
@@ -464,8 +462,8 @@ describe('useHistory behavior', function () {
|
|
|
464
462
|
}); })];
|
|
465
463
|
case 2:
|
|
466
464
|
_a.sent();
|
|
467
|
-
|
|
468
|
-
|
|
465
|
+
getHistoricUris.mockClear();
|
|
466
|
+
getHistoryWithTotal.mockClear();
|
|
469
467
|
rerender({
|
|
470
468
|
entity: __assign(__assign({}, defaultEntity), { updatedTime: 1638330249573 }),
|
|
471
469
|
enabled: true
|
|
@@ -486,8 +484,8 @@ describe('useHistory behavior', function () {
|
|
|
486
484
|
}); })];
|
|
487
485
|
case 4:
|
|
488
486
|
_a.sent();
|
|
489
|
-
expect(
|
|
490
|
-
expect(
|
|
487
|
+
expect(getHistoricUris).toHaveBeenCalled();
|
|
488
|
+
expect(getHistoryWithTotal).toHaveBeenCalled();
|
|
491
489
|
return [2 /*return*/];
|
|
492
490
|
}
|
|
493
491
|
});
|
|
@@ -514,8 +512,8 @@ describe('useHistory behavior', function () {
|
|
|
514
512
|
}); })];
|
|
515
513
|
case 2:
|
|
516
514
|
_b.sent();
|
|
517
|
-
|
|
518
|
-
|
|
515
|
+
getHistoricUris.mockClear();
|
|
516
|
+
getHistoryWithTotal.mockClear();
|
|
519
517
|
expect(result.current.historyWithTotal).toBe(bigHistoryWithTotal);
|
|
520
518
|
rerender({
|
|
521
519
|
entity: __assign(__assign({}, defaultEntity), { uri: 'entities/1234' }),
|
|
@@ -538,8 +536,8 @@ describe('useHistory behavior', function () {
|
|
|
538
536
|
}); })];
|
|
539
537
|
case 4:
|
|
540
538
|
_b.sent();
|
|
541
|
-
expect(
|
|
542
|
-
expect(
|
|
539
|
+
expect(getHistoricUris).toHaveBeenCalled();
|
|
540
|
+
expect(getHistoryWithTotal).toHaveBeenCalled();
|
|
543
541
|
return [2 /*return*/];
|
|
544
542
|
}
|
|
545
543
|
});
|
|
@@ -46,7 +46,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
48
|
import React from 'react';
|
|
49
|
-
import { render, screen } from '@testing-library/react';
|
|
49
|
+
import { act, render, screen } from '@testing-library/react';
|
|
50
50
|
import userEvent from '@testing-library/user-event';
|
|
51
51
|
import { ThemeProvider } from '@mui/styles';
|
|
52
52
|
import { createTheme } from '@mui/material/styles';
|
|
@@ -105,14 +105,30 @@ describe('AddWorkflowDialog tests', function () {
|
|
|
105
105
|
data: definitions
|
|
106
106
|
}));
|
|
107
107
|
});
|
|
108
|
-
it('should not render Popover if anchorEl is null', function () {
|
|
109
|
-
var props
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
108
|
+
it('should not render Popover if anchorEl is null', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
109
|
+
var props, resolveProcess;
|
|
110
|
+
return __generator(this, function (_a) {
|
|
111
|
+
switch (_a.label) {
|
|
112
|
+
case 0:
|
|
113
|
+
props = {
|
|
114
|
+
onClose: jest.fn(),
|
|
115
|
+
anchorEl: null
|
|
116
|
+
};
|
|
117
|
+
processDefinitions.mockReturnValue(new Promise(function (resolve) { return (resolveProcess = resolve); }));
|
|
118
|
+
setUp(props);
|
|
119
|
+
return [4 /*yield*/, act(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
120
|
+
return __generator(this, function (_a) {
|
|
121
|
+
resolveProcess({ data: definitions });
|
|
122
|
+
return [2 /*return*/];
|
|
123
|
+
});
|
|
124
|
+
}); })];
|
|
125
|
+
case 1:
|
|
126
|
+
_a.sent();
|
|
127
|
+
expect(screen.queryByText('Add new workflow')).not.toBeInTheDocument();
|
|
128
|
+
return [2 /*return*/];
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
}); });
|
|
116
132
|
it('should render Popover and selector correctly if anchorEl exists', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
117
133
|
var mockAnchorEl, props, user;
|
|
118
134
|
return __generator(this, function (_a) {
|