@reltio/components 1.4.2269 → 1.4.2272
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/ActionButton/ActionButton.d.ts +1 -1
- package/ActionButton/ActionButton.js +1 -1
- package/ActionsPanel/types.d.ts +1 -1
- package/AsyncReactSelect/AsyncReactSelect.d.ts +1 -5
- package/AttributesFiltersBuilder/AttributesFiltersBuilder.js +2 -1
- package/AttributesFiltersButton/AttributesFiltersButton.js +1 -1
- package/AttributesValuesEditor/AttributesValuesEditor.js +3 -1
- package/AutoSizeList/AutoSizeList.js +1 -1
- package/BasicAttributeSelector/BasicAttributeSelector.js +1 -1
- package/BasicView/BasicView.d.ts +2 -10
- package/BubbleChart/BubbleChart.d.ts +1 -4
- package/CloudChart/CloudChart.d.ts +1 -4
- package/CollaborationItem/CollaborationItem.js +1 -1
- package/CollaborationItem/components/Comment/Comment.js +1 -1
- package/CollaborationItem/components/RepliedComment/RepliedComment.js +1 -1
- package/ConfigureColumnsPopup/ConfigureColumnsPopup.js +2 -1
- package/CreatableReactSelect/CreatableReactSelect.d.ts +1 -5
- package/DataTypeValueEditor/useEditorContext.test.js +1 -1
- package/DependentLookupEditor/styles.d.ts +1 -1
- package/DropDownMenuButton/DropDownMenuButton.d.ts +1 -1
- package/DropDownMenuButton/DropDownMenuButton.js +4 -2
- package/DropDownSelector/DropDownSelector.js +2 -1
- package/EditModeAttributesFactory/components/EditModeAttribute/EditModeAttribute.d.ts +4 -2
- package/EditModeAttributesList/EditModeAttributesList.d.ts +3 -2
- package/EmptyState/styles.d.ts +1 -1
- package/EntitySelector/EntitySelector.js +3 -1
- package/EntityUriLink/EntityUriLink.d.ts +4 -2
- package/ErrorBoundary/ErrorBoundary.d.ts +1 -0
- package/ExpandedValueTooltip/ExpandedValueTooltip.js +1 -1
- package/FacetsSelector/components/AttributeSelectorPopup/AttributeSelectorPopup.js +1 -1
- package/GaugeChart/GaugeChart.js +1 -1
- package/HOCs/withAsyncMount/withAsyncMount.js +2 -1
- package/HOCs/withReactSelectMuiSkin/components/ReactSelectControl/ReactSelectControl.js +2 -1
- package/HOCs/withReactSelectMuiSkin/styles.d.ts +1 -1
- package/HOCs/withReactSelectMuiSkin/withReactSelectMuiSkin.d.ts +1 -5
- package/HOCs/withReactSelectMuiSkin/withReactSelectMuiSkin.js +3 -6
- package/HierarchyNodeTitle/useEntityDetails.test.js +1 -1
- package/ImageActionsOverlay/styles.d.ts +1 -1
- package/ImageAttributesLine/ImageAttributesLine.js +1 -1
- package/ImageDetailsView/components/MetaInfo/useEditMetaInfo.d.ts +9 -2
- package/InlineSimpleAttribute/InlineSimpleAttribute.js +1 -1
- package/MapChart/MapChart.d.ts +5 -4
- package/MetadataTypesSelector/MetadataTypesSelector.js +1 -1
- package/MetadataTypesSelector/components/ListLabel/ListLabel.js +1 -1
- package/MoreAttributesButton/MoreAttributesButton.js +1 -1
- package/MultiSelect/MultiSelect.d.ts +22 -40
- package/MultiSelect/MultiSelect.js +8 -18
- package/MultiSelect/styles.d.ts +1 -1
- package/MultiValueSelector/MultiValueSelector.js +3 -1
- package/PieChart/PieChart.d.ts +1 -5
- package/Popper/Popper.d.ts +5 -9
- package/Popper/Popper.js +5 -5
- package/PopupWithArrow/PopupWithArrow.d.ts +2 -1
- package/ProfileBandNavigation/useSearchNavigation.test.js +123 -123
- package/ProfilesList/ProfilesList.d.ts +1 -1
- package/RCTree/RCTree.d.ts +3 -4
- package/RCTree/RCTree.js +10 -2
- package/RCTree/RCTreeSwitchRenderer.d.ts +4 -4
- package/RCTree/index.d.ts +1 -0
- package/RCTree/types.d.ts +2 -0
- package/RCTree/useDelayedDragEventCall.d.ts +4 -1
- package/RCTree/useDnd.js +20 -9
- package/ReactSelect/ReactSelect.d.ts +1 -5
- package/ReactSortableTree/ReactSortableTree.js +0 -2
- package/ReactSortableTree/components/NodeRendererDefault/NodeRendererDefault.d.ts +36 -64
- package/ReactSortableTree/components/NodeRendererDefault/NodeRendererDefault.js +8 -18
- package/ReactSortableTree/components/PlaceholderRendererDefault/PlaceholderRendererDefault.d.ts +4 -10
- package/ReactSortableTree/components/PlaceholderRendererDefault/PlaceholderRendererDefault.js +1 -5
- package/ReactSortableTree/components/TreeNode/TreeNode.d.ts +23 -37
- package/ReactSortableTree/components/TreeNode/TreeNode.js +4 -10
- package/ReltioGridLayout/ReltioGridLayout.js +1 -1
- package/ReltioGridLayout/ReltioGridLayout.test.js +3 -3
- package/ResizablePanes/ResizablePanes.js +1 -1
- package/RowCellAutoSizer/RowCellAutoSizer.js +1 -1
- package/SegmentIdLink/SegmentIdLink.d.ts +4 -2
- package/SidePanelEmptyState/styles.d.ts +1 -1
- package/SimpleAttributeEditor/SimpleAttributeEditor.d.ts +6 -11
- package/SimpleAttributeEditor/styles.d.ts +1 -1
- package/SimpleAttributeEditor/useAutopopulationContextValue.test.js +1 -1
- package/SimpleDropDownSelector/styles.d.ts +1 -1
- package/SmallIconButton/SmallIconButton.d.ts +4 -2
- package/SyncedValueHeight/ValueHeightReporter.js +1 -1
- package/UploadFileButton/components/UploadMode/UploadMode.js +1 -1
- package/UserSelector/UserSelector.js +1 -1
- package/VirtualGroupedList/useScrollToFocusItem.d.ts +4 -1
- package/VirtualGroupedList/useScrollToFocusItem.test.js +1 -1
- package/cjs/ActionButton/ActionButton.d.ts +1 -1
- package/cjs/ActionButton/ActionButton.js +1 -1
- package/cjs/ActionsPanel/types.d.ts +1 -1
- package/cjs/AsyncReactSelect/AsyncReactSelect.d.ts +1 -5
- package/cjs/AttributesFiltersBuilder/AttributesFiltersBuilder.js +2 -1
- package/cjs/AttributesFiltersButton/AttributesFiltersButton.js +1 -1
- package/cjs/AttributesValuesEditor/AttributesValuesEditor.js +3 -1
- package/cjs/AutoSizeList/AutoSizeList.js +1 -1
- package/cjs/BasicAttributeSelector/BasicAttributeSelector.js +1 -1
- package/cjs/BasicView/BasicView.d.ts +2 -10
- package/cjs/BubbleChart/BubbleChart.d.ts +1 -4
- package/cjs/CloudChart/CloudChart.d.ts +1 -4
- package/cjs/CollaborationItem/CollaborationItem.js +1 -1
- package/cjs/CollaborationItem/components/Comment/Comment.js +1 -1
- package/cjs/CollaborationItem/components/RepliedComment/RepliedComment.js +1 -1
- package/cjs/ConfigureColumnsPopup/ConfigureColumnsPopup.js +2 -1
- package/cjs/CreatableReactSelect/CreatableReactSelect.d.ts +1 -5
- package/cjs/DataTypeValueEditor/useEditorContext.test.js +2 -2
- package/cjs/DependentLookupEditor/styles.d.ts +1 -1
- package/cjs/DropDownMenuButton/DropDownMenuButton.d.ts +1 -1
- package/cjs/DropDownMenuButton/DropDownMenuButton.js +4 -2
- package/cjs/DropDownSelector/DropDownSelector.js +2 -1
- package/cjs/EditModeAttributesFactory/components/EditModeAttribute/EditModeAttribute.d.ts +4 -2
- package/cjs/EditModeAttributesList/EditModeAttributesList.d.ts +3 -2
- package/cjs/EmptyState/styles.d.ts +1 -1
- package/cjs/EntitySelector/EntitySelector.js +3 -1
- package/cjs/EntityUriLink/EntityUriLink.d.ts +4 -2
- package/cjs/ErrorBoundary/ErrorBoundary.d.ts +1 -0
- package/cjs/ExpandedValueTooltip/ExpandedValueTooltip.js +1 -1
- package/cjs/FacetsSelector/components/AttributeSelectorPopup/AttributeSelectorPopup.js +1 -1
- package/cjs/GaugeChart/GaugeChart.js +1 -1
- package/cjs/HOCs/withAsyncMount/withAsyncMount.js +2 -1
- package/cjs/HOCs/withReactSelectMuiSkin/components/ReactSelectControl/ReactSelectControl.js +2 -1
- package/cjs/HOCs/withReactSelectMuiSkin/styles.d.ts +1 -1
- package/cjs/HOCs/withReactSelectMuiSkin/withReactSelectMuiSkin.d.ts +1 -5
- package/cjs/HOCs/withReactSelectMuiSkin/withReactSelectMuiSkin.js +3 -6
- package/cjs/HierarchyNodeTitle/useEntityDetails.test.js +18 -18
- package/cjs/ImageActionsOverlay/styles.d.ts +1 -1
- package/cjs/ImageAttributesLine/ImageAttributesLine.js +1 -1
- package/cjs/ImageDetailsView/components/MetaInfo/useEditMetaInfo.d.ts +9 -2
- package/cjs/InlineSimpleAttribute/InlineSimpleAttribute.js +1 -1
- package/cjs/MapChart/MapChart.d.ts +5 -4
- package/cjs/MetadataTypesSelector/MetadataTypesSelector.js +1 -1
- package/cjs/MetadataTypesSelector/components/ListLabel/ListLabel.js +1 -1
- package/cjs/MoreAttributesButton/MoreAttributesButton.js +1 -1
- package/cjs/MultiSelect/MultiSelect.d.ts +22 -40
- package/cjs/MultiSelect/MultiSelect.js +7 -17
- package/cjs/MultiSelect/styles.d.ts +1 -1
- package/cjs/MultiValueSelector/MultiValueSelector.js +3 -1
- package/cjs/PieChart/PieChart.d.ts +1 -5
- package/cjs/Popper/Popper.d.ts +5 -9
- package/cjs/Popper/Popper.js +5 -5
- package/cjs/PopupWithArrow/PopupWithArrow.d.ts +2 -1
- package/cjs/ProfileBandNavigation/useSearchNavigation.test.js +177 -177
- package/cjs/ProfilesList/ProfilesList.d.ts +1 -1
- package/cjs/RCTree/RCTree.d.ts +3 -4
- package/cjs/RCTree/RCTree.js +10 -2
- package/cjs/RCTree/RCTreeSwitchRenderer.d.ts +4 -4
- package/cjs/RCTree/index.d.ts +1 -0
- package/cjs/RCTree/types.d.ts +2 -0
- package/cjs/RCTree/useDelayedDragEventCall.d.ts +4 -1
- package/cjs/RCTree/useDnd.js +19 -8
- package/cjs/ReactSelect/ReactSelect.d.ts +1 -5
- package/cjs/ReactSortableTree/ReactSortableTree.js +0 -2
- package/cjs/ReactSortableTree/components/NodeRendererDefault/NodeRendererDefault.d.ts +36 -64
- package/cjs/ReactSortableTree/components/NodeRendererDefault/NodeRendererDefault.js +8 -18
- package/cjs/ReactSortableTree/components/PlaceholderRendererDefault/PlaceholderRendererDefault.d.ts +4 -10
- package/cjs/ReactSortableTree/components/PlaceholderRendererDefault/PlaceholderRendererDefault.js +1 -5
- package/cjs/ReactSortableTree/components/TreeNode/TreeNode.d.ts +23 -37
- package/cjs/ReactSortableTree/components/TreeNode/TreeNode.js +4 -10
- package/cjs/ReltioGridLayout/ReltioGridLayout.js +1 -1
- package/cjs/ReltioGridLayout/ReltioGridLayout.test.js +3 -3
- package/cjs/ResizablePanes/ResizablePanes.js +1 -1
- package/cjs/RowCellAutoSizer/RowCellAutoSizer.js +1 -1
- package/cjs/SegmentIdLink/SegmentIdLink.d.ts +4 -2
- package/cjs/SidePanelEmptyState/styles.d.ts +1 -1
- package/cjs/SimpleAttributeEditor/SimpleAttributeEditor.d.ts +6 -11
- package/cjs/SimpleAttributeEditor/styles.d.ts +1 -1
- package/cjs/SimpleAttributeEditor/useAutopopulationContextValue.test.js +2 -2
- package/cjs/SimpleDropDownSelector/styles.d.ts +1 -1
- package/cjs/SmallIconButton/SmallIconButton.d.ts +4 -2
- package/cjs/SyncedValueHeight/ValueHeightReporter.js +1 -1
- package/cjs/UploadFileButton/components/UploadMode/UploadMode.js +1 -1
- package/cjs/UserSelector/UserSelector.js +1 -1
- package/cjs/VirtualGroupedList/useScrollToFocusItem.d.ts +4 -1
- package/cjs/VirtualGroupedList/useScrollToFocusItem.test.js +5 -5
- package/cjs/contexts/AutoExpandedAttributesContext/useAttributeAutoExpanded.test.js +2 -2
- package/cjs/contexts/ReloadDataContext/ReloadDataContext.spec.js +4 -4
- package/cjs/features/activity-log/ActivityFilterButton/ActivityFilterButton.js +1 -1
- package/cjs/features/crosswalks/AttributesTable/AttributesTable.test.js +10 -3
- package/cjs/features/crosswalks/CrosswalkAttributes/CrosswalkAttributes.test.js +11 -6
- package/cjs/features/crosswalks/CrosswalkEditor/CrosswalkEditor.test.js +15 -10
- package/cjs/features/crosswalks/CrosswalkRow/CrosswalkRow.test.js +11 -6
- package/cjs/features/crosswalks/hooks/useAttributeActions.test.js +26 -26
- package/cjs/features/crosswalks/hooks/useCrosswalkActions.test.js +12 -12
- package/cjs/features/crosswalks/hooks/useModifiedEntity.js +4 -4
- package/cjs/features/crosswalks/hooks/useModifiedEntity.test.js +17 -17
- package/cjs/features/graph/DataModelGraph/hooks/useDataModelGraphAppearance.test.js +17 -28
- package/cjs/features/graph/DataModelGraph/hooks/useEdgeLabelsRenderer.test.js +10 -10
- package/cjs/features/graph/DataModelGraph/hooks/useFakeCenterNode.test.js +3 -3
- package/cjs/features/graph/DataModelGraph/hooks/useSelectedNodeRenderer.test.js +4 -4
- package/cjs/features/graph/hooks/useLoopRenderer.test.js +3 -3
- package/cjs/features/graph/hooks/useSigmaCustomRenderers.test.js +28 -28
- package/cjs/features/history/HistoryFilterButton/HistoryFilterButton.js +1 -1
- package/cjs/features/history/hooks/useHistory.test.js +36 -36
- package/cjs/features/history/hooks/useHistoryDiff.test.js +2 -2
- package/cjs/features/history/hooks/useHistoryEnabled.test.js +2 -2
- package/cjs/features/history/hooks/useHistorySlice.test.js +8 -8
- package/cjs/features/history/hooks/useHistoryTree.test.js +2 -2
- package/cjs/features/workflow/AddWorkflowDialog/styles.d.ts +1 -1
- package/cjs/features/workflow/helpers/dcr.js +15 -14
- package/cjs/features/workflow/hooks/useChangeRequest.test.js +7 -7
- package/cjs/features/workflow/hooks/useWorkflowCheckPermission.test.js +2 -2
- package/cjs/features/workflow/hooks/useWorkflowColor.test.js +2 -2
- package/cjs/helpers/customScript.test.js +3 -3
- package/cjs/hooks/useAPI/useAPI.js +2 -2
- package/cjs/hooks/useAPI/useAPI.test.js +134 -134
- package/cjs/hooks/useChangedAttributes/useChangedAttributes.js +2 -2
- package/cjs/hooks/useCollaboration/useCollaboration.d.ts +47 -9
- package/cjs/hooks/useCollaboration/useCollaboration.js +10 -13
- package/cjs/hooks/useCollaboration/useCollaboration.test.js +55 -54
- package/cjs/hooks/useCollapsibleTableRows/useCollapsibleTableRows.test.js +8 -8
- package/cjs/hooks/useCommentsEntitiesMap/useCommentsEntitiesMap.test.js +10 -10
- package/cjs/hooks/useConfigPermissions/useConfigPermissions.test.js +2 -2
- package/cjs/hooks/useCustomScripts/useCustomScripts.test.js +25 -25
- package/cjs/hooks/useDndBasicTableScrollModifier/useDndBasicTableScrollModifier.js +1 -1
- package/cjs/hooks/useEditableConnection/useEditableConnection.test.js +2 -2
- package/cjs/hooks/useFilterAutoFocus/useFilterAutoFocus.d.ts +3 -3
- package/cjs/hooks/useHiddenAttributes/useHiddenAttributes.test.js +2 -2
- package/cjs/hooks/useHtmlSanitizer/useHtmlSanitizer.test.js +2 -2
- package/cjs/hooks/useKeyboardNavigation/useKeyboardNavigation.d.ts +1 -1
- package/cjs/hooks/useKeyboardNavigation/useKeyboardNavigation.test.js +3 -3
- package/cjs/hooks/useMatchesLoader/useMatchesLoader.test.js +24 -16
- package/cjs/hooks/usePrevious/usePrevious.js +1 -1
- package/cjs/hooks/useReadableSearchState/useReadableSearchState.test.js +5 -5
- package/cjs/hooks/useRelationsLoader/useRelationsLoader.test.js +50 -50
- package/cjs/hooks/useSavedSearchesRequest/useSavedSearchesRequest.test.js +36 -36
- package/cjs/hooks/useSavedStateForEntityType/useSavedStateForEntityType.test.js +20 -16
- package/cjs/hooks/useScrollToAttributeError/useScrollToAttributeError.test.js +3 -3
- package/cjs/hooks/useUsers/useUsers.test.js +14 -15
- package/cjs/hooks/useWhyDidYouUpdate/useWhyDidYouUpdate.js +1 -1
- package/cjs/test-utils/dndKit/DndContextComponent.js +3 -0
- package/cjs/test-utils/dndKit/index.d.ts +1 -0
- package/cjs/test-utils/dndKit/useDndMonitorProvider.d.ts +4 -1
- package/cjs/test-utils/dndKit/useDraggable.d.ts +1 -0
- package/cjs/test-utils/dndKit/useDraggable.js +8 -1
- package/cjs/test-utils/index.d.ts +1 -1
- package/cjs/test-utils/index.js +4 -1
- package/cjs/test-utils/mockStoreHooks.d.ts +4 -0
- package/cjs/test-utils/mockStoreHooks.js +21 -0
- package/cjs/utils/withChildrenProp.d.ts +10 -0
- package/cjs/utils/withChildrenProp.js +13 -0
- package/contexts/AutoExpandedAttributesContext/useAttributeAutoExpanded.test.js +1 -1
- package/contexts/ReloadDataContext/ReloadDataContext.spec.js +1 -1
- package/features/activity-log/ActivityFilterButton/ActivityFilterButton.js +1 -1
- package/features/crosswalks/AttributesTable/AttributesTable.test.js +11 -4
- package/features/crosswalks/CrosswalkAttributes/CrosswalkAttributes.test.js +11 -6
- package/features/crosswalks/CrosswalkEditor/CrosswalkEditor.test.js +15 -10
- package/features/crosswalks/CrosswalkRow/CrosswalkRow.test.js +11 -6
- package/features/crosswalks/hooks/useAttributeActions.test.js +1 -1
- package/features/crosswalks/hooks/useCrosswalkActions.test.js +1 -1
- package/features/crosswalks/hooks/useModifiedEntity.js +4 -4
- package/features/crosswalks/hooks/useModifiedEntity.test.js +1 -1
- package/features/graph/DataModelGraph/hooks/useDataModelGraphAppearance.test.js +14 -25
- package/features/graph/DataModelGraph/hooks/useEdgeLabelsRenderer.test.js +1 -1
- package/features/graph/DataModelGraph/hooks/useFakeCenterNode.test.js +1 -1
- package/features/graph/DataModelGraph/hooks/useSelectedNodeRenderer.test.js +1 -1
- package/features/graph/hooks/useLoopRenderer.test.js +1 -1
- package/features/graph/hooks/useSigmaCustomRenderers.test.js +1 -1
- package/features/history/HistoryFilterButton/HistoryFilterButton.js +1 -1
- package/features/history/hooks/useHistory.test.js +1 -1
- package/features/history/hooks/useHistoryDiff.test.js +1 -1
- package/features/history/hooks/useHistoryEnabled.test.js +1 -1
- package/features/history/hooks/useHistorySlice.test.js +1 -1
- package/features/history/hooks/useHistoryTree.test.js +1 -1
- package/features/workflow/AddWorkflowDialog/styles.d.ts +1 -1
- package/features/workflow/helpers/dcr.js +15 -14
- package/features/workflow/hooks/useChangeRequest.test.js +1 -1
- package/features/workflow/hooks/useWorkflowCheckPermission.test.js +1 -1
- package/features/workflow/hooks/useWorkflowColor.test.js +1 -1
- package/helpers/customScript.test.js +1 -1
- package/hooks/useAPI/useAPI.js +2 -2
- package/hooks/useAPI/useAPI.test.js +44 -44
- package/hooks/useChangedAttributes/useChangedAttributes.js +2 -2
- package/hooks/useCollaboration/useCollaboration.d.ts +47 -9
- package/hooks/useCollaboration/useCollaboration.js +10 -13
- package/hooks/useCollaboration/useCollaboration.test.js +3 -2
- package/hooks/useCollapsibleTableRows/useCollapsibleTableRows.test.js +1 -1
- package/hooks/useCommentsEntitiesMap/useCommentsEntitiesMap.test.js +1 -1
- package/hooks/useConfigPermissions/useConfigPermissions.test.js +1 -1
- package/hooks/useCustomScripts/useCustomScripts.test.js +11 -11
- package/hooks/useDndBasicTableScrollModifier/useDndBasicTableScrollModifier.js +1 -1
- package/hooks/useEditableConnection/useEditableConnection.test.js +1 -1
- package/hooks/useFilterAutoFocus/useFilterAutoFocus.d.ts +3 -3
- package/hooks/useHiddenAttributes/useHiddenAttributes.test.js +1 -1
- package/hooks/useHtmlSanitizer/useHtmlSanitizer.test.js +1 -1
- package/hooks/useKeyboardNavigation/useKeyboardNavigation.d.ts +1 -1
- package/hooks/useKeyboardNavigation/useKeyboardNavigation.test.js +1 -1
- package/hooks/useMatchesLoader/useMatchesLoader.test.js +23 -15
- package/hooks/usePrevious/usePrevious.js +1 -1
- package/hooks/useReadableSearchState/useReadableSearchState.test.js +3 -3
- package/hooks/useRelationsLoader/useRelationsLoader.test.js +38 -38
- package/hooks/useSavedSearchesRequest/useSavedSearchesRequest.test.js +1 -1
- package/hooks/useSavedStateForEntityType/useSavedStateForEntityType.test.js +7 -3
- package/hooks/useScrollToAttributeError/useScrollToAttributeError.test.js +1 -1
- package/hooks/useUsers/useUsers.test.js +12 -13
- package/hooks/useWhyDidYouUpdate/useWhyDidYouUpdate.js +1 -1
- package/package.json +5 -6
- package/test-utils/dndKit/DndContextComponent.js +3 -0
- package/test-utils/dndKit/index.d.ts +1 -0
- package/test-utils/dndKit/useDndMonitorProvider.d.ts +4 -1
- package/test-utils/dndKit/useDraggable.d.ts +1 -0
- package/test-utils/dndKit/useDraggable.js +8 -1
- package/test-utils/index.d.ts +1 -1
- package/test-utils/index.js +1 -0
- package/test-utils/mockStoreHooks.d.ts +4 -0
- package/test-utils/mockStoreHooks.js +16 -0
- package/utils/withChildrenProp.d.ts +10 -0
- package/utils/withChildrenProp.js +9 -0
|
@@ -46,7 +46,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
48
|
import React from 'react';
|
|
49
|
-
import { renderHook, act } from '@testing-library/react
|
|
49
|
+
import { renderHook, act, waitFor } from '@testing-library/react';
|
|
50
50
|
import * as helpers from './helpers';
|
|
51
51
|
import { useSearchNavigation } from './useSearchNavigation';
|
|
52
52
|
import { ActionsHookProvider } from '../contexts/ActionsHookContext';
|
|
@@ -183,17 +183,17 @@ describe('useSearchNavigation behavior', function () {
|
|
|
183
183
|
expect(searchProvider.requestTotal).not.toHaveBeenCalled();
|
|
184
184
|
});
|
|
185
185
|
it('should get prev entity uri from cache, check it and if it exists update navigation data', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
186
|
-
var
|
|
187
|
-
return __generator(this, function (
|
|
188
|
-
switch (
|
|
186
|
+
var result;
|
|
187
|
+
return __generator(this, function (_a) {
|
|
188
|
+
switch (_a.label) {
|
|
189
189
|
case 0:
|
|
190
|
-
|
|
190
|
+
result = setUp().result;
|
|
191
191
|
act(function () {
|
|
192
192
|
result.current.onPrev();
|
|
193
193
|
});
|
|
194
194
|
return [4 /*yield*/, waitFor(function () { return expect(result.current.isPrevDisabled).toBe(false); })];
|
|
195
195
|
case 1:
|
|
196
|
-
|
|
196
|
+
_a.sent();
|
|
197
197
|
expect(mdmActions.updateSearchNavigationDataFields).toHaveBeenCalledTimes(1);
|
|
198
198
|
expect(mdmActions.openEntity).toHaveBeenCalledTimes(1);
|
|
199
199
|
expect(mdmActions.updateSearchNavigationDataFields).toHaveBeenCalledWith({
|
|
@@ -213,13 +213,13 @@ describe('useSearchNavigation behavior', function () {
|
|
|
213
213
|
});
|
|
214
214
|
}); });
|
|
215
215
|
it('should set isPrevDisabled and isNextDisabled props as true and update entities navigation loading state during loading process', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
216
|
-
var searchNavigationData, mdmValues,
|
|
217
|
-
return __generator(this, function (
|
|
218
|
-
switch (
|
|
216
|
+
var searchNavigationData, mdmValues, result;
|
|
217
|
+
return __generator(this, function (_a) {
|
|
218
|
+
switch (_a.label) {
|
|
219
219
|
case 0:
|
|
220
220
|
searchNavigationData = __assign(__assign({}, defaultMdmValues.searchNavigationData), { index: 2 });
|
|
221
221
|
mdmValues = __assign(__assign({}, defaultMdmValues), { searchNavigationData: searchNavigationData });
|
|
222
|
-
|
|
222
|
+
result = setUp({ mdmValues: mdmValues }).result;
|
|
223
223
|
expect(result.current.isNextDisabled).toBe(false);
|
|
224
224
|
expect(result.current.isPrevDisabled).toBe(false);
|
|
225
225
|
act(function () {
|
|
@@ -230,19 +230,19 @@ describe('useSearchNavigation behavior', function () {
|
|
|
230
230
|
expect(updateEntitiesNavigationLoadingState).toHaveBeenCalledWith(true);
|
|
231
231
|
return [4 /*yield*/, waitFor(function () { return expect(result.current.isNextDisabled).toBe(false); })];
|
|
232
232
|
case 1:
|
|
233
|
-
|
|
233
|
+
_a.sent();
|
|
234
234
|
return [4 /*yield*/, waitFor(function () { return expect(result.current.isPrevDisabled).toBe(false); })];
|
|
235
235
|
case 2:
|
|
236
|
-
|
|
236
|
+
_a.sent();
|
|
237
237
|
expect(updateEntitiesNavigationLoadingState).toHaveBeenCalledWith(false);
|
|
238
238
|
return [2 /*return*/];
|
|
239
239
|
}
|
|
240
240
|
});
|
|
241
241
|
}); });
|
|
242
242
|
it('should get prev entity uri from cache, check it and, if it does not exist, try to check prev prev entity', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
243
|
-
var searchNavigationData, entity, mdmValues,
|
|
244
|
-
return __generator(this, function (
|
|
245
|
-
switch (
|
|
243
|
+
var searchNavigationData, entity, mdmValues, result;
|
|
244
|
+
return __generator(this, function (_a) {
|
|
245
|
+
switch (_a.label) {
|
|
246
246
|
case 0:
|
|
247
247
|
searchProvider.checkEntity.mockResolvedValueOnce(false);
|
|
248
248
|
searchProvider.checkEntity.mockResolvedValueOnce(true);
|
|
@@ -255,13 +255,13 @@ describe('useSearchNavigation behavior', function () {
|
|
|
255
255
|
};
|
|
256
256
|
entity = { uri: 'uri2' };
|
|
257
257
|
mdmValues = __assign(__assign({}, defaultMdmValues), { searchNavigationData: searchNavigationData, entity: entity });
|
|
258
|
-
|
|
258
|
+
result = setUp({ mdmValues: mdmValues }).result;
|
|
259
259
|
act(function () {
|
|
260
260
|
result.current.onPrev();
|
|
261
261
|
});
|
|
262
262
|
return [4 /*yield*/, waitFor(function () { return expect(result.current.isPrevDisabled).toBe(false); })];
|
|
263
263
|
case 1:
|
|
264
|
-
|
|
264
|
+
_a.sent();
|
|
265
265
|
expect(mdmActions.updateSearchNavigationDataFields).toHaveBeenCalledTimes(1);
|
|
266
266
|
expect(mdmActions.openEntity).toHaveBeenCalledTimes(1);
|
|
267
267
|
expect(mdmActions.updateSearchNavigationDataFields).toHaveBeenCalledWith({
|
|
@@ -283,9 +283,9 @@ describe('useSearchNavigation behavior', function () {
|
|
|
283
283
|
});
|
|
284
284
|
}); });
|
|
285
285
|
it('should stop process of checking entities if there are no more entities (index is 0)', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
286
|
-
var searchNavigationData, entity, mdmValues,
|
|
287
|
-
return __generator(this, function (
|
|
288
|
-
switch (
|
|
286
|
+
var searchNavigationData, entity, mdmValues, result;
|
|
287
|
+
return __generator(this, function (_a) {
|
|
288
|
+
switch (_a.label) {
|
|
289
289
|
case 0:
|
|
290
290
|
searchProvider.checkEntity.mockResolvedValue(false);
|
|
291
291
|
searchNavigationData = {
|
|
@@ -297,13 +297,13 @@ describe('useSearchNavigation behavior', function () {
|
|
|
297
297
|
};
|
|
298
298
|
entity = { uri: 'uri2' };
|
|
299
299
|
mdmValues = __assign(__assign({}, defaultMdmValues), { searchNavigationData: searchNavigationData, entity: entity });
|
|
300
|
-
|
|
300
|
+
result = setUp({ mdmValues: mdmValues }).result;
|
|
301
301
|
act(function () {
|
|
302
302
|
result.current.onPrev();
|
|
303
303
|
});
|
|
304
304
|
return [4 /*yield*/, waitFor(function () { return expect(result.current.isPrevDisabled).toBe(false); })];
|
|
305
305
|
case 1:
|
|
306
|
-
|
|
306
|
+
_a.sent();
|
|
307
307
|
expect(mdmActions.updateSearchNavigationDataFields).toHaveBeenCalledTimes(1);
|
|
308
308
|
expect(mdmActions.openEntity).toHaveBeenCalledTimes(0);
|
|
309
309
|
expect(mdmActions.updateSearchNavigationDataFields).toHaveBeenCalledWith({
|
|
@@ -323,9 +323,9 @@ describe('useSearchNavigation behavior', function () {
|
|
|
323
323
|
});
|
|
324
324
|
}); });
|
|
325
325
|
it('should request previous entities page and update total if there are no entities in cache before current', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
326
|
-
var searchNavigationData, entity, mdmValues,
|
|
327
|
-
return __generator(this, function (
|
|
328
|
-
switch (
|
|
326
|
+
var searchNavigationData, entity, mdmValues, result;
|
|
327
|
+
return __generator(this, function (_a) {
|
|
328
|
+
switch (_a.label) {
|
|
329
329
|
case 0:
|
|
330
330
|
searchProvider.requestTotal.mockResolvedValue(11);
|
|
331
331
|
searchProvider.requestEntities.mockResolvedValue([{ uri: 'uri0' }, { uri: 'uri1' }, { uri: 'uri2' }]);
|
|
@@ -338,13 +338,13 @@ describe('useSearchNavigation behavior', function () {
|
|
|
338
338
|
};
|
|
339
339
|
entity = { uri: 'uri3' };
|
|
340
340
|
mdmValues = __assign(__assign({}, defaultMdmValues), { searchNavigationData: searchNavigationData, entity: entity });
|
|
341
|
-
|
|
341
|
+
result = setUp({ mdmValues: mdmValues }).result;
|
|
342
342
|
act(function () {
|
|
343
343
|
result.current.onPrev();
|
|
344
344
|
});
|
|
345
345
|
return [4 /*yield*/, waitFor(function () { return expect(result.current.isPrevDisabled).toBe(false); })];
|
|
346
346
|
case 1:
|
|
347
|
-
|
|
347
|
+
_a.sent();
|
|
348
348
|
expect(mdmActions.updateSearchNavigationDataFields).toHaveBeenCalledTimes(2);
|
|
349
349
|
expect(mdmActions.openEntity).toHaveBeenCalledTimes(1);
|
|
350
350
|
expect(mdmActions.updateSearchNavigationDataFields).toHaveBeenCalledWith({
|
|
@@ -365,9 +365,9 @@ describe('useSearchNavigation behavior', function () {
|
|
|
365
365
|
});
|
|
366
366
|
}); });
|
|
367
367
|
it('should not add duplicates to cache if previous entities page contains them', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
368
|
-
var searchNavigationData, entity, mdmValues,
|
|
369
|
-
return __generator(this, function (
|
|
370
|
-
switch (
|
|
368
|
+
var searchNavigationData, entity, mdmValues, result;
|
|
369
|
+
return __generator(this, function (_a) {
|
|
370
|
+
switch (_a.label) {
|
|
371
371
|
case 0:
|
|
372
372
|
searchProvider.requestEntities.mockResolvedValue([{ uri: 'uri1' }, { uri: 'uri2' }, { uri: 'uri3' }]);
|
|
373
373
|
searchProvider.requestTotal.mockResolvedValue(11);
|
|
@@ -380,13 +380,13 @@ describe('useSearchNavigation behavior', function () {
|
|
|
380
380
|
};
|
|
381
381
|
entity = { uri: 'uri3' };
|
|
382
382
|
mdmValues = __assign(__assign({}, defaultMdmValues), { searchNavigationData: searchNavigationData, entity: entity });
|
|
383
|
-
|
|
383
|
+
result = setUp({ mdmValues: mdmValues }).result;
|
|
384
384
|
act(function () {
|
|
385
385
|
result.current.onPrev();
|
|
386
386
|
});
|
|
387
387
|
return [4 /*yield*/, waitFor(function () { return expect(result.current.isPrevDisabled).toBe(false); })];
|
|
388
388
|
case 1:
|
|
389
|
-
|
|
389
|
+
_a.sent();
|
|
390
390
|
expect(mdmActions.updateSearchNavigationDataFields).toHaveBeenCalledTimes(2);
|
|
391
391
|
expect(mdmActions.openEntity).toHaveBeenCalledTimes(1);
|
|
392
392
|
expect(mdmActions.updateSearchNavigationDataFields).toHaveBeenCalledWith({
|
|
@@ -407,9 +407,9 @@ describe('useSearchNavigation behavior', function () {
|
|
|
407
407
|
});
|
|
408
408
|
}); });
|
|
409
409
|
it('should request additional page if loaded entities page does not contain new entities', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
410
|
-
var searchNavigationData, entity, mdmValues,
|
|
411
|
-
return __generator(this, function (
|
|
412
|
-
switch (
|
|
410
|
+
var searchNavigationData, entity, mdmValues, result;
|
|
411
|
+
return __generator(this, function (_a) {
|
|
412
|
+
switch (_a.label) {
|
|
413
413
|
case 0:
|
|
414
414
|
searchProvider.requestEntities.mockResolvedValueOnce([{ uri: 'uri3' }, { uri: 'uri4' }, { uri: 'uri5' }]);
|
|
415
415
|
searchProvider.requestEntities.mockResolvedValueOnce([{ uri: 'uri1' }, { uri: 'uri2' }, { uri: 'uri3' }]);
|
|
@@ -423,13 +423,13 @@ describe('useSearchNavigation behavior', function () {
|
|
|
423
423
|
};
|
|
424
424
|
entity = { uri: 'uri3' };
|
|
425
425
|
mdmValues = __assign(__assign({}, defaultMdmValues), { searchNavigationData: searchNavigationData, entity: entity });
|
|
426
|
-
|
|
426
|
+
result = setUp({ mdmValues: mdmValues }).result;
|
|
427
427
|
act(function () {
|
|
428
428
|
result.current.onPrev();
|
|
429
429
|
});
|
|
430
430
|
return [4 /*yield*/, waitFor(function () { return expect(result.current.isPrevDisabled).toBe(false); })];
|
|
431
431
|
case 1:
|
|
432
|
-
|
|
432
|
+
_a.sent();
|
|
433
433
|
expect(mdmActions.updateSearchNavigationDataFields).toHaveBeenCalledTimes(3);
|
|
434
434
|
expect(mdmActions.openEntity).toHaveBeenCalledTimes(1);
|
|
435
435
|
expect(mdmActions.updateSearchNavigationDataFields).toHaveBeenCalledWith({
|
|
@@ -451,9 +451,9 @@ describe('useSearchNavigation behavior', function () {
|
|
|
451
451
|
});
|
|
452
452
|
}); });
|
|
453
453
|
it('should stop request additional pages if there are no more new entities according index', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
454
|
-
var searchNavigationData, entity, mdmValues,
|
|
455
|
-
return __generator(this, function (
|
|
456
|
-
switch (
|
|
454
|
+
var searchNavigationData, entity, mdmValues, result;
|
|
455
|
+
return __generator(this, function (_a) {
|
|
456
|
+
switch (_a.label) {
|
|
457
457
|
case 0:
|
|
458
458
|
searchProvider.requestEntities.mockResolvedValueOnce([{ uri: 'uri3' }, { uri: 'uri4' }, { uri: 'uri5' }]);
|
|
459
459
|
searchProvider.requestEntities.mockResolvedValueOnce([{ uri: 'uri3' }, { uri: 'uri4' }, { uri: 'uri5' }]);
|
|
@@ -468,13 +468,13 @@ describe('useSearchNavigation behavior', function () {
|
|
|
468
468
|
};
|
|
469
469
|
entity = { uri: 'uri3' };
|
|
470
470
|
mdmValues = __assign(__assign({}, defaultMdmValues), { searchNavigationData: searchNavigationData, entity: entity });
|
|
471
|
-
|
|
471
|
+
result = setUp({ mdmValues: mdmValues }).result;
|
|
472
472
|
act(function () {
|
|
473
473
|
result.current.onPrev();
|
|
474
474
|
});
|
|
475
475
|
return [4 /*yield*/, waitFor(function () { return expect(result.current.isPrevDisabled).toBe(false); })];
|
|
476
476
|
case 1:
|
|
477
|
-
|
|
477
|
+
_a.sent();
|
|
478
478
|
expect(mdmActions.updateSearchNavigationDataFields).toHaveBeenCalledTimes(3);
|
|
479
479
|
expect(mdmActions.openEntity).not.toHaveBeenCalled();
|
|
480
480
|
expect(mdmActions.updateSearchNavigationDataFields).toHaveBeenCalledWith({ index: 0 });
|
|
@@ -491,9 +491,9 @@ describe('useSearchNavigation behavior', function () {
|
|
|
491
491
|
});
|
|
492
492
|
}); });
|
|
493
493
|
it('should request previous entities page after unsuccessful entity checking if there are no more entities in cache', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
494
|
-
var searchNavigationData, entity, mdmValues,
|
|
495
|
-
return __generator(this, function (
|
|
496
|
-
switch (
|
|
494
|
+
var searchNavigationData, entity, mdmValues, result;
|
|
495
|
+
return __generator(this, function (_a) {
|
|
496
|
+
switch (_a.label) {
|
|
497
497
|
case 0:
|
|
498
498
|
searchProvider.checkEntity.mockResolvedValueOnce(false);
|
|
499
499
|
searchProvider.requestEntities.mockResolvedValueOnce([{ uri: 'uri0' }, { uri: 'uri1' }, { uri: 'uri2' }]);
|
|
@@ -507,13 +507,13 @@ describe('useSearchNavigation behavior', function () {
|
|
|
507
507
|
};
|
|
508
508
|
entity = { uri: 'uri4' };
|
|
509
509
|
mdmValues = __assign(__assign({}, defaultMdmValues), { searchNavigationData: searchNavigationData, entity: entity });
|
|
510
|
-
|
|
510
|
+
result = setUp({ mdmValues: mdmValues }).result;
|
|
511
511
|
act(function () {
|
|
512
512
|
result.current.onPrev();
|
|
513
513
|
});
|
|
514
514
|
return [4 /*yield*/, waitFor(function () { return expect(result.current.isPrevDisabled).toBe(false); })];
|
|
515
515
|
case 1:
|
|
516
|
-
|
|
516
|
+
_a.sent();
|
|
517
517
|
expect(mdmActions.updateSearchNavigationDataFields).toHaveBeenCalledTimes(2);
|
|
518
518
|
expect(mdmActions.openEntity).toHaveBeenCalledTimes(1);
|
|
519
519
|
expect(mdmActions.updateSearchNavigationDataFields).toHaveBeenCalledWith({
|
|
@@ -535,19 +535,19 @@ describe('useSearchNavigation behavior', function () {
|
|
|
535
535
|
});
|
|
536
536
|
}); });
|
|
537
537
|
it('should catch and handle checkEntity error when checking previous entity', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
538
|
-
var warnSpy,
|
|
539
|
-
return __generator(this, function (
|
|
540
|
-
switch (
|
|
538
|
+
var warnSpy, result;
|
|
539
|
+
return __generator(this, function (_a) {
|
|
540
|
+
switch (_a.label) {
|
|
541
541
|
case 0:
|
|
542
542
|
warnSpy = jest.spyOn(global.console, 'warn');
|
|
543
543
|
searchProvider.checkEntity.mockRejectedValue({ errorCode: 403, errorMessage: 'Access is denied' });
|
|
544
|
-
|
|
544
|
+
result = setUp().result;
|
|
545
545
|
act(function () {
|
|
546
546
|
result.current.onPrev();
|
|
547
547
|
});
|
|
548
548
|
return [4 /*yield*/, waitFor(function () { return expect(result.current.isPrevDisabled).toBe(false); })];
|
|
549
549
|
case 1:
|
|
550
|
-
|
|
550
|
+
_a.sent();
|
|
551
551
|
expect(warnSpy).toHaveBeenCalledWith("Can't load previous page of search", {
|
|
552
552
|
errorCode: 403,
|
|
553
553
|
errorMessage: 'Access is denied'
|
|
@@ -558,9 +558,9 @@ describe('useSearchNavigation behavior', function () {
|
|
|
558
558
|
});
|
|
559
559
|
}); });
|
|
560
560
|
it('should catch and handle requestTotal error when requesting previous entities page', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
561
|
-
var warnSpy, searchNavigationData, entity, mdmValues,
|
|
562
|
-
return __generator(this, function (
|
|
563
|
-
switch (
|
|
561
|
+
var warnSpy, searchNavigationData, entity, mdmValues, result;
|
|
562
|
+
return __generator(this, function (_a) {
|
|
563
|
+
switch (_a.label) {
|
|
564
564
|
case 0:
|
|
565
565
|
warnSpy = jest.spyOn(global.console, 'warn');
|
|
566
566
|
searchProvider.requestTotal.mockRejectedValue({ errorCode: 403, errorMessage: 'Access is denied' });
|
|
@@ -573,13 +573,13 @@ describe('useSearchNavigation behavior', function () {
|
|
|
573
573
|
};
|
|
574
574
|
entity = { uri: 'uri3' };
|
|
575
575
|
mdmValues = __assign(__assign({}, defaultMdmValues), { searchNavigationData: searchNavigationData, entity: entity });
|
|
576
|
-
|
|
576
|
+
result = setUp({ mdmValues: mdmValues }).result;
|
|
577
577
|
act(function () {
|
|
578
578
|
result.current.onPrev();
|
|
579
579
|
});
|
|
580
580
|
return [4 /*yield*/, waitFor(function () { return expect(result.current.isPrevDisabled).toBe(false); })];
|
|
581
581
|
case 1:
|
|
582
|
-
|
|
582
|
+
_a.sent();
|
|
583
583
|
expect(warnSpy).toHaveBeenCalledWith('Failed to load total count of entities', {
|
|
584
584
|
errorCode: 403,
|
|
585
585
|
errorMessage: 'Access is denied'
|
|
@@ -590,9 +590,9 @@ describe('useSearchNavigation behavior', function () {
|
|
|
590
590
|
});
|
|
591
591
|
}); });
|
|
592
592
|
it('should catch and handle requestEntities error when requesting previous entities page', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
593
|
-
var warnSpy, searchNavigationData, entity, mdmValues,
|
|
594
|
-
return __generator(this, function (
|
|
595
|
-
switch (
|
|
593
|
+
var warnSpy, searchNavigationData, entity, mdmValues, result;
|
|
594
|
+
return __generator(this, function (_a) {
|
|
595
|
+
switch (_a.label) {
|
|
596
596
|
case 0:
|
|
597
597
|
warnSpy = jest.spyOn(global.console, 'warn');
|
|
598
598
|
searchProvider.requestTotal.mockResolvedValue(11);
|
|
@@ -606,13 +606,13 @@ describe('useSearchNavigation behavior', function () {
|
|
|
606
606
|
};
|
|
607
607
|
entity = { uri: 'uri3' };
|
|
608
608
|
mdmValues = __assign(__assign({}, defaultMdmValues), { searchNavigationData: searchNavigationData, entity: entity });
|
|
609
|
-
|
|
609
|
+
result = setUp({ mdmValues: mdmValues }).result;
|
|
610
610
|
act(function () {
|
|
611
611
|
result.current.onPrev();
|
|
612
612
|
});
|
|
613
613
|
return [4 /*yield*/, waitFor(function () { return expect(result.current.isPrevDisabled).toBe(false); })];
|
|
614
614
|
case 1:
|
|
615
|
-
|
|
615
|
+
_a.sent();
|
|
616
616
|
expect(warnSpy).toHaveBeenCalledWith("Can't load previous page of search", {
|
|
617
617
|
errorCode: 403,
|
|
618
618
|
errorMessage: 'Access is denied'
|
|
@@ -638,17 +638,17 @@ describe('useSearchNavigation behavior', function () {
|
|
|
638
638
|
expect(searchProvider.requestTotal).not.toHaveBeenCalled();
|
|
639
639
|
});
|
|
640
640
|
it('should get next entity uri from cache, check it and if it exists update navigation data', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
641
|
-
var
|
|
642
|
-
return __generator(this, function (
|
|
643
|
-
switch (
|
|
641
|
+
var result;
|
|
642
|
+
return __generator(this, function (_a) {
|
|
643
|
+
switch (_a.label) {
|
|
644
644
|
case 0:
|
|
645
|
-
|
|
645
|
+
result = setUp().result;
|
|
646
646
|
act(function () {
|
|
647
647
|
result.current.onNext();
|
|
648
648
|
});
|
|
649
649
|
return [4 /*yield*/, waitFor(function () { return expect(result.current.isNextDisabled).toBe(false); })];
|
|
650
650
|
case 1:
|
|
651
|
-
|
|
651
|
+
_a.sent();
|
|
652
652
|
expect(mdmActions.updateSearchNavigationDataFields).toHaveBeenCalledTimes(1);
|
|
653
653
|
expect(mdmActions.openEntity).toHaveBeenCalledTimes(1);
|
|
654
654
|
expect(mdmActions.updateSearchNavigationDataFields).toHaveBeenCalledWith({
|
|
@@ -669,11 +669,11 @@ describe('useSearchNavigation behavior', function () {
|
|
|
669
669
|
});
|
|
670
670
|
}); });
|
|
671
671
|
it('should set isPrevDisabled and isNextDisabled props as true during loading process', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
672
|
-
var
|
|
673
|
-
return __generator(this, function (
|
|
674
|
-
switch (
|
|
672
|
+
var result;
|
|
673
|
+
return __generator(this, function (_a) {
|
|
674
|
+
switch (_a.label) {
|
|
675
675
|
case 0:
|
|
676
|
-
|
|
676
|
+
result = setUp().result;
|
|
677
677
|
expect(result.current.isNextDisabled).toBe(false);
|
|
678
678
|
expect(result.current.isPrevDisabled).toBe(false);
|
|
679
679
|
act(function () {
|
|
@@ -684,19 +684,19 @@ describe('useSearchNavigation behavior', function () {
|
|
|
684
684
|
expect(updateEntitiesNavigationLoadingState).toHaveBeenCalledWith(true);
|
|
685
685
|
return [4 /*yield*/, waitFor(function () { return expect(result.current.isNextDisabled).toBe(false); })];
|
|
686
686
|
case 1:
|
|
687
|
-
|
|
687
|
+
_a.sent();
|
|
688
688
|
return [4 /*yield*/, waitFor(function () { return expect(result.current.isPrevDisabled).toBe(false); })];
|
|
689
689
|
case 2:
|
|
690
|
-
|
|
690
|
+
_a.sent();
|
|
691
691
|
expect(updateEntitiesNavigationLoadingState).toHaveBeenCalledWith(false);
|
|
692
692
|
return [2 /*return*/];
|
|
693
693
|
}
|
|
694
694
|
});
|
|
695
695
|
}); });
|
|
696
696
|
it('should get next entity uri from cache, check it and, if it does not exist, try to check the entity after the next', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
697
|
-
var searchNavigationData, entity, mdmValues,
|
|
698
|
-
return __generator(this, function (
|
|
699
|
-
switch (
|
|
697
|
+
var searchNavigationData, entity, mdmValues, result;
|
|
698
|
+
return __generator(this, function (_a) {
|
|
699
|
+
switch (_a.label) {
|
|
700
700
|
case 0:
|
|
701
701
|
searchProvider.checkEntity.mockResolvedValueOnce(false);
|
|
702
702
|
searchProvider.checkEntity.mockResolvedValueOnce(true);
|
|
@@ -709,13 +709,13 @@ describe('useSearchNavigation behavior', function () {
|
|
|
709
709
|
};
|
|
710
710
|
entity = { uri: 'uri0' };
|
|
711
711
|
mdmValues = __assign(__assign({}, defaultMdmValues), { searchNavigationData: searchNavigationData, entity: entity });
|
|
712
|
-
|
|
712
|
+
result = setUp({ mdmValues: mdmValues }).result;
|
|
713
713
|
act(function () {
|
|
714
714
|
result.current.onNext();
|
|
715
715
|
});
|
|
716
716
|
return [4 /*yield*/, waitFor(function () { return expect(result.current.isNextDisabled).toBe(false); })];
|
|
717
717
|
case 1:
|
|
718
|
-
|
|
718
|
+
_a.sent();
|
|
719
719
|
expect(mdmActions.updateSearchNavigationDataFields).toHaveBeenCalledTimes(1);
|
|
720
720
|
expect(mdmActions.openEntity).toHaveBeenCalledTimes(1);
|
|
721
721
|
expect(mdmActions.updateSearchNavigationDataFields).toHaveBeenCalledWith({
|
|
@@ -737,9 +737,9 @@ describe('useSearchNavigation behavior', function () {
|
|
|
737
737
|
});
|
|
738
738
|
}); });
|
|
739
739
|
it('should stop process of checking entities if there are no more entities (index is more or equal than total - 1)', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
740
|
-
var searchNavigationData, entity, mdmValues,
|
|
741
|
-
return __generator(this, function (
|
|
742
|
-
switch (
|
|
740
|
+
var searchNavigationData, entity, mdmValues, result;
|
|
741
|
+
return __generator(this, function (_a) {
|
|
742
|
+
switch (_a.label) {
|
|
743
743
|
case 0:
|
|
744
744
|
searchProvider.checkEntity.mockResolvedValue(false);
|
|
745
745
|
searchNavigationData = {
|
|
@@ -751,13 +751,13 @@ describe('useSearchNavigation behavior', function () {
|
|
|
751
751
|
};
|
|
752
752
|
entity = { uri: 'uri3' };
|
|
753
753
|
mdmValues = __assign(__assign({}, defaultMdmValues), { searchNavigationData: searchNavigationData, entity: entity });
|
|
754
|
-
|
|
754
|
+
result = setUp({ mdmValues: mdmValues }).result;
|
|
755
755
|
act(function () {
|
|
756
756
|
result.current.onNext();
|
|
757
757
|
});
|
|
758
758
|
return [4 /*yield*/, waitFor(function () { return expect(result.current.isNextDisabled).toBe(false); })];
|
|
759
759
|
case 1:
|
|
760
|
-
|
|
760
|
+
_a.sent();
|
|
761
761
|
expect(mdmActions.updateSearchNavigationDataFields).toHaveBeenCalledTimes(1);
|
|
762
762
|
expect(mdmActions.openEntity).not.toHaveBeenCalled();
|
|
763
763
|
expect(mdmActions.updateSearchNavigationDataFields).toHaveBeenCalledWith({
|
|
@@ -777,9 +777,9 @@ describe('useSearchNavigation behavior', function () {
|
|
|
777
777
|
});
|
|
778
778
|
}); });
|
|
779
779
|
it('should request next entities page and update total if there are no entities in cache after current', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
780
|
-
var searchNavigationData, entity, mdmValues,
|
|
781
|
-
return __generator(this, function (
|
|
782
|
-
switch (
|
|
780
|
+
var searchNavigationData, entity, mdmValues, result;
|
|
781
|
+
return __generator(this, function (_a) {
|
|
782
|
+
switch (_a.label) {
|
|
783
783
|
case 0:
|
|
784
784
|
searchProvider.requestEntities.mockResolvedValue([{ uri: 'uri6' }, { uri: 'uri7' }, { uri: 'uri8' }]);
|
|
785
785
|
searchProvider.requestTotal.mockResolvedValue(11);
|
|
@@ -792,13 +792,13 @@ describe('useSearchNavigation behavior', function () {
|
|
|
792
792
|
};
|
|
793
793
|
entity = { uri: 'uri5' };
|
|
794
794
|
mdmValues = __assign(__assign({}, defaultMdmValues), { searchNavigationData: searchNavigationData, entity: entity });
|
|
795
|
-
|
|
795
|
+
result = setUp({ mdmValues: mdmValues }).result;
|
|
796
796
|
act(function () {
|
|
797
797
|
result.current.onNext();
|
|
798
798
|
});
|
|
799
799
|
return [4 /*yield*/, waitFor(function () { return expect(result.current.isNextDisabled).toBe(false); })];
|
|
800
800
|
case 1:
|
|
801
|
-
|
|
801
|
+
_a.sent();
|
|
802
802
|
expect(mdmActions.updateSearchNavigationDataFields).toHaveBeenCalledTimes(2);
|
|
803
803
|
expect(mdmActions.openEntity).toHaveBeenCalledTimes(1);
|
|
804
804
|
expect(mdmActions.updateSearchNavigationDataFields).toHaveBeenCalledWith({ total: 11 });
|
|
@@ -819,9 +819,9 @@ describe('useSearchNavigation behavior', function () {
|
|
|
819
819
|
});
|
|
820
820
|
}); });
|
|
821
821
|
it('should not add duplicates to cache if next entities page contains them', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
822
|
-
var searchNavigationData, entity, mdmValues,
|
|
823
|
-
return __generator(this, function (
|
|
824
|
-
switch (
|
|
822
|
+
var searchNavigationData, entity, mdmValues, result;
|
|
823
|
+
return __generator(this, function (_a) {
|
|
824
|
+
switch (_a.label) {
|
|
825
825
|
case 0:
|
|
826
826
|
searchProvider.requestEntities.mockResolvedValue([{ uri: 'uri5' }, { uri: 'uri6' }, { uri: 'uri7' }]);
|
|
827
827
|
searchProvider.requestTotal.mockResolvedValue(11);
|
|
@@ -834,13 +834,13 @@ describe('useSearchNavigation behavior', function () {
|
|
|
834
834
|
};
|
|
835
835
|
entity = { uri: 'uri5' };
|
|
836
836
|
mdmValues = __assign(__assign({}, defaultMdmValues), { searchNavigationData: searchNavigationData, entity: entity });
|
|
837
|
-
|
|
837
|
+
result = setUp({ mdmValues: mdmValues }).result;
|
|
838
838
|
act(function () {
|
|
839
839
|
result.current.onNext();
|
|
840
840
|
});
|
|
841
841
|
return [4 /*yield*/, waitFor(function () { return expect(result.current.isNextDisabled).toBe(false); })];
|
|
842
842
|
case 1:
|
|
843
|
-
|
|
843
|
+
_a.sent();
|
|
844
844
|
expect(mdmActions.updateSearchNavigationDataFields).toHaveBeenCalledTimes(2);
|
|
845
845
|
expect(mdmActions.openEntity).toHaveBeenCalledTimes(1);
|
|
846
846
|
expect(mdmActions.updateSearchNavigationDataFields).toHaveBeenCalledWith({ total: 11 });
|
|
@@ -861,9 +861,9 @@ describe('useSearchNavigation behavior', function () {
|
|
|
861
861
|
});
|
|
862
862
|
}); });
|
|
863
863
|
it('should request additional page if loaded entities page does not contain new entities', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
864
|
-
var searchNavigationData, entity, mdmValues,
|
|
865
|
-
return __generator(this, function (
|
|
866
|
-
switch (
|
|
864
|
+
var searchNavigationData, entity, mdmValues, result;
|
|
865
|
+
return __generator(this, function (_a) {
|
|
866
|
+
switch (_a.label) {
|
|
867
867
|
case 0:
|
|
868
868
|
searchProvider.requestEntities.mockResolvedValueOnce([{ uri: 'uri3' }, { uri: 'uri4' }, { uri: 'uri5' }]);
|
|
869
869
|
searchProvider.requestEntities.mockResolvedValueOnce([{ uri: 'uri5' }, { uri: 'uri6' }, { uri: 'uri7' }]);
|
|
@@ -877,13 +877,13 @@ describe('useSearchNavigation behavior', function () {
|
|
|
877
877
|
};
|
|
878
878
|
entity = { uri: 'uri5' };
|
|
879
879
|
mdmValues = __assign(__assign({}, defaultMdmValues), { searchNavigationData: searchNavigationData, entity: entity });
|
|
880
|
-
|
|
880
|
+
result = setUp({ mdmValues: mdmValues }).result;
|
|
881
881
|
act(function () {
|
|
882
882
|
result.current.onNext();
|
|
883
883
|
});
|
|
884
884
|
return [4 /*yield*/, waitFor(function () { return expect(result.current.isNextDisabled).toBe(false); })];
|
|
885
885
|
case 1:
|
|
886
|
-
|
|
886
|
+
_a.sent();
|
|
887
887
|
expect(mdmActions.updateSearchNavigationDataFields).toHaveBeenCalledTimes(3);
|
|
888
888
|
expect(mdmActions.openEntity).toHaveBeenCalledTimes(1);
|
|
889
889
|
expect(mdmActions.updateSearchNavigationDataFields).toHaveBeenCalledWith({ total: 11 });
|
|
@@ -905,9 +905,9 @@ describe('useSearchNavigation behavior', function () {
|
|
|
905
905
|
});
|
|
906
906
|
}); });
|
|
907
907
|
it('should stop request additional pages if there are no more new entities according index', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
908
|
-
var searchNavigationData, entity, mdmValues,
|
|
909
|
-
return __generator(this, function (
|
|
910
|
-
switch (
|
|
908
|
+
var searchNavigationData, entity, mdmValues, result;
|
|
909
|
+
return __generator(this, function (_a) {
|
|
910
|
+
switch (_a.label) {
|
|
911
911
|
case 0:
|
|
912
912
|
searchProvider.requestEntities.mockResolvedValueOnce([{ uri: 'uri3' }, { uri: 'uri4' }, { uri: 'uri5' }]);
|
|
913
913
|
searchProvider.requestEntities.mockResolvedValueOnce([{ uri: 'uri3' }, { uri: 'uri4' }, { uri: 'uri5' }]);
|
|
@@ -922,13 +922,13 @@ describe('useSearchNavigation behavior', function () {
|
|
|
922
922
|
};
|
|
923
923
|
entity = { uri: 'uri5' };
|
|
924
924
|
mdmValues = __assign(__assign({}, defaultMdmValues), { searchNavigationData: searchNavigationData, entity: entity });
|
|
925
|
-
|
|
925
|
+
result = setUp({ mdmValues: mdmValues }).result;
|
|
926
926
|
act(function () {
|
|
927
927
|
result.current.onNext();
|
|
928
928
|
});
|
|
929
929
|
return [4 /*yield*/, waitFor(function () { return expect(result.current.isNextDisabled).toBe(false); })];
|
|
930
930
|
case 1:
|
|
931
|
-
|
|
931
|
+
_a.sent();
|
|
932
932
|
expect(mdmActions.updateSearchNavigationDataFields).toHaveBeenCalledTimes(3);
|
|
933
933
|
expect(mdmActions.updateSearchNavigationDataFields).toHaveBeenCalledWith({ total: 11 });
|
|
934
934
|
expect(mdmActions.updateSearchNavigationDataFields).toHaveBeenCalledWith({
|
|
@@ -946,9 +946,9 @@ describe('useSearchNavigation behavior', function () {
|
|
|
946
946
|
});
|
|
947
947
|
}); });
|
|
948
948
|
it('should request next entities page after unsuccessful entity checking if there are no more entities in cache', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
949
|
-
var searchNavigationData, entity, mdmValues,
|
|
950
|
-
return __generator(this, function (
|
|
951
|
-
switch (
|
|
949
|
+
var searchNavigationData, entity, mdmValues, result;
|
|
950
|
+
return __generator(this, function (_a) {
|
|
951
|
+
switch (_a.label) {
|
|
952
952
|
case 0:
|
|
953
953
|
searchProvider.checkEntity.mockResolvedValueOnce(false);
|
|
954
954
|
searchProvider.requestEntities.mockResolvedValueOnce([{ uri: 'uri6' }, { uri: 'uri7' }, { uri: 'uri8' }]);
|
|
@@ -962,13 +962,13 @@ describe('useSearchNavigation behavior', function () {
|
|
|
962
962
|
};
|
|
963
963
|
entity = { uri: 'uri4' };
|
|
964
964
|
mdmValues = __assign(__assign({}, defaultMdmValues), { searchNavigationData: searchNavigationData, entity: entity });
|
|
965
|
-
|
|
965
|
+
result = setUp({ mdmValues: mdmValues }).result;
|
|
966
966
|
act(function () {
|
|
967
967
|
result.current.onNext();
|
|
968
968
|
});
|
|
969
969
|
return [4 /*yield*/, waitFor(function () { return expect(result.current.isNextDisabled).toBe(false); })];
|
|
970
970
|
case 1:
|
|
971
|
-
|
|
971
|
+
_a.sent();
|
|
972
972
|
expect(mdmActions.updateSearchNavigationDataFields).toHaveBeenCalledTimes(2);
|
|
973
973
|
expect(mdmActions.openEntity).toHaveBeenCalledTimes(1);
|
|
974
974
|
expect(mdmActions.updateSearchNavigationDataFields).toHaveBeenCalledWith({ total: 11 });
|
|
@@ -990,19 +990,19 @@ describe('useSearchNavigation behavior', function () {
|
|
|
990
990
|
});
|
|
991
991
|
}); });
|
|
992
992
|
it('should catch and handle checkEntity error when checking next entity', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
993
|
-
var warnSpy,
|
|
994
|
-
return __generator(this, function (
|
|
995
|
-
switch (
|
|
993
|
+
var warnSpy, result;
|
|
994
|
+
return __generator(this, function (_a) {
|
|
995
|
+
switch (_a.label) {
|
|
996
996
|
case 0:
|
|
997
997
|
warnSpy = jest.spyOn(global.console, 'warn');
|
|
998
998
|
searchProvider.checkEntity.mockRejectedValue({ errorCode: 403, errorMessage: 'Access is denied' });
|
|
999
|
-
|
|
999
|
+
result = setUp().result;
|
|
1000
1000
|
act(function () {
|
|
1001
1001
|
result.current.onNext();
|
|
1002
1002
|
});
|
|
1003
1003
|
return [4 /*yield*/, waitFor(function () { return expect(result.current.isNextDisabled).toBe(false); })];
|
|
1004
1004
|
case 1:
|
|
1005
|
-
|
|
1005
|
+
_a.sent();
|
|
1006
1006
|
expect(warnSpy).toHaveBeenCalledWith("Can't load next page of search", {
|
|
1007
1007
|
errorCode: 403,
|
|
1008
1008
|
errorMessage: 'Access is denied'
|
|
@@ -1013,9 +1013,9 @@ describe('useSearchNavigation behavior', function () {
|
|
|
1013
1013
|
});
|
|
1014
1014
|
}); });
|
|
1015
1015
|
it('should catch and handle requestTotal error when requesting next entities page', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
1016
|
-
var warnSpy, searchNavigationData, entity, mdmValues,
|
|
1017
|
-
return __generator(this, function (
|
|
1018
|
-
switch (
|
|
1016
|
+
var warnSpy, searchNavigationData, entity, mdmValues, result;
|
|
1017
|
+
return __generator(this, function (_a) {
|
|
1018
|
+
switch (_a.label) {
|
|
1019
1019
|
case 0:
|
|
1020
1020
|
warnSpy = jest.spyOn(global.console, 'warn');
|
|
1021
1021
|
searchProvider.requestTotal.mockRejectedValue({ errorCode: 403, errorMessage: 'Access is denied' });
|
|
@@ -1028,13 +1028,13 @@ describe('useSearchNavigation behavior', function () {
|
|
|
1028
1028
|
};
|
|
1029
1029
|
entity = { uri: 'uri5' };
|
|
1030
1030
|
mdmValues = __assign(__assign({}, defaultMdmValues), { searchNavigationData: searchNavigationData, entity: entity });
|
|
1031
|
-
|
|
1031
|
+
result = setUp({ mdmValues: mdmValues }).result;
|
|
1032
1032
|
act(function () {
|
|
1033
1033
|
result.current.onNext();
|
|
1034
1034
|
});
|
|
1035
1035
|
return [4 /*yield*/, waitFor(function () { return expect(result.current.isNextDisabled).toBe(false); })];
|
|
1036
1036
|
case 1:
|
|
1037
|
-
|
|
1037
|
+
_a.sent();
|
|
1038
1038
|
expect(warnSpy).toHaveBeenCalledWith('Failed to load total count of entities', {
|
|
1039
1039
|
errorCode: 403,
|
|
1040
1040
|
errorMessage: 'Access is denied'
|
|
@@ -1045,9 +1045,9 @@ describe('useSearchNavigation behavior', function () {
|
|
|
1045
1045
|
});
|
|
1046
1046
|
}); });
|
|
1047
1047
|
it('should catch and handle requestEntities error when requesting next entities page', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
1048
|
-
var warnSpy, searchNavigationData, entity, mdmValues,
|
|
1049
|
-
return __generator(this, function (
|
|
1050
|
-
switch (
|
|
1048
|
+
var warnSpy, searchNavigationData, entity, mdmValues, result;
|
|
1049
|
+
return __generator(this, function (_a) {
|
|
1050
|
+
switch (_a.label) {
|
|
1051
1051
|
case 0:
|
|
1052
1052
|
warnSpy = jest.spyOn(global.console, 'warn');
|
|
1053
1053
|
searchProvider.requestTotal.mockResolvedValue(11);
|
|
@@ -1061,13 +1061,13 @@ describe('useSearchNavigation behavior', function () {
|
|
|
1061
1061
|
};
|
|
1062
1062
|
entity = { uri: 'uri5' };
|
|
1063
1063
|
mdmValues = __assign(__assign({}, defaultMdmValues), { searchNavigationData: searchNavigationData, entity: entity });
|
|
1064
|
-
|
|
1064
|
+
result = setUp({ mdmValues: mdmValues }).result;
|
|
1065
1065
|
act(function () {
|
|
1066
1066
|
result.current.onNext();
|
|
1067
1067
|
});
|
|
1068
1068
|
return [4 /*yield*/, waitFor(function () { return expect(result.current.isNextDisabled).toBe(false); })];
|
|
1069
1069
|
case 1:
|
|
1070
|
-
|
|
1070
|
+
_a.sent();
|
|
1071
1071
|
expect(warnSpy).toHaveBeenCalledWith("Can't load next page of search", {
|
|
1072
1072
|
errorCode: 403,
|
|
1073
1073
|
errorMessage: 'Access is denied'
|