@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,6 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
48
48
|
import React from 'react';
|
|
49
49
|
import { render, screen, act } from '@testing-library/react';
|
|
50
50
|
import userEvent from '@testing-library/user-event';
|
|
51
|
-
import * as mdmSdk from '@reltio/mdm-sdk';
|
|
52
51
|
import { getAssigneeForTask, updateAssigneeForTask } from '@reltio/mdm-sdk';
|
|
53
52
|
import { MdmModuleProvider } from '../../../contexts/MdmModuleContext';
|
|
54
53
|
import { WorkflowTasksContext } from '../../../contexts/WorkflowTasksContext';
|
|
@@ -88,13 +87,12 @@ var setUp = function (_a) {
|
|
|
88
87
|
React.createElement(WorkflowTasksContext.Provider, { value: workflowTasksContextValue },
|
|
89
88
|
React.createElement(AssigneeSelector, __assign({}, props)))))), { user: user });
|
|
90
89
|
};
|
|
91
|
-
var getAssigneeForTaskSpy = jest.spyOn(mdmSdk, 'getAssigneeForTask');
|
|
92
90
|
var resolveAssigneeForTask;
|
|
93
91
|
describe('AssigneeSelector tests', function () {
|
|
94
92
|
var assignees = ['user1', 'user2', 'firstUser'];
|
|
95
93
|
var response = { data: assignees, total: assignees.length, status: 'ok' };
|
|
96
94
|
beforeEach(function () {
|
|
97
|
-
|
|
95
|
+
getAssigneeForTask.mockImplementationOnce(function () {
|
|
98
96
|
return new Promise(function (_resolve, _reject) {
|
|
99
97
|
resolveAssigneeForTask = _resolve;
|
|
100
98
|
});
|
|
@@ -63,8 +63,7 @@ import { createTheme } from '@mui/material/styles';
|
|
|
63
63
|
import { ThemeProvider } from '@mui/styles';
|
|
64
64
|
import { AdapterMoment } from '@mui/x-date-pickers/AdapterMoment';
|
|
65
65
|
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
|
|
66
|
-
import
|
|
67
|
-
import { runTaskAction, theme, getTaskById } from '@reltio/mdm-sdk';
|
|
66
|
+
import { runTaskAction, theme, getTaskById, addCommentForTask } from '@reltio/mdm-sdk';
|
|
68
67
|
import { MdmModuleProvider } from '../../../../../contexts/MdmModuleContext';
|
|
69
68
|
import { WorkflowTasksContext } from '../../../../../contexts/WorkflowTasksContext';
|
|
70
69
|
import { ErrorPopup } from '../../../../../ErrorPopup';
|
|
@@ -380,11 +379,10 @@ describe('GenericWorkflowTaskCard tests', function () {
|
|
|
380
379
|
});
|
|
381
380
|
}); });
|
|
382
381
|
it('should not send add comment request when user clicks on Shift + Enter in the comment input', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
383
|
-
var
|
|
382
|
+
var newCommentMessage, user;
|
|
384
383
|
return __generator(this, function (_a) {
|
|
385
384
|
switch (_a.label) {
|
|
386
385
|
case 0:
|
|
387
|
-
addCommentForTaskSpy = jest.spyOn(mdmSdk, 'addCommentForTask');
|
|
388
386
|
newCommentMessage = 'new comment message';
|
|
389
387
|
user = setUp().user;
|
|
390
388
|
return [4 /*yield*/, user.click(screen.getByTestId('collapse-button'))];
|
|
@@ -396,17 +394,16 @@ describe('GenericWorkflowTaskCard tests', function () {
|
|
|
396
394
|
return [4 /*yield*/, user.keyboard('{shift>}{enter}{/shift}')];
|
|
397
395
|
case 3:
|
|
398
396
|
_a.sent();
|
|
399
|
-
expect(
|
|
397
|
+
expect(addCommentForTask).not.toHaveBeenCalled();
|
|
400
398
|
return [2 /*return*/];
|
|
401
399
|
}
|
|
402
400
|
});
|
|
403
401
|
}); });
|
|
404
402
|
it('should send correct add comment request when user sends multiline comment', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
405
|
-
var
|
|
403
|
+
var firstLineCommentMessage, secondLineCommentMessage, user;
|
|
406
404
|
return __generator(this, function (_a) {
|
|
407
405
|
switch (_a.label) {
|
|
408
406
|
case 0:
|
|
409
|
-
addCommentForTaskSpy = jest.spyOn(mdmSdk, 'addCommentForTask');
|
|
410
407
|
getTaskById.mockResolvedValue({
|
|
411
408
|
processInstanceComments: []
|
|
412
409
|
});
|
|
@@ -428,7 +425,7 @@ describe('GenericWorkflowTaskCard tests', function () {
|
|
|
428
425
|
return [4 /*yield*/, user.keyboard('{enter}')];
|
|
429
426
|
case 5:
|
|
430
427
|
_a.sent();
|
|
431
|
-
expect(
|
|
428
|
+
expect(addCommentForTask).toHaveBeenCalledWith(expect.objectContaining({ comment: 'string 1\nstring 2' }));
|
|
432
429
|
return [2 /*return*/];
|
|
433
430
|
}
|
|
434
431
|
});
|
|
@@ -47,14 +47,12 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
47
47
|
};
|
|
48
48
|
import React from 'react';
|
|
49
49
|
import { mount } from 'enzyme';
|
|
50
|
-
import
|
|
50
|
+
import { getDataChangeRequest, getEntitiesByUris } from '@reltio/mdm-sdk';
|
|
51
51
|
import { act } from 'react-dom/test-utils';
|
|
52
52
|
import { ErrorPopup } from '../../../ErrorPopup';
|
|
53
53
|
import { useChangeRequest } from './useChangeRequest';
|
|
54
54
|
jest.mock('@reltio/mdm-sdk', function () { return (__assign(__assign({}, jest.requireActual('@reltio/mdm-sdk')), { getDataChangeRequest: jest.fn(), getEntitiesByUris: jest.fn() })); });
|
|
55
55
|
describe('useChangeRequest tests', function () {
|
|
56
|
-
var getDataChangeRequestSpy = jest.spyOn(mdmSdk, 'getDataChangeRequest');
|
|
57
|
-
var getEntitiesByUrisSpy = jest.spyOn(mdmSdk, 'getEntitiesByUris');
|
|
58
56
|
// eslint-disable-next-line react/prop-types
|
|
59
57
|
var TestComponent = function (_a) {
|
|
60
58
|
var dcrUri = _a.dcrUri;
|
|
@@ -109,14 +107,14 @@ describe('useChangeRequest tests', function () {
|
|
|
109
107
|
};
|
|
110
108
|
var entities = [{ uri: 'entities/151gdPs5' }];
|
|
111
109
|
beforeAll(function () {
|
|
112
|
-
|
|
110
|
+
getDataChangeRequest.mockImplementation(function () {
|
|
113
111
|
return new Promise(function (resolve, reject) {
|
|
114
112
|
resolveChangeRequest = function (shouldFail) {
|
|
115
113
|
return shouldFail ? reject({ errorMessage: 'dcrError' }) : resolve(dcr);
|
|
116
114
|
};
|
|
117
115
|
});
|
|
118
116
|
});
|
|
119
|
-
|
|
117
|
+
getEntitiesByUris.mockImplementation(function () {
|
|
120
118
|
return new Promise(function (resolve, reject) {
|
|
121
119
|
resolveGetEntitiesByUris = function (shouldFail) {
|
|
122
120
|
return shouldFail ? reject({ errorMessage: 'entitiesError' }) : resolve(entities);
|
|
@@ -130,8 +128,8 @@ describe('useChangeRequest tests', function () {
|
|
|
130
128
|
});
|
|
131
129
|
it('should return empty parameters if dcrUri is null', function () {
|
|
132
130
|
var wrapper = mount(React.createElement(TestComponent, { dcrUri: null }));
|
|
133
|
-
expect(
|
|
134
|
-
expect(
|
|
131
|
+
expect(getDataChangeRequest).toHaveBeenCalledWith(null);
|
|
132
|
+
expect(getEntitiesByUris).not.toHaveBeenCalled();
|
|
135
133
|
expect(getHooksValues(wrapper)).toEqual({
|
|
136
134
|
dcr: null,
|
|
137
135
|
groupedObjects: []
|
|
@@ -139,8 +137,8 @@ describe('useChangeRequest tests', function () {
|
|
|
139
137
|
});
|
|
140
138
|
it('should return empty parameters if dcrUri is undefined', function () {
|
|
141
139
|
var wrapper = mount(React.createElement(TestComponent, { dcrUri: undefined }));
|
|
142
|
-
expect(
|
|
143
|
-
expect(
|
|
140
|
+
expect(getDataChangeRequest).toHaveBeenCalledWith(undefined);
|
|
141
|
+
expect(getEntitiesByUris).not.toHaveBeenCalled();
|
|
144
142
|
expect(getHooksValues(wrapper)).toEqual({
|
|
145
143
|
dcr: null,
|
|
146
144
|
groupedObjects: []
|
|
@@ -196,8 +194,8 @@ describe('useChangeRequest tests', function () {
|
|
|
196
194
|
case 2:
|
|
197
195
|
_a.sent();
|
|
198
196
|
wrapper.update();
|
|
199
|
-
expect(
|
|
200
|
-
expect(
|
|
197
|
+
expect(getDataChangeRequest).toHaveBeenCalledWith('testUri');
|
|
198
|
+
expect(getEntitiesByUris).toHaveBeenCalledWith(['entities/10f6JMNk'], {
|
|
201
199
|
defaultMaxValues: 1,
|
|
202
200
|
searchOptions: 'ovOnly'
|
|
203
201
|
});
|
|
@@ -236,8 +234,8 @@ describe('useChangeRequest tests', function () {
|
|
|
236
234
|
case 2:
|
|
237
235
|
_a.sent();
|
|
238
236
|
wrapper.update();
|
|
239
|
-
expect(
|
|
240
|
-
expect(
|
|
237
|
+
expect(getDataChangeRequest).toHaveBeenCalledWith('testUri');
|
|
238
|
+
expect(getEntitiesByUris).toHaveBeenCalledWith(['entities/10f6JMNk'], {
|
|
241
239
|
defaultMaxValues: 1,
|
|
242
240
|
searchOptions: 'ovOnly'
|
|
243
241
|
});
|
|
@@ -207,15 +207,15 @@ describe('customScript helpers tests ', function () {
|
|
|
207
207
|
var docBlock = document.createElement('div');
|
|
208
208
|
docBlock.innerHTML = html;
|
|
209
209
|
resetHtml({ worker: worker, setTooltip: setTooltip, innerText: innerText, html: html, setListenersToReset: setListenersToReset, setHtml: setHtml });
|
|
210
|
-
expect(setListenersToReset).
|
|
211
|
-
expect(setHtml).
|
|
210
|
+
expect(setListenersToReset).toHaveBeenCalledWith([]);
|
|
211
|
+
expect(setHtml).toHaveBeenCalledWith(docBlock);
|
|
212
212
|
});
|
|
213
213
|
it('should work correctly without html prop', function () {
|
|
214
214
|
var docBlock = document.createElement('div');
|
|
215
215
|
docBlock.innerHTML = innerText;
|
|
216
216
|
resetHtml({ worker: worker, setTooltip: setTooltip, innerText: innerText, setListenersToReset: setListenersToReset, setHtml: setHtml });
|
|
217
|
-
expect(setListenersToReset).
|
|
218
|
-
expect(setHtml).
|
|
217
|
+
expect(setListenersToReset).toHaveBeenCalledWith([]);
|
|
218
|
+
expect(setHtml).toHaveBeenCalledWith(docBlock);
|
|
219
219
|
});
|
|
220
220
|
});
|
|
221
221
|
describe('interceptors tests', function () {
|
|
@@ -247,8 +247,8 @@ describe('customScript helpers tests ', function () {
|
|
|
247
247
|
headers: { test: 'some' }
|
|
248
248
|
};
|
|
249
249
|
requestInterceptor({ options: options, next: next, url: '/testRequest', resolve: resolve, abort: abort });
|
|
250
|
-
expect(setRequestListeners).
|
|
251
|
-
expect(postMessageSpy).
|
|
250
|
+
expect(setRequestListeners).toHaveBeenCalledWith(options, next, 'nanoid', resolve);
|
|
251
|
+
expect(postMessageSpy).toHaveBeenCalledWith({
|
|
252
252
|
action: 'apiRequest',
|
|
253
253
|
id: 'nanoid',
|
|
254
254
|
url: 'https://tst-01.reltio.com/reltio/api/tenant/testRequest',
|
|
@@ -256,7 +256,7 @@ describe('customScript helpers tests ', function () {
|
|
|
256
256
|
headers: options.headers,
|
|
257
257
|
data: options.body
|
|
258
258
|
});
|
|
259
|
-
expect(next).not.
|
|
259
|
+
expect(next).not.toHaveBeenCalled();
|
|
260
260
|
});
|
|
261
261
|
it('should run next if not processable url', function () {
|
|
262
262
|
var requestInterceptor = setUpRequestInterceptor({
|
|
@@ -273,8 +273,8 @@ describe('customScript helpers tests ', function () {
|
|
|
273
273
|
headers: {}
|
|
274
274
|
};
|
|
275
275
|
requestInterceptor({ options: options, next: next, url: url, resolve: resolve, abort: abort });
|
|
276
|
-
expect(postMessageSpy).not.
|
|
277
|
-
expect(next).
|
|
276
|
+
expect(postMessageSpy).not.toHaveBeenCalled();
|
|
277
|
+
expect(next).toHaveBeenCalledWith(url, options);
|
|
278
278
|
});
|
|
279
279
|
});
|
|
280
280
|
describe('setUpResponseInterceptor tests', function () {
|
|
@@ -316,15 +316,15 @@ describe('customScript helpers tests ', function () {
|
|
|
316
316
|
}); })];
|
|
317
317
|
case 1:
|
|
318
318
|
_a.sent();
|
|
319
|
-
expect(setResponseListeners).
|
|
320
|
-
expect(postMessageSpy).
|
|
319
|
+
expect(setResponseListeners).toHaveBeenCalledWith(next, 'nanoid');
|
|
320
|
+
expect(postMessageSpy).toHaveBeenCalledWith({
|
|
321
321
|
action: 'apiResponse',
|
|
322
322
|
id: 'nanoid',
|
|
323
323
|
url: 'https://tst-01.reltio.com/reltio/testRequest',
|
|
324
324
|
method: options.method,
|
|
325
325
|
data: 'data'
|
|
326
326
|
});
|
|
327
|
-
expect(next).not.
|
|
327
|
+
expect(next).not.toHaveBeenCalled();
|
|
328
328
|
return [2 /*return*/];
|
|
329
329
|
}
|
|
330
330
|
});
|
|
@@ -354,10 +354,10 @@ describe('customScript helpers tests ', function () {
|
|
|
354
354
|
}); })];
|
|
355
355
|
case 1:
|
|
356
356
|
_a.sent();
|
|
357
|
-
expect(setResponseListeners).not.
|
|
358
|
-
expect(postMessageSpy).not.
|
|
359
|
-
expect(next).not.
|
|
360
|
-
expect(abort).
|
|
357
|
+
expect(setResponseListeners).not.toHaveBeenCalled();
|
|
358
|
+
expect(postMessageSpy).not.toHaveBeenCalled();
|
|
359
|
+
expect(next).not.toHaveBeenCalled();
|
|
360
|
+
expect(abort).toHaveBeenCalledWith('error');
|
|
361
361
|
return [2 /*return*/];
|
|
362
362
|
}
|
|
363
363
|
});
|
|
@@ -372,9 +372,9 @@ describe('customScript helpers tests ', function () {
|
|
|
372
372
|
setResponseListeners: setResponseListeners
|
|
373
373
|
});
|
|
374
374
|
responseInterceptor({ url: url, options: {}, response: response, next: next, abort: abort });
|
|
375
|
-
expect(setResponseListeners).not.
|
|
376
|
-
expect(postMessageSpy).not.
|
|
377
|
-
expect(next).
|
|
375
|
+
expect(setResponseListeners).not.toHaveBeenCalled();
|
|
376
|
+
expect(postMessageSpy).not.toHaveBeenCalled();
|
|
377
|
+
expect(next).toHaveBeenCalledWith(response);
|
|
378
378
|
});
|
|
379
379
|
});
|
|
380
380
|
});
|
|
@@ -183,7 +183,7 @@ describe('useAPI custom sandbox behavior', function () {
|
|
|
183
183
|
act(function () {
|
|
184
184
|
onmessageFromWorker({ action: CustomAction.SET_HTML, params: { html: html } });
|
|
185
185
|
});
|
|
186
|
-
expect(htmlSanitizer).
|
|
186
|
+
expect(htmlSanitizer).toHaveBeenCalledWith(html);
|
|
187
187
|
expect(result.current.html).toEqual(htmlBlock);
|
|
188
188
|
act(function () {
|
|
189
189
|
onmessageFromWorker({ action: CustomAction.SET_HTML, params: { html: child, id: 'testId' } });
|
|
@@ -205,7 +205,7 @@ describe('useAPI custom sandbox behavior', function () {
|
|
|
205
205
|
act(function () {
|
|
206
206
|
onmessageFromWorker({ action: CustomAction.SET_HTML, params: { html: html, id: 'nonExist' } });
|
|
207
207
|
});
|
|
208
|
-
expect(htmlSanitizer).
|
|
208
|
+
expect(htmlSanitizer).toHaveBeenCalledWith(html);
|
|
209
209
|
expect(result.current.html).toEqual(undefined);
|
|
210
210
|
});
|
|
211
211
|
it('should return popup on event showPopup', function () {
|
|
@@ -217,7 +217,7 @@ describe('useAPI custom sandbox behavior', function () {
|
|
|
217
217
|
act(function () {
|
|
218
218
|
onmessageFromWorker({ action: CustomAction.SHOW_POPUP, params: popup });
|
|
219
219
|
});
|
|
220
|
-
expect(htmlSanitizer).
|
|
220
|
+
expect(htmlSanitizer).toHaveBeenCalledWith(popup);
|
|
221
221
|
expect(result.current.popup).toEqual(popupBlock);
|
|
222
222
|
});
|
|
223
223
|
it('should return null popup on event hidePopup', function () {
|
|
@@ -318,7 +318,7 @@ describe('useAPI custom sandbox behavior', function () {
|
|
|
318
318
|
act(function () {
|
|
319
319
|
onmessageFromWorker({ action: CustomAction.MESSAGE, params: message });
|
|
320
320
|
});
|
|
321
|
-
expect(showSnackbarMessage).
|
|
321
|
+
expect(showSnackbarMessage).toHaveBeenCalledWith(message);
|
|
322
322
|
});
|
|
323
323
|
it('should not send api request on action request and name api if url is empty', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
324
324
|
var waitFor, result, params;
|
|
@@ -1155,15 +1155,15 @@ describe('useAPI custom sandbox behavior', function () {
|
|
|
1155
1155
|
var mdmValues = __assign(__assign({}, defaultMdmValues), { servicesPath: 'https://tst-01.reltio.com/nui/services' });
|
|
1156
1156
|
var config = createConfig({ processApiRequest: [], processApiResponse: [] });
|
|
1157
1157
|
var unmount = setUp({ mdmValues: mdmValues, config: config }).unmount;
|
|
1158
|
-
expect(interceptors.addInternalRequestInterceptor).
|
|
1159
|
-
expect(interceptors.addInternalResponseInterceptor).
|
|
1160
|
-
expect(interceptors.removeInternalRequestInterceptor).
|
|
1161
|
-
expect(interceptors.removeInternalResponseInterceptor).
|
|
1158
|
+
expect(interceptors.addInternalRequestInterceptor).toHaveBeenCalledTimes(1);
|
|
1159
|
+
expect(interceptors.addInternalResponseInterceptor).toHaveBeenCalledTimes(1);
|
|
1160
|
+
expect(interceptors.removeInternalRequestInterceptor).toHaveBeenCalledTimes(0);
|
|
1161
|
+
expect(interceptors.removeInternalResponseInterceptor).toHaveBeenCalledTimes(0);
|
|
1162
1162
|
unmount();
|
|
1163
|
-
expect(interceptors.removeInternalRequestInterceptor).
|
|
1164
|
-
expect(interceptors.removeInternalResponseInterceptor).
|
|
1165
|
-
expect(interceptors.startInterceptorInit).
|
|
1166
|
-
expect(interceptors.finishInterceptorInit).
|
|
1163
|
+
expect(interceptors.removeInternalRequestInterceptor).toHaveBeenCalledTimes(1);
|
|
1164
|
+
expect(interceptors.removeInternalResponseInterceptor).toHaveBeenCalledTimes(1);
|
|
1165
|
+
expect(interceptors.startInterceptorInit).toHaveBeenCalledTimes(1);
|
|
1166
|
+
expect(interceptors.finishInterceptorInit).toHaveBeenCalledTimes(1);
|
|
1167
1167
|
});
|
|
1168
1168
|
it('should not start Process Instance on action request and name workflow/startProcessInstance if processDefinitionId is empty', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
1169
1169
|
var waitFor, result, params;
|
|
@@ -2,7 +2,8 @@ import React from 'react';
|
|
|
2
2
|
import { render, screen } from '@testing-library/react';
|
|
3
3
|
import { CellRenderer } from './CellRenderer';
|
|
4
4
|
describe('CellRenderer tests', function () {
|
|
5
|
-
var
|
|
5
|
+
var TestWrapper = function () { return React.createElement("div", { "data-reltio-id": 'test-value' }, "test value"); };
|
|
6
|
+
var TestValue = React.createElement(TestWrapper, null);
|
|
6
7
|
var testCollapseContext = {
|
|
7
8
|
maxRowValuesCount: 3,
|
|
8
9
|
toggleRowCollapse: jest.fn(),
|
|
@@ -252,7 +252,7 @@ describe('dataHelpers', function () {
|
|
|
252
252
|
id: 0
|
|
253
253
|
}
|
|
254
254
|
]);
|
|
255
|
-
expect(getRowMaxValuesCount).
|
|
255
|
+
expect(getRowMaxValuesCount).toHaveBeenCalledWith(0);
|
|
256
256
|
});
|
|
257
257
|
it('should generate id for each row from rowValue if getIdFromRowValue is provided', function () {
|
|
258
258
|
var rowValues = [
|
|
@@ -75,7 +75,7 @@ describe('useCollapsibleTableRows tests', function () {
|
|
|
75
75
|
var _a = getCollapsibleTableRows(), result = _a.result, rerender = _a.rerender;
|
|
76
76
|
dataHelpers.getMaxRowValuesCount.mockReturnValueOnce(3);
|
|
77
77
|
expect(result.current.collapseContextValue.getIsRowCollapsible(rowsData[0])).toBe(true);
|
|
78
|
-
expect(dataHelpers.getMaxRowValuesCount).
|
|
78
|
+
expect(dataHelpers.getMaxRowValuesCount).toHaveBeenCalledWith(columnsData, rowsData[0]);
|
|
79
79
|
rerender(__assign(__assign({}, initialProps), { maxRowValuesCount: 4 }));
|
|
80
80
|
expect(result.current.collapseContextValue.getIsRowCollapsible(rowsData[0])).toBe(false);
|
|
81
81
|
});
|
|
@@ -11,9 +11,8 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
};
|
|
12
12
|
import React from 'react';
|
|
13
13
|
import { curryN } from 'ramda';
|
|
14
|
-
import * as mdmSdk from '@reltio/mdm-sdk';
|
|
15
14
|
import { renderHook } from '@testing-library/react-hooks';
|
|
16
|
-
import { ConfigPermissions } from '@reltio/mdm-sdk';
|
|
15
|
+
import { ConfigPermissions, checkConfigPermission } from '@reltio/mdm-sdk';
|
|
17
16
|
import { MdmModuleProvider } from '../../contexts/MdmModuleContext';
|
|
18
17
|
import { useConfigPermissions } from './useConfigPermissions';
|
|
19
18
|
jest.mock('@reltio/mdm-sdk', function () { return (__assign(__assign({}, jest.requireActual('@reltio/mdm-sdk')), { checkConfigPermission: jest.fn() })); });
|
|
@@ -30,17 +29,17 @@ var setUp = function () {
|
|
|
30
29
|
describe('useConfigPermissions behaviour', function () {
|
|
31
30
|
var checkConfigPermissionMock = jest.fn();
|
|
32
31
|
beforeAll(function () {
|
|
33
|
-
|
|
32
|
+
checkConfigPermission.mockImplementation(curryN(3, checkConfigPermissionMock));
|
|
34
33
|
});
|
|
35
34
|
it('should return correct functions', function () {
|
|
36
35
|
var _a = setUp(), canCreate = _a.canCreate, canRead = _a.canRead, canUpdate = _a.canUpdate, canDelete = _a.canDelete;
|
|
37
36
|
canCreate(config);
|
|
38
|
-
expect(checkConfigPermissionMock).
|
|
37
|
+
expect(checkConfigPermissionMock).toHaveBeenCalledWith(ConfigPermissions.CREATE, roles, config);
|
|
39
38
|
canRead(config);
|
|
40
|
-
expect(checkConfigPermissionMock).
|
|
39
|
+
expect(checkConfigPermissionMock).toHaveBeenCalledWith(ConfigPermissions.READ, roles, config);
|
|
41
40
|
canUpdate(config);
|
|
42
|
-
expect(checkConfigPermissionMock).
|
|
41
|
+
expect(checkConfigPermissionMock).toHaveBeenCalledWith(ConfigPermissions.UPDATE, roles, config);
|
|
43
42
|
canDelete(config);
|
|
44
|
-
expect(checkConfigPermissionMock).
|
|
43
|
+
expect(checkConfigPermissionMock).toHaveBeenCalledWith(ConfigPermissions.DELETE, roles, config);
|
|
45
44
|
});
|
|
46
45
|
});
|
|
@@ -165,11 +165,11 @@ describe('useCustomScripts', function () {
|
|
|
165
165
|
method: 'GET',
|
|
166
166
|
url: 'https://tst-01.reltio.com/reltio/api/uitest1/entities/1Ms5ANeR?options=sendHidden%2CaddRefAttrUriToCrosswalk'
|
|
167
167
|
});
|
|
168
|
-
return [4 /*yield*/, waitFor(function () { return expect(fetch).
|
|
168
|
+
return [4 /*yield*/, waitFor(function () { return expect(fetch).toHaveBeenCalledTimes(2); })];
|
|
169
169
|
case 1:
|
|
170
170
|
_b.sent();
|
|
171
|
-
expect(fetch).
|
|
172
|
-
expect(fetch).
|
|
171
|
+
expect(fetch).toHaveBeenCalledWith('https://tst-01.reltio.com/nui/services/getTokenForWorker', { method: 'GET' });
|
|
172
|
+
expect(fetch).toHaveBeenCalledWith('/nui/reltioAPI/api/uitest1/entities/1Ms5ANeR?options=sendHidden%2CaddRefAttrUriToCrosswalk', {
|
|
173
173
|
body: undefined,
|
|
174
174
|
headers: {
|
|
175
175
|
'Content-Type': 'application/json',
|
|
@@ -234,7 +234,7 @@ describe('useCustomScripts', function () {
|
|
|
234
234
|
method: 'GET',
|
|
235
235
|
url: 'https://tst-01.reltio.com/reltio/api/uitest1/entities/1Ms5ANeR?options=sendHidden%2CaddRefAttrUriToCrosswalk'
|
|
236
236
|
});
|
|
237
|
-
return [4 /*yield*/, waitFor(function () { return expect(fetch).
|
|
237
|
+
return [4 /*yield*/, waitFor(function () { return expect(fetch).toHaveBeenCalledTimes(2); })];
|
|
238
238
|
case 1:
|
|
239
239
|
_a.sent();
|
|
240
240
|
return [2 /*return*/];
|
|
@@ -273,11 +273,11 @@ describe('useCustomScripts', function () {
|
|
|
273
273
|
method: 'GET',
|
|
274
274
|
url: 'https://tst-01.reltio.com/reltio/api/uitest1/entities/1Ms5ANeR?options=sendHidden%2CaddRefAttrUriToCrosswalk'
|
|
275
275
|
});
|
|
276
|
-
return [4 /*yield*/, waitFor(function () { return expect(fetch).
|
|
276
|
+
return [4 /*yield*/, waitFor(function () { return expect(fetch).toHaveBeenCalledTimes(2); })];
|
|
277
277
|
case 1:
|
|
278
278
|
_b.sent();
|
|
279
|
-
expect(fetch).
|
|
280
|
-
expect(fetch).
|
|
279
|
+
expect(fetch).toHaveBeenCalledWith('https://tst-01.reltio.com/nui/services/getTokenForWorker', { method: 'GET' });
|
|
280
|
+
expect(fetch).toHaveBeenCalledWith('/nui/reltioAPI/api/uitest1/entities/1Ms5ANeR?options=sendHidden%2CaddRefAttrUriToCrosswalk', {
|
|
281
281
|
body: undefined,
|
|
282
282
|
headers: {
|
|
283
283
|
'Content-Type': 'application/json',
|
|
@@ -394,7 +394,7 @@ describe('useCustomScripts', function () {
|
|
|
394
394
|
act(function () {
|
|
395
395
|
onmessageFromWorker({ action: CustomAction.MESSAGE, params: message });
|
|
396
396
|
});
|
|
397
|
-
expect(showSnackbarMessage).
|
|
397
|
+
expect(showSnackbarMessage).toHaveBeenCalledWith(message);
|
|
398
398
|
});
|
|
399
399
|
it('should not intercept request or response, if url is not process to api', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
400
400
|
var response;
|
|
@@ -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 { useLayoutResetter } from './useLayoutResetter';
|
|
52
52
|
describe('useLayoutResetter tests', function () {
|
|
@@ -58,8 +58,9 @@ describe('useLayoutResetter tests', function () {
|
|
|
58
58
|
React.createElement("button", { onClick: resetLayout }, "Reset"),
|
|
59
59
|
React.createElement(SnackbarRenderer, null)));
|
|
60
60
|
};
|
|
61
|
-
var setUp = function () {
|
|
62
|
-
|
|
61
|
+
var setUp = function (userOptions) {
|
|
62
|
+
if (userOptions === void 0) { userOptions = {}; }
|
|
63
|
+
var user = userEvent.setup(userOptions);
|
|
63
64
|
return __assign({ user: user }, render(React.createElement(TestComponent, null)));
|
|
64
65
|
};
|
|
65
66
|
it('should call onLayoutReset and show snackbar on resetLayout', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -104,15 +105,14 @@ describe('useLayoutResetter tests', function () {
|
|
|
104
105
|
switch (_a.label) {
|
|
105
106
|
case 0:
|
|
106
107
|
jest.useFakeTimers();
|
|
107
|
-
user = setUp().user;
|
|
108
|
+
user = setUp({ advanceTimers: jest.advanceTimersByTime }).user;
|
|
108
109
|
return [4 /*yield*/, user.click(screen.getByRole('button', { name: 'Reset' }))];
|
|
109
110
|
case 1:
|
|
110
111
|
_a.sent();
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
jest.runAllTimers();
|
|
112
|
+
act(function () {
|
|
113
|
+
jest.advanceTimersByTime(5000);
|
|
114
|
+
});
|
|
115
|
+
expect(screen.queryByRole('alert')).not.toBeInTheDocument();
|
|
116
116
|
jest.useRealTimers();
|
|
117
117
|
return [2 /*return*/];
|
|
118
118
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { isOv } from '@reltio/mdm-sdk';
|
|
2
|
-
import { hasMaskingByUris } from '@reltio/mdm-sdk';
|
|
1
|
+
import { isOv, hasMaskingByUris } from '@reltio/mdm-sdk';
|
|
3
2
|
import { both, gt, lt, path, pipe, is, identity, zipWith } from 'ramda';
|
|
4
3
|
var getAttributeValue = function (attr) {
|
|
5
4
|
var value = attr.label || attr.value || '';
|
|
@@ -47,8 +47,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
47
47
|
};
|
|
48
48
|
import React from 'react';
|
|
49
49
|
import { renderHook } from '@testing-library/react-hooks';
|
|
50
|
-
import
|
|
51
|
-
import { SearchOperator } from '@reltio/mdm-sdk';
|
|
50
|
+
import { SearchOperator, buildReadableQueryToString, buildReadableQuery, getKeywordFromSearchState, getUnresolvedLookupsListFromSearchGroups, resolveLookupsList, getGroupsFromSearchState } from '@reltio/mdm-sdk';
|
|
52
51
|
import { MdmModuleProvider } from '../../contexts/MdmModuleContext';
|
|
53
52
|
import { useReadableSearchState } from './useReadableSearchState';
|
|
54
53
|
jest.mock('@reltio/mdm-sdk', function () { return (__assign(__assign({}, jest.requireActual('@reltio/mdm-sdk')), { buildReadableQueryToString: jest.fn(), buildReadableQuery: jest.fn(), getKeywordFromSearchState: jest.fn(), getUnresolvedLookupsListFromSearchGroups: jest.fn(), resolveLookupsList: jest.fn(), getGroupsFromSearchState: jest.fn() })); });
|
|
@@ -69,12 +68,6 @@ var setUp = function (searchState) {
|
|
|
69
68
|
return renderHook(useReadableSearchState, { wrapper: Providers, initialProps: searchState });
|
|
70
69
|
};
|
|
71
70
|
describe('useReadableSearchState tests', function () {
|
|
72
|
-
var buildReadableQueryToString = jest.spyOn(mdmSdk, 'buildReadableQueryToString');
|
|
73
|
-
var buildReadableQuery = jest.spyOn(mdmSdk, 'buildReadableQuery');
|
|
74
|
-
var getKeywordFromSearchState = jest.spyOn(mdmSdk, 'getKeywordFromSearchState');
|
|
75
|
-
var getUnresolvedLookupsListFromSearchGroups = jest.spyOn(mdmSdk, 'getUnresolvedLookupsListFromSearchGroups');
|
|
76
|
-
var resolveLookupsList = jest.spyOn(mdmSdk, 'resolveLookupsList');
|
|
77
|
-
var getGroupsFromSearchState = jest.spyOn(mdmSdk, 'getGroupsFromSearchState');
|
|
78
71
|
afterEach(function () {
|
|
79
72
|
jest.clearAllMocks();
|
|
80
73
|
});
|
|
@@ -112,12 +105,12 @@ describe('useReadableSearchState tests', function () {
|
|
|
112
105
|
buildReadableQuery.mockReturnValue(readableQueryPrimitives);
|
|
113
106
|
var searchState = { version: '2.0', facets: [], map: map };
|
|
114
107
|
var result = setUp(searchState).result;
|
|
115
|
-
expect(getKeywordFromSearchState).
|
|
116
|
-
expect(getGroupsFromSearchState).
|
|
117
|
-
expect(getUnresolvedLookupsListFromSearchGroups).
|
|
118
|
-
expect(buildReadableQueryToString).
|
|
119
|
-
expect(buildReadableQuery).
|
|
120
|
-
expect(resolveLookupsList).not.
|
|
108
|
+
expect(getKeywordFromSearchState).toHaveBeenCalledWith(searchState);
|
|
109
|
+
expect(getGroupsFromSearchState).toHaveBeenCalledWith(metadata, dataTenants, true, searchState);
|
|
110
|
+
expect(getUnresolvedLookupsListFromSearchGroups).toHaveBeenCalledWith(groups, lookups);
|
|
111
|
+
expect(buildReadableQueryToString).toHaveBeenCalledWith(metadata, attributesPresentation, lookups, groups, keyword, map);
|
|
112
|
+
expect(buildReadableQuery).toHaveBeenCalledWith(metadata, attributesPresentation, lookups, groups, keyword, map);
|
|
113
|
+
expect(resolveLookupsList).not.toHaveBeenCalled();
|
|
121
114
|
expect(result.current).toEqual({
|
|
122
115
|
readableQueryString: searchStateString,
|
|
123
116
|
readableQuery: readableQueryPrimitives
|
|
@@ -137,7 +130,7 @@ describe('useReadableSearchState tests', function () {
|
|
|
137
130
|
resolveLookupsList.mockResolvedValue(lookupsList);
|
|
138
131
|
searchState = { version: '2.0', facets: [] };
|
|
139
132
|
waitFor = setUp(searchState).waitFor;
|
|
140
|
-
expect(resolveLookupsList).
|
|
133
|
+
expect(resolveLookupsList).toHaveBeenCalledWith([
|
|
141
134
|
{ type: 'COUNTRY_CD', codeValue: 'RU' },
|
|
142
135
|
{ type: 'COUNTRY_CD', codeValue: 'IT' }
|
|
143
136
|
]);
|
|
@@ -47,8 +47,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
47
47
|
};
|
|
48
48
|
import React, { useState } from 'react';
|
|
49
49
|
import { renderHook, act } from '@testing-library/react-hooks';
|
|
50
|
-
import { getRelationsForEntity } from '@reltio/mdm-sdk';
|
|
51
|
-
import { ActivityFilter, Mode } from '@reltio/mdm-sdk';
|
|
50
|
+
import { ActivityFilter, Mode, getRelationsForEntity } from '@reltio/mdm-sdk';
|
|
52
51
|
import { MdmModuleProvider } from '../../contexts/MdmModuleContext';
|
|
53
52
|
import { useRelationsLoader } from './useRelationsLoader';
|
|
54
53
|
jest.mock('@reltio/mdm-sdk', function () { return (__assign(__assign({}, jest.requireActual('@reltio/mdm-sdk')), { getRelationsForEntity: jest.fn() })); });
|
|
@@ -178,7 +178,7 @@ describe('useSavedStateForEntityType test', function () {
|
|
|
178
178
|
}); })];
|
|
179
179
|
case 1:
|
|
180
180
|
_b.sent();
|
|
181
|
-
expect(initialProps.saveState).
|
|
181
|
+
expect(initialProps.saveState).toHaveBeenCalledWith((_a = {},
|
|
182
182
|
_a[entityTypeUri] = {
|
|
183
183
|
visibleColumns: ['new']
|
|
184
184
|
},
|
|
@@ -206,7 +206,7 @@ describe('useSavedStateForEntityType test', function () {
|
|
|
206
206
|
}); })];
|
|
207
207
|
case 1:
|
|
208
208
|
_a.sent();
|
|
209
|
-
expect(initialProps.saveState).not.
|
|
209
|
+
expect(initialProps.saveState).not.toHaveBeenCalled();
|
|
210
210
|
return [2 /*return*/];
|
|
211
211
|
}
|
|
212
212
|
});
|
|
@@ -231,7 +231,7 @@ describe('useSavedStateForEntityType test', function () {
|
|
|
231
231
|
}); })];
|
|
232
232
|
case 1:
|
|
233
233
|
_d.sent();
|
|
234
|
-
expect(initialProps.saveState).
|
|
234
|
+
expect(initialProps.saveState).toHaveBeenCalledWith((_b = {},
|
|
235
235
|
_b[entityTypeUri] = {
|
|
236
236
|
visibleColumns: ['new']
|
|
237
237
|
},
|
|
@@ -248,7 +248,7 @@ describe('useSavedStateForEntityType test', function () {
|
|
|
248
248
|
}); })];
|
|
249
249
|
case 2:
|
|
250
250
|
_d.sent();
|
|
251
|
-
expect(initialProps.saveState).
|
|
251
|
+
expect(initialProps.saveState).toHaveBeenCalledWith((_c = {},
|
|
252
252
|
_c[entityTypeUri] = {
|
|
253
253
|
visibleColumns: ['new']
|
|
254
254
|
},
|
|
@@ -83,7 +83,7 @@ describe('useScrollToAttributeError behavior', function () {
|
|
|
83
83
|
result = setUp({ highlightedError: highlightedError }).result;
|
|
84
84
|
expect(result.current.ref).toBeTruthy();
|
|
85
85
|
expect(result.current.errorClassName).toBe('highlightError');
|
|
86
|
-
expect(scrollIntoRefSpy).
|
|
86
|
+
expect(scrollIntoRefSpy).toHaveBeenCalledTimes(1);
|
|
87
87
|
return [2 /*return*/];
|
|
88
88
|
});
|
|
89
89
|
}); });
|