@reltio/components 1.4.1945 → 1.4.1947
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/AttributeListItem/AttributeListItem.spec.js +4 -4
- package/cjs/AttributesErrorsPanel/components/Error/Error.specs.js +1 -1
- package/cjs/AttributesFiltersBuilder/AttributesFiltersBuilder.test.js +8 -8
- package/cjs/AttributesFiltersBuilder/components/AttributeSelector/AttributeSelector.test.js +2 -2
- package/cjs/AttributesFiltersBuilder/components/RowActions/RowActions.test.js +3 -3
- package/cjs/AttributesFiltersButton/AttributesFiltersButton.test.js +1 -1
- package/cjs/AutoSizeList/AutoSizeList.test.js +27 -30
- package/cjs/BasicTable/BasicTable.test.js +26 -5
- package/cjs/BasicTable/IntegrationBasicTable.test.js +16 -5
- package/cjs/BasicTable/helpers.test.js +1 -1
- package/cjs/CollapseRowButton/CollapseRowButton.test.js +3 -3
- package/cjs/CommentsContainer/CommentsContainer.test.js +2 -2
- package/cjs/CustomDateRangeEditor/CustomDateRangeEditor.test.js +2 -2
- package/cjs/DataTypeValue/DataTypeValue.test.js +2 -25
- package/cjs/DataTypeValueEditor/useEditorContext.test.js +2 -2
- package/cjs/DependentLookupEditor/DependentLookupEditor.test.js +116 -70
- package/cjs/DropDownEditor/DropDownEditor.test.js +1 -1
- package/cjs/EditModeAttributesFactory/components/EditModeAttribute/EditModeAttribute.test.js +4 -27
- package/cjs/EditModeAttributesList/EditModeAttributesList.test.js +6 -3
- package/cjs/EditModeAttributesPager/EditModeAttributesPager.js +1 -2
- package/cjs/EditModeAttributesView/IntegrationEditModeAttributesView.test.js +28 -37
- package/cjs/EntitySelector/EntitySelector.test.js +13 -42
- package/cjs/EntitySelector/components/ClearIndicator/ClearIndicator.test.js +1 -1
- package/cjs/EntitySelector/components/EntityOption/EntityOption.test.js +1 -1
- package/cjs/EntitySelector/components/Group/Group.test.js +1 -1
- package/cjs/EntityUriLink/EntityUriLink.test.js +1 -0
- package/cjs/ErrorBoundary/ErrorBoundary.test.js +2 -0
- package/cjs/ExpandedValueTooltip/ExpandedValueTooltip.test.js +4 -1
- package/cjs/FilterButton/FilterButton.test.js +1 -1
- package/cjs/HOCs/withFilter/components/ColumnFilter/ColumnFilter.spec.js +3 -3
- package/cjs/HOCs/withTableContext/withTableContext.test.js +1 -1
- package/cjs/HierarchyNodeTitle/HierarchyNodeTitle.test.js +4 -27
- package/cjs/HierarchyNodeTitle/useEntityDetails.test.js +18 -32
- package/cjs/ImageAttributesGallery/ImageAttributesGallery.test.js +6 -4
- package/cjs/ImageAttributesGallery/components/HeaderRight/HeaderRight.test.js +1 -1
- package/cjs/ImageAttributesLine/ImageAttributesLine.test.js +110 -68
- package/cjs/ImageAttributesLineEditor/ImageAttributesLineEditor.test.js +4 -4
- package/cjs/ImageGalleryDialog/ImageGalleryDialog.specs.js +3 -3
- package/cjs/ImportButton/ImportButton.test.js +1 -1
- package/cjs/InlineAttributesPager/components/InlineNestedAttributesBlock/InlineNestedAttributesBlock.test.js +1 -1
- package/cjs/InlineAttributesPager/components/InlineSimpleAttributesBlock/InlineSimpleAttributesBlock.test.js +1 -1
- package/cjs/InlineComplexAttribute/InlineComplexAttribute.test.js +3 -3
- package/cjs/InlineSimpleAttribute/InlineSimpleAttribute.spec.js +31 -22
- package/cjs/LineChart/LineChart.test.js +1 -1
- package/cjs/Link/Link.test.js +1 -0
- package/cjs/LookupEditor/LookupEditor.test.js +3 -3
- package/cjs/LookupEditor/components/GroupedDropDownEditor/GroupedDropDownEditor.test.js +1 -1
- package/cjs/MapChart/MapChart.test.js +3 -3
- package/cjs/MetadataTypesSelector/MetadataTypesSelector.test.js +3 -3
- package/cjs/MoreAttributesButton/MoreAttributesButton.test.js +1 -1
- package/cjs/MultipleInput/MultipleInput.test.js +11 -11
- package/cjs/MultipliableSelect/MultipliableSelect.test.js +14 -8
- package/cjs/NestedAttributeEditor/NestedAttributeEditor.test.js +4 -27
- package/cjs/NumberEditor/NumberEditor.test.js +4 -4
- package/cjs/PieChart/PieChart.test.js +1 -1
- package/cjs/PivotingTooltip/IntegrationPivotingTooltip.test.js +11 -34
- package/cjs/PivotingTooltip/components/PivotingTooltipContent/PivotingTooltipContent.test.js +4 -30
- package/cjs/PivotingUriLink/PivotingUriLink.spec.js +1 -0
- package/cjs/ProfileBandNavigation/useSearchNavigation.test.js +3 -3
- package/cjs/ProfilesList/ProfilesList.spec.js +1 -1
- package/cjs/ReactSelectLoadMoreButton/ReactSelectLoadMoreButton.test.js +1 -1
- package/cjs/ReferenceAttributeEditor/ReferenceAttributeEditor.test.js +6 -30
- package/cjs/RelationEditor/IntegrationRelationEditor.test.js +1 -1
- package/cjs/RelationEditor/RelationEditor.test.js +20 -44
- package/cjs/ReltioMap/ReltioMap.spec.js +10 -8
- package/cjs/ReltioMap/components/EntityMarker/EntityMarker.spec.js +2 -26
- package/cjs/ScrollableTabs/ScrollableTabs.test.js +1 -1
- package/cjs/SearchInput/SearchInput.spec.js +2 -2
- package/cjs/SelectionPopup/SelectionPopup.spec.js +9 -12
- package/cjs/SelectorWithOnlyOptionAutoSelect/SelectorWithOnlyOptionAutoSelect.test.js +4 -4
- package/cjs/ShowLess/ShowLess.test.js +1 -1
- package/cjs/ShowMore/ShowMore.test.js +2 -2
- package/cjs/SideButtonsPanel/SideButtonsPanel.spec.js +3 -3
- package/cjs/SimpleAttribute/IntegrationSimpleAttribute.test.js +15 -34
- package/cjs/SimpleDropDownSelector/SimpleDropDownSelector.test.js +1 -1
- package/cjs/TableWithBars/TableWithBars.test.js +1 -1
- package/cjs/TreeChart/TreeChart.test.js +1 -1
- package/cjs/TypeaheadEditor/TypeaheadEditor.test.js +8 -1
- package/cjs/UploadFileButton/UploadFileButton.spec.js +103 -69
- package/cjs/VerticalHeadingsTable/components/TableCellWithDnd/TableCellWithDnd.test.js +4 -1
- package/cjs/VerticalHeadingsTable/components/TableRowWithDnd/TableRowWithDnd.test.js +3 -1
- package/cjs/features/activity-log/ActivitiesFactory/components/SearchActivity/SearchActivity.test.js +2 -2
- package/cjs/features/activity-log/ActivityExportButton/ActivityExportButton.specs.js +1 -25
- package/cjs/features/activity-log/ActivityFilterEditor/components/EntityChangedSelectors/EntityChangedSelectors.specs.js +1 -25
- package/cjs/features/activity-log/ActivityLog/ActivityLog.test.js +4 -0
- package/cjs/features/activity-log/ActivityLog/components/GroupItem/GroupItem.test.js +1 -1
- package/cjs/features/activity-log/ActivityLogFilter/ActivityLogFilter.specs.js +1 -2
- package/cjs/features/crosswalks/AttributesTable/AttributesTable.test.js +13 -13
- package/cjs/features/crosswalks/AttributesTable/IntegrationAttributesTable.test.js +5 -5
- package/cjs/features/crosswalks/AttributesTable/components/AddAttributesButton/AddAttributesButton.test.js +4 -4
- package/cjs/features/crosswalks/AttributesTable/components/ConfirmEditIgnoredDialog/ConfirmEditIgnoredDialog.test.js +5 -5
- package/cjs/features/crosswalks/AttributesTable/components/WinnerSourcesRenderer/WinnerSourcesRenderer.test.js +2 -2
- package/cjs/features/crosswalks/CrosswalkDragLayer/components/CrosswalkDragPreview/CrosswalkDragPreview.d.ts +2 -2
- package/cjs/features/crosswalks/CrosswalkDragLayer/components/CrosswalkDragPreview/CrosswalkDragPreview.js +27 -4
- package/cjs/features/crosswalks/CrosswalkRow/CrosswalkRow.test.js +15 -16
- package/cjs/features/crosswalks/ShowDependentLink/ShowDependentLink.test.js +1 -1
- package/cjs/features/crosswalks/SourceCrosswalksRow/SourceCrosswalksRow.test.js +2 -2
- package/cjs/features/crosswalks/hooks/useAttributeActions.test.js +95 -118
- package/cjs/features/crosswalks/hooks/useCrosswalkActions.test.js +38 -61
- package/cjs/features/crosswalks/hooks/useModifiedEntity.test.js +8 -8
- package/cjs/features/graph/DataModelGraph/hooks/useEdgeLabelsRenderer.test.js +2 -2
- package/cjs/features/history/ContributorsPanel/components/ContributorItem/ContributorItem.specs.js +5 -26
- package/cjs/features/history/HistoryGraph/components/HistoryLink/HistoryLink.specs.js +2 -2
- package/cjs/features/history/HistoryRow/HistoryRow.specs.js +2 -26
- package/cjs/features/history/HistoryTree/HistoryTree.specs.js +1 -1
- package/cjs/features/history/HistoryView/HistoryView.specs.js +1 -1
- package/cjs/features/history/helpers/filters.test.js +6 -6
- package/cjs/features/history/hooks/useHistory.test.js +23 -48
- package/cjs/features/workflow/AddWorkflowDialog/AddWorkflowDialog.spec.js +24 -8
- package/cjs/features/workflow/AssigneeSelector/AssigneeSelector.spec.js +1 -26
- package/cjs/features/workflow/WorkflowTaskCard/components/GenericWorkflowTaskCard/GenericWorkflowTaskCard.spec.js +4 -30
- package/cjs/features/workflow/hooks/useChangeRequest.specs.js +11 -36
- package/cjs/helpers/customScript.test.js +19 -19
- package/cjs/hooks/useAPI/useAPI.test.js +12 -12
- package/cjs/hooks/useBasicTableCellRenderer/CellRenderer.test.js +2 -1
- package/cjs/hooks/useCollapsibleTableRows/dataHelpers.test.js +1 -1
- package/cjs/hooks/useCollapsibleTableRows/useCollapsibleTableRows.test.js +1 -1
- package/cjs/hooks/useConfigPermissions/useConfigPermissions.specs.js +5 -29
- package/cjs/hooks/useCustomScripts/useCustomScripts.test.js +8 -8
- package/cjs/hooks/useLayoutResetter/useLayoutResetter.test.js +8 -8
- package/cjs/hooks/useMarkers/helpers.js +1 -2
- package/cjs/hooks/useReadableSearchState/useReadableSearchState.test.js +14 -44
- package/cjs/hooks/useRelationsLoader/useRelationsLoader.specs.js +3 -4
- package/cjs/hooks/useSavedStateForEntityType/useSavedStateForEntityType.test.js +4 -4
- package/cjs/hooks/useScrollToAttributeError/useScrollToAttributeError.test.js +1 -1
- package/cjs/hooks/useSegmentationRequest/index.d.ts +1 -0
- package/cjs/hooks/useSegmentationRequest/index.js +5 -0
- package/cjs/hooks/useSegmentationRequest/useSegmentationRequest.d.ts +9 -0
- package/cjs/hooks/useSegmentationRequest/useSegmentationRequest.js +32 -0
- package/cjs/hooks/useSnackbar/useSnackbar.test.js +24 -17
- package/cjs/index.d.ts +1 -0
- package/cjs/index.js +4 -2
- package/esm/AttributeListItem/AttributeListItem.spec.js +4 -4
- package/esm/AttributesErrorsPanel/components/Error/Error.specs.js +1 -1
- package/esm/AttributesFiltersBuilder/AttributesFiltersBuilder.test.js +8 -8
- package/esm/AttributesFiltersBuilder/components/AttributeSelector/AttributeSelector.test.js +2 -2
- package/esm/AttributesFiltersBuilder/components/RowActions/RowActions.test.js +3 -3
- package/esm/AttributesFiltersButton/AttributesFiltersButton.test.js +1 -1
- package/esm/AutoSizeList/AutoSizeList.test.js +28 -31
- package/esm/BasicTable/BasicTable.test.js +26 -5
- package/esm/BasicTable/IntegrationBasicTable.test.js +17 -6
- package/esm/BasicTable/helpers.test.js +1 -1
- package/esm/CollapseRowButton/CollapseRowButton.test.js +3 -3
- package/esm/CommentsContainer/CommentsContainer.test.js +2 -2
- package/esm/CustomDateRangeEditor/CustomDateRangeEditor.test.js +2 -2
- package/esm/DataTypeValue/DataTypeValue.test.js +2 -2
- package/esm/DataTypeValueEditor/useEditorContext.test.js +2 -2
- package/esm/DependentLookupEditor/DependentLookupEditor.test.js +116 -70
- package/esm/DropDownEditor/DropDownEditor.test.js +1 -1
- package/esm/EditModeAttributesFactory/components/EditModeAttribute/EditModeAttribute.test.js +4 -4
- package/esm/EditModeAttributesList/EditModeAttributesList.test.js +4 -1
- package/esm/EditModeAttributesPager/EditModeAttributesPager.js +1 -2
- package/esm/EditModeAttributesView/IntegrationEditModeAttributesView.test.js +30 -16
- package/esm/EntitySelector/EntitySelector.test.js +13 -19
- package/esm/EntitySelector/components/ClearIndicator/ClearIndicator.test.js +1 -1
- package/esm/EntitySelector/components/EntityOption/EntityOption.test.js +1 -1
- package/esm/EntitySelector/components/Group/Group.test.js +1 -1
- package/esm/EntityUriLink/EntityUriLink.test.js +1 -0
- package/esm/ErrorBoundary/ErrorBoundary.test.js +2 -0
- package/esm/ExpandedValueTooltip/ExpandedValueTooltip.test.js +4 -1
- package/esm/FilterButton/FilterButton.test.js +1 -1
- package/esm/HOCs/withFilter/components/ColumnFilter/ColumnFilter.spec.js +3 -3
- package/esm/HOCs/withTableContext/withTableContext.test.js +1 -1
- package/esm/HierarchyNodeTitle/HierarchyNodeTitle.test.js +4 -4
- package/esm/HierarchyNodeTitle/useEntityDetails.test.js +19 -10
- package/esm/ImageAttributesGallery/ImageAttributesGallery.test.js +6 -4
- package/esm/ImageAttributesGallery/components/HeaderRight/HeaderRight.test.js +1 -1
- package/esm/ImageAttributesLine/ImageAttributesLine.test.js +110 -68
- package/esm/ImageAttributesLineEditor/ImageAttributesLineEditor.test.js +4 -4
- package/esm/ImageGalleryDialog/ImageGalleryDialog.specs.js +3 -3
- package/esm/ImportButton/ImportButton.test.js +1 -1
- package/esm/InlineAttributesPager/components/InlineNestedAttributesBlock/InlineNestedAttributesBlock.test.js +1 -1
- package/esm/InlineAttributesPager/components/InlineSimpleAttributesBlock/InlineSimpleAttributesBlock.test.js +1 -1
- package/esm/InlineComplexAttribute/InlineComplexAttribute.test.js +3 -3
- package/esm/InlineSimpleAttribute/InlineSimpleAttribute.spec.js +32 -23
- package/esm/LineChart/LineChart.test.js +1 -1
- package/esm/Link/Link.test.js +1 -0
- package/esm/LookupEditor/LookupEditor.test.js +3 -3
- package/esm/LookupEditor/components/GroupedDropDownEditor/GroupedDropDownEditor.test.js +1 -1
- package/esm/MapChart/MapChart.test.js +3 -3
- package/esm/MetadataTypesSelector/MetadataTypesSelector.test.js +3 -3
- package/esm/MoreAttributesButton/MoreAttributesButton.test.js +1 -1
- package/esm/MultipleInput/MultipleInput.test.js +11 -11
- package/esm/MultipliableSelect/MultipliableSelect.test.js +14 -8
- package/esm/NestedAttributeEditor/NestedAttributeEditor.test.js +4 -4
- package/esm/NumberEditor/NumberEditor.test.js +4 -4
- package/esm/PieChart/PieChart.test.js +1 -1
- package/esm/PivotingTooltip/IntegrationPivotingTooltip.test.js +11 -11
- package/esm/PivotingTooltip/components/PivotingTooltipContent/PivotingTooltipContent.test.js +4 -7
- package/esm/PivotingUriLink/PivotingUriLink.spec.js +1 -0
- package/esm/ProfileBandNavigation/useSearchNavigation.test.js +3 -3
- package/esm/ProfilesList/ProfilesList.spec.js +1 -1
- package/esm/ReactSelectLoadMoreButton/ReactSelectLoadMoreButton.test.js +1 -1
- package/esm/ReferenceAttributeEditor/ReferenceAttributeEditor.test.js +7 -8
- package/esm/RelationEditor/IntegrationRelationEditor.test.js +1 -1
- package/esm/RelationEditor/RelationEditor.test.js +21 -22
- package/esm/ReltioMap/ReltioMap.spec.js +11 -9
- package/esm/ReltioMap/components/EntityMarker/EntityMarker.spec.js +3 -4
- package/esm/ScrollableTabs/ScrollableTabs.test.js +1 -1
- package/esm/SearchInput/SearchInput.spec.js +2 -2
- package/esm/SelectionPopup/SelectionPopup.spec.js +9 -12
- package/esm/SelectorWithOnlyOptionAutoSelect/SelectorWithOnlyOptionAutoSelect.test.js +4 -4
- package/esm/ShowLess/ShowLess.test.js +1 -1
- package/esm/ShowMore/ShowMore.test.js +2 -2
- package/esm/SideButtonsPanel/SideButtonsPanel.spec.js +3 -3
- package/esm/SimpleAttribute/IntegrationSimpleAttribute.test.js +16 -12
- package/esm/SimpleDropDownSelector/SimpleDropDownSelector.test.js +1 -1
- package/esm/TableWithBars/TableWithBars.test.js +1 -1
- package/esm/TreeChart/TreeChart.test.js +1 -1
- package/esm/TypeaheadEditor/TypeaheadEditor.test.js +8 -1
- package/esm/UploadFileButton/UploadFileButton.spec.js +103 -69
- package/esm/VerticalHeadingsTable/components/TableCellWithDnd/TableCellWithDnd.test.js +4 -1
- package/esm/VerticalHeadingsTable/components/TableRowWithDnd/TableRowWithDnd.test.js +3 -1
- package/esm/features/activity-log/ActivitiesFactory/components/SearchActivity/SearchActivity.test.js +2 -2
- package/esm/features/activity-log/ActivityExportButton/ActivityExportButton.specs.js +1 -2
- package/esm/features/activity-log/ActivityFilterEditor/components/EntityChangedSelectors/EntityChangedSelectors.specs.js +2 -3
- package/esm/features/activity-log/ActivityLog/ActivityLog.test.js +4 -0
- package/esm/features/activity-log/ActivityLog/components/GroupItem/GroupItem.test.js +1 -1
- package/esm/features/activity-log/ActivityLogFilter/ActivityLogFilter.specs.js +1 -2
- package/esm/features/crosswalks/AttributesTable/AttributesTable.test.js +13 -13
- package/esm/features/crosswalks/AttributesTable/IntegrationAttributesTable.test.js +5 -5
- package/esm/features/crosswalks/AttributesTable/components/AddAttributesButton/AddAttributesButton.test.js +4 -4
- package/esm/features/crosswalks/AttributesTable/components/ConfirmEditIgnoredDialog/ConfirmEditIgnoredDialog.test.js +5 -5
- package/esm/features/crosswalks/AttributesTable/components/WinnerSourcesRenderer/WinnerSourcesRenderer.test.js +2 -2
- package/esm/features/crosswalks/CrosswalkDragLayer/components/CrosswalkDragPreview/CrosswalkDragPreview.d.ts +2 -2
- package/esm/features/crosswalks/CrosswalkDragLayer/components/CrosswalkDragPreview/CrosswalkDragPreview.js +4 -3
- package/esm/features/crosswalks/CrosswalkRow/CrosswalkRow.test.js +15 -16
- package/esm/features/crosswalks/ShowDependentLink/ShowDependentLink.test.js +1 -1
- package/esm/features/crosswalks/SourceCrosswalksRow/SourceCrosswalksRow.test.js +2 -2
- package/esm/features/crosswalks/hooks/useAttributeActions.test.js +95 -95
- package/esm/features/crosswalks/hooks/useCrosswalkActions.test.js +38 -38
- package/esm/features/crosswalks/hooks/useModifiedEntity.test.js +8 -8
- package/esm/features/graph/DataModelGraph/hooks/useEdgeLabelsRenderer.test.js +2 -2
- package/esm/features/history/ContributorsPanel/components/ContributorItem/ContributorItem.specs.js +5 -3
- package/esm/features/history/HistoryGraph/components/HistoryLink/HistoryLink.specs.js +2 -2
- package/esm/features/history/HistoryRow/HistoryRow.specs.js +2 -3
- package/esm/features/history/HistoryTree/HistoryTree.specs.js +1 -1
- package/esm/features/history/HistoryView/HistoryView.specs.js +1 -1
- package/esm/features/history/helpers/filters.test.js +6 -6
- package/esm/features/history/hooks/useHistory.test.js +23 -25
- package/esm/features/workflow/AddWorkflowDialog/AddWorkflowDialog.spec.js +25 -9
- package/esm/features/workflow/AssigneeSelector/AssigneeSelector.spec.js +1 -3
- package/esm/features/workflow/WorkflowTaskCard/components/GenericWorkflowTaskCard/GenericWorkflowTaskCard.spec.js +5 -8
- package/esm/features/workflow/hooks/useChangeRequest.specs.js +11 -13
- package/esm/helpers/customScript.test.js +19 -19
- package/esm/hooks/useAPI/useAPI.test.js +12 -12
- package/esm/hooks/useBasicTableCellRenderer/CellRenderer.test.js +2 -1
- package/esm/hooks/useCollapsibleTableRows/dataHelpers.test.js +1 -1
- package/esm/hooks/useCollapsibleTableRows/useCollapsibleTableRows.test.js +1 -1
- package/esm/hooks/useConfigPermissions/useConfigPermissions.specs.js +6 -7
- package/esm/hooks/useCustomScripts/useCustomScripts.test.js +8 -8
- package/esm/hooks/useLayoutResetter/useLayoutResetter.test.js +9 -9
- package/esm/hooks/useMarkers/helpers.js +1 -2
- package/esm/hooks/useReadableSearchState/useReadableSearchState.test.js +8 -15
- package/esm/hooks/useRelationsLoader/useRelationsLoader.specs.js +1 -2
- package/esm/hooks/useSavedStateForEntityType/useSavedStateForEntityType.test.js +4 -4
- package/esm/hooks/useScrollToAttributeError/useScrollToAttributeError.test.js +1 -1
- package/esm/hooks/useSegmentationRequest/index.d.ts +1 -0
- package/esm/hooks/useSegmentationRequest/index.js +1 -0
- package/esm/hooks/useSegmentationRequest/useSegmentationRequest.d.ts +9 -0
- package/esm/hooks/useSegmentationRequest/useSegmentationRequest.js +28 -0
- package/esm/hooks/useSnackbar/useSnackbar.test.js +25 -18
- package/esm/index.d.ts +1 -0
- package/esm/index.js +1 -0
- package/package.json +2 -2
|
@@ -96,7 +96,7 @@ describe('MultipleInput behaviour', function () {
|
|
|
96
96
|
return [4 /*yield*/, user.click(getMuiIconByName('Cancel', chips[1]))];
|
|
97
97
|
case 1:
|
|
98
98
|
_a.sent();
|
|
99
|
-
expect(props.onChange).
|
|
99
|
+
expect(props.onChange).toHaveBeenCalledWith(['1', '3']);
|
|
100
100
|
return [2 /*return*/];
|
|
101
101
|
}
|
|
102
102
|
});
|
|
@@ -111,7 +111,7 @@ describe('MultipleInput behaviour', function () {
|
|
|
111
111
|
return [4 /*yield*/, user.type(screen.getByRole('textbox'), '4{Enter}')];
|
|
112
112
|
case 1:
|
|
113
113
|
_a.sent();
|
|
114
|
-
expect(props.onChange).
|
|
114
|
+
expect(props.onChange).toHaveBeenCalledWith(['1', '2', '3', '4']);
|
|
115
115
|
return [2 /*return*/];
|
|
116
116
|
}
|
|
117
117
|
});
|
|
@@ -129,7 +129,7 @@ describe('MultipleInput behaviour', function () {
|
|
|
129
129
|
return [4 /*yield*/, user.click(container)];
|
|
130
130
|
case 2:
|
|
131
131
|
_b.sent();
|
|
132
|
-
expect(props.onChange).
|
|
132
|
+
expect(props.onChange).toHaveBeenCalledWith(['1', '2', '3', '4']);
|
|
133
133
|
return [2 /*return*/];
|
|
134
134
|
}
|
|
135
135
|
});
|
|
@@ -144,7 +144,7 @@ describe('MultipleInput behaviour', function () {
|
|
|
144
144
|
return [4 /*yield*/, user.type(screen.getByRole('textbox'), '{Backspace}')];
|
|
145
145
|
case 1:
|
|
146
146
|
_a.sent();
|
|
147
|
-
expect(props.onChange).
|
|
147
|
+
expect(props.onChange).toHaveBeenCalledWith(['1', '2']);
|
|
148
148
|
return [2 /*return*/];
|
|
149
149
|
}
|
|
150
150
|
});
|
|
@@ -159,7 +159,7 @@ describe('MultipleInput behaviour', function () {
|
|
|
159
159
|
return [4 /*yield*/, user.type(screen.getByRole('textbox'), '{Tab}')];
|
|
160
160
|
case 1:
|
|
161
161
|
_a.sent();
|
|
162
|
-
expect(props.onChange).not.
|
|
162
|
+
expect(props.onChange).not.toHaveBeenCalled();
|
|
163
163
|
return [2 /*return*/];
|
|
164
164
|
}
|
|
165
165
|
});
|
|
@@ -174,7 +174,7 @@ describe('MultipleInput behaviour', function () {
|
|
|
174
174
|
return [4 /*yield*/, user.type(screen.getByRole('textbox'), 'test{Backspace}')];
|
|
175
175
|
case 1:
|
|
176
176
|
_a.sent();
|
|
177
|
-
expect(props.onChange).not.
|
|
177
|
+
expect(props.onChange).not.toHaveBeenCalled();
|
|
178
178
|
return [2 /*return*/];
|
|
179
179
|
}
|
|
180
180
|
});
|
|
@@ -189,7 +189,7 @@ describe('MultipleInput behaviour', function () {
|
|
|
189
189
|
return [4 /*yield*/, user.type(screen.getByRole('textbox'), '{Backspace}')];
|
|
190
190
|
case 1:
|
|
191
191
|
_a.sent();
|
|
192
|
-
expect(props.onChange).not.
|
|
192
|
+
expect(props.onChange).not.toHaveBeenCalled();
|
|
193
193
|
return [2 /*return*/];
|
|
194
194
|
}
|
|
195
195
|
});
|
|
@@ -204,7 +204,7 @@ describe('MultipleInput behaviour', function () {
|
|
|
204
204
|
return [4 /*yield*/, user.type(screen.getByRole('textbox'), 'test{Enter}')];
|
|
205
205
|
case 1:
|
|
206
206
|
_a.sent();
|
|
207
|
-
expect(props.onChange).
|
|
207
|
+
expect(props.onChange).toHaveBeenCalledWith(['test']);
|
|
208
208
|
return [2 /*return*/];
|
|
209
209
|
}
|
|
210
210
|
});
|
|
@@ -220,7 +220,7 @@ describe('MultipleInput behaviour', function () {
|
|
|
220
220
|
return [4 /*yield*/, user.type(screen.getByRole('textbox'), 'test 2{Enter}')];
|
|
221
221
|
case 1:
|
|
222
222
|
_a.sent();
|
|
223
|
-
expect(props.onChange).
|
|
223
|
+
expect(props.onChange).toHaveBeenCalledWith(['test 1', 'test 2']);
|
|
224
224
|
return [2 /*return*/];
|
|
225
225
|
}
|
|
226
226
|
});
|
|
@@ -237,11 +237,11 @@ describe('MultipleInput behaviour', function () {
|
|
|
237
237
|
return [4 /*yield*/, user.type(screen.getByRole('textbox'), '{Enter}')];
|
|
238
238
|
case 1:
|
|
239
239
|
_a.sent();
|
|
240
|
-
expect(onChange).not.
|
|
240
|
+
expect(onChange).not.toHaveBeenCalled();
|
|
241
241
|
return [4 /*yield*/, user.type(screen.getByRole('textbox'), ' {Enter}')];
|
|
242
242
|
case 2:
|
|
243
243
|
_a.sent();
|
|
244
|
-
expect(onChange).not.
|
|
244
|
+
expect(onChange).not.toHaveBeenCalled();
|
|
245
245
|
return [2 /*return*/];
|
|
246
246
|
}
|
|
247
247
|
});
|
|
@@ -1,28 +1,32 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { mount, shallow } from 'enzyme';
|
|
3
3
|
import TextField from '@mui/material/TextField';
|
|
4
|
+
import MenuItem from '@mui/material/MenuItem';
|
|
4
5
|
import { ValueChip } from '../ValueChip';
|
|
5
6
|
import { MultipliableSelect } from './MultipliableSelect';
|
|
6
7
|
describe('MultipliableSelect', function () {
|
|
7
8
|
describe('single mode', function () {
|
|
8
9
|
it('should render MUI TextField with string value', function () {
|
|
9
10
|
var value = '1';
|
|
10
|
-
var wrapper = mount(React.createElement(MultipliableSelect, { value: value }
|
|
11
|
+
var wrapper = mount(React.createElement(MultipliableSelect, { value: value },
|
|
12
|
+
React.createElement(MenuItem, { value: "1" })));
|
|
11
13
|
expect(wrapper.find(TextField)).toHaveLength(1);
|
|
12
14
|
expect(wrapper.text()).toBe(value);
|
|
13
15
|
});
|
|
14
16
|
it('should call props.onChange on select change', function () {
|
|
15
17
|
var onChange = jest.fn();
|
|
16
18
|
var value = '1';
|
|
17
|
-
var wrapper = shallow(React.createElement(MultipliableSelect, { onChange: onChange }
|
|
19
|
+
var wrapper = shallow(React.createElement(MultipliableSelect, { onChange: onChange },
|
|
20
|
+
React.createElement("div", null)));
|
|
18
21
|
wrapper.find(TextField).simulate('change', { target: { value: value } });
|
|
19
|
-
expect(onChange).
|
|
22
|
+
expect(onChange).toHaveBeenCalledWith(value);
|
|
20
23
|
});
|
|
21
24
|
});
|
|
22
25
|
describe('multiple mode', function () {
|
|
23
26
|
it('should render MUI TextField with chip values', function () {
|
|
24
27
|
var value = ['1', '2', '3'];
|
|
25
|
-
var wrapper = mount(React.createElement(MultipliableSelect, { multiple: true, value: value }
|
|
28
|
+
var wrapper = mount(React.createElement(MultipliableSelect, { multiple: true, value: value },
|
|
29
|
+
React.createElement("div", null)));
|
|
26
30
|
expect(wrapper.find(TextField).prop('SelectProps').multiple).toBe(true);
|
|
27
31
|
expect(wrapper.find(ValueChip)).toHaveLength(value.length);
|
|
28
32
|
wrapper.find(ValueChip).forEach(function (n, i) {
|
|
@@ -32,16 +36,18 @@ describe('MultipliableSelect', function () {
|
|
|
32
36
|
it('should call props.onChange on select change', function () {
|
|
33
37
|
var onChange = jest.fn();
|
|
34
38
|
var value = ['1'];
|
|
35
|
-
var wrapper = shallow(React.createElement(MultipliableSelect, { multiple: true, onChange: onChange }
|
|
39
|
+
var wrapper = shallow(React.createElement(MultipliableSelect, { multiple: true, onChange: onChange },
|
|
40
|
+
React.createElement("div", null)));
|
|
36
41
|
wrapper.find(TextField).simulate('change', { target: { value: value } });
|
|
37
|
-
expect(onChange).
|
|
42
|
+
expect(onChange).toHaveBeenCalledWith(value);
|
|
38
43
|
});
|
|
39
44
|
it('should call props.onChange on Chip deletion', function () {
|
|
40
45
|
var value = ['1', '2', '3'];
|
|
41
46
|
var onChange = jest.fn();
|
|
42
|
-
var wrapper = mount(React.createElement(MultipliableSelect, { multiple: true, value: value, onChange: onChange }
|
|
47
|
+
var wrapper = mount(React.createElement(MultipliableSelect, { multiple: true, value: value, onChange: onChange },
|
|
48
|
+
React.createElement("div", null)));
|
|
43
49
|
wrapper.find(ValueChip).at(1).prop('onDelete')();
|
|
44
|
-
expect(onChange).
|
|
50
|
+
expect(onChange).toHaveBeenCalledWith(['1', '3']);
|
|
45
51
|
});
|
|
46
52
|
});
|
|
47
53
|
});
|
|
@@ -11,10 +11,10 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
};
|
|
12
12
|
import React from 'react';
|
|
13
13
|
import { shallow } from 'enzyme';
|
|
14
|
-
import * as mdmSdk from '@reltio/mdm-sdk';
|
|
15
14
|
import { NestedAttributeEditor } from './NestedAttributeEditor';
|
|
16
15
|
import { EditModeComplexAttribute } from '../EditModeComplexAttribute';
|
|
17
|
-
|
|
16
|
+
import { evaluateDeepEntityLabel, getLabel } from '@reltio/mdm-sdk';
|
|
17
|
+
jest.mock('@reltio/mdm-sdk', function () { return (__assign(__assign({}, jest.requireActual('@reltio/mdm-sdk')), { evaluateDeepEntityLabel: jest.fn(), getLabel: jest.fn() })); });
|
|
18
18
|
describe('NestedAttributeEditor', function () {
|
|
19
19
|
it('should render EditModeComplexAttribute with specified label and attributes', function () {
|
|
20
20
|
var props = {
|
|
@@ -25,8 +25,8 @@ describe('NestedAttributeEditor', function () {
|
|
|
25
25
|
attributeValue: {}
|
|
26
26
|
};
|
|
27
27
|
var label = 'Label123';
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
evaluateDeepEntityLabel.mockReturnValue(label);
|
|
29
|
+
getLabel.mockReturnValue(label);
|
|
30
30
|
var component = shallow(React.createElement(NestedAttributeEditor, __assign({}, props)));
|
|
31
31
|
var complex = component.find(EditModeComplexAttribute);
|
|
32
32
|
expect(complex.length).toBe(1);
|
|
@@ -98,7 +98,7 @@ describe('NumberEditor', function () {
|
|
|
98
98
|
return [4 /*yield*/, user.type(screen.getByRole('textbox'), '<-123,456abc_78>{enter}')];
|
|
99
99
|
case 1:
|
|
100
100
|
_a.sent();
|
|
101
|
-
expect(defaultProps.onChange).
|
|
101
|
+
expect(defaultProps.onChange).toHaveBeenCalledWith('-123456.78');
|
|
102
102
|
return [2 /*return*/];
|
|
103
103
|
}
|
|
104
104
|
});
|
|
@@ -116,7 +116,7 @@ describe('NumberEditor', function () {
|
|
|
116
116
|
return [4 /*yield*/, user.type(screen.getByRole('textbox'), '{enter}')];
|
|
117
117
|
case 1:
|
|
118
118
|
_a.sent();
|
|
119
|
-
expect(defaultProps.onChange).
|
|
119
|
+
expect(defaultProps.onChange).toHaveBeenCalledWith('123');
|
|
120
120
|
return [2 /*return*/];
|
|
121
121
|
}
|
|
122
122
|
});
|
|
@@ -155,7 +155,7 @@ describe('NumberEditor', function () {
|
|
|
155
155
|
return [4 /*yield*/, user.type(screen.getByRole('textbox'), '<-123,456abc_78>{enter}')];
|
|
156
156
|
case 1:
|
|
157
157
|
_a.sent();
|
|
158
|
-
expect(defaultProps.onChange).
|
|
158
|
+
expect(defaultProps.onChange).toHaveBeenCalledWith(['-123456.78']);
|
|
159
159
|
return [2 /*return*/];
|
|
160
160
|
}
|
|
161
161
|
});
|
|
@@ -173,7 +173,7 @@ describe('NumberEditor', function () {
|
|
|
173
173
|
return [4 /*yield*/, user.type(screen.getByRole('textbox'), '123.45{enter}')];
|
|
174
174
|
case 1:
|
|
175
175
|
_a.sent();
|
|
176
|
-
expect(defaultProps.onChange).
|
|
176
|
+
expect(defaultProps.onChange).toHaveBeenCalledWith(['12345']);
|
|
177
177
|
return [2 /*return*/];
|
|
178
178
|
}
|
|
179
179
|
});
|
|
@@ -90,7 +90,7 @@ describe('PieChart', function () {
|
|
|
90
90
|
var wrapper = mount(React.createElement(PieChart, { width: 600, height: 300, data: data, onItemClick: onItemClick }));
|
|
91
91
|
var sector = wrapper.find('.recharts-pie-sector').first();
|
|
92
92
|
sector.simulate('click');
|
|
93
|
-
expect(onItemClick).
|
|
93
|
+
expect(onItemClick).toHaveBeenCalledWith('1');
|
|
94
94
|
});
|
|
95
95
|
it('should render chart legend with percents correctly', function () {
|
|
96
96
|
var legendPayload = [
|
|
@@ -46,7 +46,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
48
|
import React from 'react';
|
|
49
|
-
import
|
|
49
|
+
import { getFilteredEntities, getTotals } from '@reltio/mdm-sdk';
|
|
50
50
|
import { render, screen } from '@testing-library/react';
|
|
51
51
|
import userEvent from '@testing-library/user-event';
|
|
52
52
|
import { MdmModuleProvider } from '../contexts/MdmModuleContext';
|
|
@@ -138,10 +138,10 @@ describe('PivotingTooltip test', function () {
|
|
|
138
138
|
lookupCode: '8-800-555-35-35',
|
|
139
139
|
lookupRawValue: '8-800-555-35-35'
|
|
140
140
|
};
|
|
141
|
-
|
|
142
|
-
.
|
|
143
|
-
.mockResolvedValue(
|
|
144
|
-
|
|
141
|
+
beforeEach(function () {
|
|
142
|
+
getFilteredEntities.mockResolvedValue(mockGetFilteredEntitiesResponse);
|
|
143
|
+
getTotals.mockResolvedValue({ total: 5 });
|
|
144
|
+
});
|
|
145
145
|
it('getTotals should not be called if user do not hover tooltip', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
146
146
|
var value, attributeType, props, tooltip;
|
|
147
147
|
return __generator(this, function (_a) {
|
|
@@ -159,8 +159,8 @@ describe('PivotingTooltip test', function () {
|
|
|
159
159
|
case 1:
|
|
160
160
|
tooltip = _a.sent();
|
|
161
161
|
expect(tooltip).toBeInTheDocument();
|
|
162
|
-
expect(
|
|
163
|
-
expect(
|
|
162
|
+
expect(getTotals).toHaveBeenCalledTimes(0);
|
|
163
|
+
expect(getFilteredEntities).toHaveBeenCalledTimes(0);
|
|
164
164
|
return [2 /*return*/];
|
|
165
165
|
}
|
|
166
166
|
});
|
|
@@ -192,7 +192,7 @@ describe('PivotingTooltip test', function () {
|
|
|
192
192
|
case 4:
|
|
193
193
|
tooltipContent = _a.sent();
|
|
194
194
|
expect(tooltipContent).toBeInTheDocument();
|
|
195
|
-
expect(
|
|
195
|
+
expect(getFilteredEntities).toHaveBeenCalledWith({
|
|
196
196
|
filters: [
|
|
197
197
|
{ fieldName: 'type', filter: 'equals', values: ['configuration/entityTypes/HCP'] },
|
|
198
198
|
{ fieldName: 'attributes.Phone', filter: 'equals', values: ['8-800-555-35-35'] }
|
|
@@ -242,7 +242,7 @@ describe('PivotingTooltip test', function () {
|
|
|
242
242
|
case 4:
|
|
243
243
|
tooltipContent = _a.sent();
|
|
244
244
|
expect(tooltipContent).toBeInTheDocument();
|
|
245
|
-
expect(
|
|
245
|
+
expect(getFilteredEntities).toHaveBeenCalledWith({
|
|
246
246
|
filters: [
|
|
247
247
|
{ fieldName: 'type', filter: 'equals', values: ['configuration/entityTypes/HCP_1'] },
|
|
248
248
|
{ fieldName: 'attributes.Phone', filter: 'equals', values: ['8-800-555-35-35'] }
|
|
@@ -286,7 +286,7 @@ describe('PivotingTooltip test', function () {
|
|
|
286
286
|
case 4:
|
|
287
287
|
tooltipContent = _a.sent();
|
|
288
288
|
expect(tooltipContent).toBeInTheDocument();
|
|
289
|
-
expect(
|
|
289
|
+
expect(getTotals).toHaveBeenCalledWith({
|
|
290
290
|
filters: [
|
|
291
291
|
{ fieldName: 'type', filter: 'equals', values: ['configuration/entityTypes/HCP'] },
|
|
292
292
|
{ fieldName: 'attributes.Phone', filter: 'equals', values: ['8-800-555-35-35'] }
|
|
@@ -336,7 +336,7 @@ describe('PivotingTooltip test', function () {
|
|
|
336
336
|
case 4:
|
|
337
337
|
tooltipContent = _a.sent();
|
|
338
338
|
expect(tooltipContent).toBeInTheDocument();
|
|
339
|
-
expect(
|
|
339
|
+
expect(getTotals).toHaveBeenCalledWith({
|
|
340
340
|
filters: [
|
|
341
341
|
{ fieldName: 'type', filter: 'equals', values: ['configuration/entityTypes/HCP_1'] },
|
|
342
342
|
{ fieldName: 'attributes.Phone', filter: 'equals', values: ['8-800-555-35-35'] }
|
package/esm/PivotingTooltip/components/PivotingTooltipContent/PivotingTooltipContent.test.js
CHANGED
|
@@ -48,14 +48,11 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
48
48
|
import React from 'react';
|
|
49
49
|
import { mount } from 'enzyme';
|
|
50
50
|
import { act } from 'react-dom/test-utils';
|
|
51
|
-
import
|
|
52
|
-
import { PivotingTooltipContent } from './PivotingTooltipContent';
|
|
51
|
+
import { getTotals } from '@reltio/mdm-sdk';
|
|
53
52
|
import { PivotingUriLink } from '../../../PivotingUriLink';
|
|
54
53
|
import { MdmModuleProvider } from '../../../contexts/MdmModuleContext';
|
|
54
|
+
import { PivotingTooltipContent } from './PivotingTooltipContent';
|
|
55
55
|
jest.mock('@reltio/mdm-sdk', function () { return (__assign(__assign({}, jest.requireActual('@reltio/mdm-sdk')), { getFilteredEntities: jest.fn(), getTotals: jest.fn() })); });
|
|
56
|
-
jest.mock('../../../EntityAvatar', function () { return ({
|
|
57
|
-
EntityUriLink: function () { return React.createElement("div", null); }
|
|
58
|
-
}); });
|
|
59
56
|
jest.mock('../../../EntityAvatar', function () { return ({
|
|
60
57
|
EntityAvatar: function () { return React.createElement("div", null); }
|
|
61
58
|
}); });
|
|
@@ -172,7 +169,7 @@ describe('PivotingTooltipContent test', function () {
|
|
|
172
169
|
it('should not show footer with see all button if total count less than 6', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
173
170
|
var component;
|
|
174
171
|
return __generator(this, function (_a) {
|
|
175
|
-
|
|
172
|
+
getTotals.mockImplementation(function () { return Promise.resolve({ total: 4 }); });
|
|
176
173
|
component = setUp();
|
|
177
174
|
expect(component.find('.footer')).toHaveLength(0);
|
|
178
175
|
return [2 /*return*/];
|
|
@@ -181,7 +178,7 @@ describe('PivotingTooltipContent test', function () {
|
|
|
181
178
|
it('should show footer with see all button if total count more than 6', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
182
179
|
var component;
|
|
183
180
|
return __generator(this, function (_a) {
|
|
184
|
-
|
|
181
|
+
getTotals.mockImplementation(function () { return Promise.resolve({ total: 10 }); });
|
|
185
182
|
component = setUp(__assign(__assign({}, defaultProps), { total: 7 }));
|
|
186
183
|
expect(component.find('.footer')).toHaveLength(1);
|
|
187
184
|
return [2 /*return*/];
|
|
@@ -99,6 +99,7 @@ describe('EntityUriLink tests', function () {
|
|
|
99
99
|
onClick = defaultProps.onClick;
|
|
100
100
|
user = setUp().user;
|
|
101
101
|
link = screen.getByText('label');
|
|
102
|
+
link.addEventListener('click', function (event) { return event.preventDefault(); }, false);
|
|
102
103
|
return [4 /*yield*/, user.keyboard('{Control>}')];
|
|
103
104
|
case 1:
|
|
104
105
|
_a.sent();
|
|
@@ -195,7 +195,7 @@ describe('useSearchNavigation behavior', function () {
|
|
|
195
195
|
case 1:
|
|
196
196
|
_b.sent();
|
|
197
197
|
expect(mdmActions.updateSearchNavigationDataFields).toHaveBeenCalledTimes(1);
|
|
198
|
-
expect(mdmActions.openEntity).
|
|
198
|
+
expect(mdmActions.openEntity).toHaveBeenCalledTimes(1);
|
|
199
199
|
expect(mdmActions.updateSearchNavigationDataFields).toHaveBeenCalledWith({
|
|
200
200
|
index: defaultMdmValues.searchNavigationData.index - 1,
|
|
201
201
|
uri: 'uri0',
|
|
@@ -263,7 +263,7 @@ describe('useSearchNavigation behavior', function () {
|
|
|
263
263
|
case 1:
|
|
264
264
|
_b.sent();
|
|
265
265
|
expect(mdmActions.updateSearchNavigationDataFields).toHaveBeenCalledTimes(1);
|
|
266
|
-
expect(mdmActions.openEntity).
|
|
266
|
+
expect(mdmActions.openEntity).toHaveBeenCalledTimes(1);
|
|
267
267
|
expect(mdmActions.updateSearchNavigationDataFields).toHaveBeenCalledWith({
|
|
268
268
|
index: searchNavigationData.index - 2,
|
|
269
269
|
uri: 'uri0',
|
|
@@ -305,7 +305,7 @@ describe('useSearchNavigation behavior', function () {
|
|
|
305
305
|
case 1:
|
|
306
306
|
_b.sent();
|
|
307
307
|
expect(mdmActions.updateSearchNavigationDataFields).toHaveBeenCalledTimes(1);
|
|
308
|
-
expect(mdmActions.openEntity).
|
|
308
|
+
expect(mdmActions.openEntity).toHaveBeenCalledTimes(0);
|
|
309
309
|
expect(mdmActions.updateSearchNavigationDataFields).toHaveBeenCalledWith({
|
|
310
310
|
index: searchNavigationData.index - 2,
|
|
311
311
|
cache: ['uri2'],
|
|
@@ -17,7 +17,7 @@ import { EntityUriLink } from '../EntityUriLink';
|
|
|
17
17
|
import { EntityAvatar } from '../EntityAvatar';
|
|
18
18
|
import { ProfilesList } from './ProfilesList';
|
|
19
19
|
import { ImportModes } from '../types';
|
|
20
|
-
var EntityAvatarMock = function (
|
|
20
|
+
var EntityAvatarMock = function () { return React.createElement("div", null); };
|
|
21
21
|
jest.mock('../EntityAvatar', function () { return ({
|
|
22
22
|
EntityAvatar: EntityAvatarMock
|
|
23
23
|
}); });
|
|
@@ -11,7 +11,7 @@ describe('ReactSelectLoadMoreButton tests', function () {
|
|
|
11
11
|
expect(component.find(Button).text()).toEqual('Load more');
|
|
12
12
|
var event = {};
|
|
13
13
|
component.find(Button).prop('onClick')(event);
|
|
14
|
-
expect(onClick).
|
|
14
|
+
expect(onClick).toHaveBeenCalled();
|
|
15
15
|
});
|
|
16
16
|
it('should render loading state', function () {
|
|
17
17
|
var component = shallow(React.createElement(ReactSelectLoadMoreButton, { loading: true, onClick: onClick }));
|
|
@@ -11,12 +11,11 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
};
|
|
12
12
|
import React from 'react';
|
|
13
13
|
import { mount } from 'enzyme';
|
|
14
|
-
import { Mode } from '@reltio/mdm-sdk';
|
|
14
|
+
import { Mode, createTemporaryEntity } from '@reltio/mdm-sdk';
|
|
15
15
|
import { referenceAttrType, metadata } from './metadata.test-data';
|
|
16
16
|
import ReferenceAttributeEditor from './ReferenceAttributeEditor';
|
|
17
17
|
import { EditModeComplexAttribute } from '../EditModeComplexAttribute';
|
|
18
18
|
import { EntitySelector } from '../EntitySelector';
|
|
19
|
-
import * as mdmSdk from '@reltio/mdm-sdk';
|
|
20
19
|
import { ErrorWrapper } from '../ErrorWrapper';
|
|
21
20
|
import { useScrollToAttributeError } from '../hooks/useScrollToAttributeError';
|
|
22
21
|
import { ScrollType, ScrollToElementContext } from '../contexts/ScrollToElementContext';
|
|
@@ -493,9 +492,9 @@ describe('ReferenceAttributeEditor', function () {
|
|
|
493
492
|
uri: 'entities/uri$$1',
|
|
494
493
|
label: 'New entity!'
|
|
495
494
|
};
|
|
496
|
-
|
|
495
|
+
createTemporaryEntity.mockReturnValue(mockedNewEntity);
|
|
497
496
|
entitySelector.prop('onCreate')(entityTypeUri);
|
|
498
|
-
expect(
|
|
497
|
+
expect(createTemporaryEntity).toHaveBeenCalledWith(expect.objectContaining({
|
|
499
498
|
entityTypeUri: entityTypeUri,
|
|
500
499
|
attributeTypes: [
|
|
501
500
|
{
|
|
@@ -554,9 +553,9 @@ describe('ReferenceAttributeEditor', function () {
|
|
|
554
553
|
uri: 'entities/uri$$1',
|
|
555
554
|
label: 'New entity!'
|
|
556
555
|
};
|
|
557
|
-
|
|
556
|
+
createTemporaryEntity.mockReturnValue(mockedNewEntity);
|
|
558
557
|
entitySelector.prop('onCreate')(entityTypeUri);
|
|
559
|
-
expect(
|
|
558
|
+
expect(createTemporaryEntity).toHaveBeenCalledWith(expect.objectContaining({ entityTypeUri: entityTypeUri }));
|
|
560
559
|
expect(mdmActions.entityDeleted).toHaveBeenCalledWith(modifiedEntity.uri);
|
|
561
560
|
expect(mdmActions.entityCreated).toHaveBeenCalledWith(mockedNewEntity);
|
|
562
561
|
expect(props.onChangeAttribute).toHaveBeenCalledWith({
|
|
@@ -588,9 +587,9 @@ describe('ReferenceAttributeEditor', function () {
|
|
|
588
587
|
uri: 'entities/uri$$1',
|
|
589
588
|
label: 'New entity!'
|
|
590
589
|
};
|
|
591
|
-
|
|
590
|
+
createTemporaryEntity.mockReturnValue(mockedNewEntity);
|
|
592
591
|
entitySelector.prop('onCreate')(entityTypeUri, initValue);
|
|
593
|
-
expect(
|
|
592
|
+
expect(createTemporaryEntity).toHaveBeenCalledWith({
|
|
594
593
|
entityTypeUri: entityTypeUri,
|
|
595
594
|
initValue: initValue,
|
|
596
595
|
attributeTypes: [
|
|
@@ -176,7 +176,7 @@ describe('RelationEditor behaviour', function () {
|
|
|
176
176
|
return [4 /*yield*/, user.click(inputs[0])];
|
|
177
177
|
case 1:
|
|
178
178
|
_a.sent();
|
|
179
|
-
expect(typeAheadSearch).
|
|
179
|
+
expect(typeAheadSearch).toHaveBeenCalledWith([{ label: 'Address', uri: 'configuration/entityTypes/Location' }], '', {
|
|
180
180
|
globalFilter: '',
|
|
181
181
|
max: 20,
|
|
182
182
|
searchOptions: '',
|
|
@@ -22,8 +22,7 @@ import React from 'react';
|
|
|
22
22
|
import { mount } from 'enzyme';
|
|
23
23
|
import Button from '@mui/material/Button';
|
|
24
24
|
import Typography from '@mui/material/Typography';
|
|
25
|
-
import { ACTIVENESS_ATTR_TYPES, Directions, ErrorSource, Mode } from '@reltio/mdm-sdk';
|
|
26
|
-
import * as mdmSdk from '@reltio/mdm-sdk';
|
|
25
|
+
import { ACTIVENESS_ATTR_TYPES, Directions, ErrorSource, Mode, createTemporaryEntity, getEntityType, getInOutRelations, validateConnection } from '@reltio/mdm-sdk';
|
|
27
26
|
import RelationEditor from './RelationEditor';
|
|
28
27
|
import { ConnectionRelationTypeSelector } from '../ConnectionRelationTypeSelector';
|
|
29
28
|
import { ErrorWrapper } from '../ErrorWrapper';
|
|
@@ -184,7 +183,7 @@ describe('RelationEditor', function () {
|
|
|
184
183
|
};
|
|
185
184
|
var props = __assign(__assign({}, defaultProps), { connection: connection, config: config });
|
|
186
185
|
setUp({ props: props });
|
|
187
|
-
expect(
|
|
186
|
+
expect(getInOutRelations).toHaveBeenCalledWith({
|
|
188
187
|
content: config.content,
|
|
189
188
|
direction: Directions.IN,
|
|
190
189
|
relationType: 'configuration/relationTypes/AccountTeam',
|
|
@@ -211,7 +210,7 @@ describe('RelationEditor', function () {
|
|
|
211
210
|
};
|
|
212
211
|
var props = __assign(__assign({}, defaultProps), { connection: connection, config: config });
|
|
213
212
|
setUp({ props: props });
|
|
214
|
-
expect(
|
|
213
|
+
expect(getInOutRelations).toHaveBeenCalledWith({
|
|
215
214
|
content: config.contentSecondLevel,
|
|
216
215
|
direction: Directions.IN,
|
|
217
216
|
relationType: 'configuration/relationTypes/AccountTeam',
|
|
@@ -692,7 +691,7 @@ describe('RelationEditor', function () {
|
|
|
692
691
|
expect(mdmActions.closeRelationEditor).not.toHaveBeenCalledWith(config.id, expect.any(String));
|
|
693
692
|
});
|
|
694
693
|
it('should evaluate and update connection entity label if modified entity is specified', function () {
|
|
695
|
-
|
|
694
|
+
getEntityType.mockReturnValue({ dataLabelPattern: '{Name}' });
|
|
696
695
|
var expectedLabel = 'new Label!';
|
|
697
696
|
var modifiedEntity = {
|
|
698
697
|
uri: 'entities/uri$$1',
|
|
@@ -753,7 +752,7 @@ describe('RelationEditor', function () {
|
|
|
753
752
|
expect(mdmActions.closeRelationEditor).toHaveBeenCalledWith(config.id, expectedConnection.relation.relationUri);
|
|
754
753
|
});
|
|
755
754
|
it('should not update connection entity label if modified entity is not specified', function () {
|
|
756
|
-
|
|
755
|
+
getEntityType.mockReturnValue({ dataLabelPattern: '{Name}' });
|
|
757
756
|
var props = __assign(__assign({}, defaultProps), { config: config, metadata: { relationTypes: relationTypes, entityTypes: [] } });
|
|
758
757
|
var component = setUp({ props: props });
|
|
759
758
|
var applyButton = findApplyButton(component);
|
|
@@ -808,7 +807,7 @@ describe('RelationEditor', function () {
|
|
|
808
807
|
expect(mdmActions.closeRelationEditor).toHaveBeenCalledWith(config.id, expectedConnection.relation.relationUri);
|
|
809
808
|
});
|
|
810
809
|
it('should clean up outdated temp modified entities', function () {
|
|
811
|
-
|
|
810
|
+
getEntityType.mockReturnValue({});
|
|
812
811
|
var connection = {
|
|
813
812
|
relation: { relationUri: relationUri },
|
|
814
813
|
entity: { entityUri: 'entities/uri$$relationEntity' }
|
|
@@ -905,8 +904,8 @@ describe('RelationEditor', function () {
|
|
|
905
904
|
expect(mdmActions.entityDeleted).toHaveBeenCalledWith('entities/uri$$locationEntity');
|
|
906
905
|
expect(mdmActions.entityDeleted).not.toHaveBeenCalledWith('entities/uri$$notRelatedEntity');
|
|
907
906
|
});
|
|
908
|
-
it('should call
|
|
909
|
-
|
|
907
|
+
it('should call validateConnection with correct params', function () {
|
|
908
|
+
getEntityType.mockReturnValue({});
|
|
910
909
|
var connection = {
|
|
911
910
|
relation: { relationUri: relationUri },
|
|
912
911
|
entity: { entityUri: 'entities/uri$$relationEntity' }
|
|
@@ -937,7 +936,7 @@ describe('RelationEditor', function () {
|
|
|
937
936
|
applyButton = findApplyButton(component);
|
|
938
937
|
expect(applyButton.prop('disabled')).toBe(false);
|
|
939
938
|
applyButton.find('button').simulate('click');
|
|
940
|
-
expect(
|
|
939
|
+
expect(validateConnection).toHaveBeenCalledWith(metadata, updatedAllModifiedEntities, updatedConnecton);
|
|
941
940
|
});
|
|
942
941
|
it('should enable Apply button if modified entity was changed', function () {
|
|
943
942
|
var connection = { relation: { relationUri: relationUri }, entity: { entityUri: 'entities/uri$$123' } };
|
|
@@ -1260,8 +1259,8 @@ describe('RelationEditor', function () {
|
|
|
1260
1259
|
describe('onCreate behavior', function () {
|
|
1261
1260
|
it('should create new entity and call events for saving it in relation and in modified entities store slice', function () {
|
|
1262
1261
|
var mockedNewEntity = { uri: 'entities/uri$$1' };
|
|
1263
|
-
|
|
1264
|
-
|
|
1262
|
+
createTemporaryEntity.mockReturnValue(mockedNewEntity);
|
|
1263
|
+
getEntityType.mockReturnValue({ dataLabelPattern: '{Name}' });
|
|
1265
1264
|
var connection = {
|
|
1266
1265
|
relation: {
|
|
1267
1266
|
relationUri: relationUri,
|
|
@@ -1276,16 +1275,16 @@ describe('RelationEditor', function () {
|
|
|
1276
1275
|
var entitySelector = component.find(EntitySelector);
|
|
1277
1276
|
expect(entitySelector.length).toBe(1);
|
|
1278
1277
|
entitySelector.prop('onCreate')(entityTypeUri);
|
|
1279
|
-
expect(
|
|
1280
|
-
expect(
|
|
1278
|
+
expect(getEntityType).toHaveBeenCalledWith(metadata, entityTypeUri);
|
|
1279
|
+
expect(createTemporaryEntity).toHaveBeenCalledWith(expect.objectContaining({ entityTypeUri: entityTypeUri }));
|
|
1281
1280
|
expect(mdmActions.setRelationEntity).toHaveBeenCalledWith(config.id, connection.relation.relationUri, mockedNewEntity);
|
|
1282
1281
|
expect(mdmActions.entityCreated).toHaveBeenCalledWith(mockedNewEntity);
|
|
1283
1282
|
expect(mdmAction).toHaveBeenCalledTimes(2);
|
|
1284
1283
|
});
|
|
1285
1284
|
it('should delete previous temp (modified) entity before creating new one', function () {
|
|
1286
1285
|
var mockedNewEntity = { uri: 'entities/uri$$1' };
|
|
1287
|
-
|
|
1288
|
-
|
|
1286
|
+
createTemporaryEntity.mockReturnValue(mockedNewEntity);
|
|
1287
|
+
getEntityType.mockReturnValue({ dataLabelPattern: '{Name}' });
|
|
1289
1288
|
var connection = {
|
|
1290
1289
|
relation: {
|
|
1291
1290
|
relationUri: relationUri,
|
|
@@ -1302,8 +1301,8 @@ describe('RelationEditor', function () {
|
|
|
1302
1301
|
var entitySelector = component.find(EntitySelector);
|
|
1303
1302
|
expect(entitySelector.length).toBe(1);
|
|
1304
1303
|
entitySelector.prop('onCreate')(entityTypeUri);
|
|
1305
|
-
expect(
|
|
1306
|
-
expect(
|
|
1304
|
+
expect(getEntityType).toHaveBeenCalledWith(metadata, entityTypeUri);
|
|
1305
|
+
expect(createTemporaryEntity).toHaveBeenCalledWith(expect.objectContaining({ entityTypeUri: entityTypeUri }));
|
|
1307
1306
|
expect(mdmActions.setInitialInfo).toHaveBeenCalledWith(config.id, relationUri, modifiedEntity);
|
|
1308
1307
|
expect(mdmActions.entityDeleted).toHaveBeenCalledWith('entities/uri$$prev');
|
|
1309
1308
|
expect(mdmActions.setRelationEntity).toHaveBeenCalledWith(config.id, connection.relation.relationUri, mockedNewEntity);
|
|
@@ -1365,15 +1364,15 @@ describe('RelationEditor', function () {
|
|
|
1365
1364
|
var mockedNewEntity = { uri: 'entities/uri$$1' };
|
|
1366
1365
|
var initValue = '123';
|
|
1367
1366
|
var metadata = { relationTypes: [] };
|
|
1368
|
-
|
|
1369
|
-
|
|
1367
|
+
getEntityType.mockReturnValue(entityType);
|
|
1368
|
+
createTemporaryEntity.mockReturnValue(mockedNewEntity);
|
|
1370
1369
|
var props = __assign(__assign({}, defaultProps), { connection: connection, config: config, metadata: metadata });
|
|
1371
1370
|
var component = setUp({ props: props });
|
|
1372
1371
|
var entitySelector = component.find(EntitySelector);
|
|
1373
1372
|
expect(entitySelector.length).toBe(1);
|
|
1374
1373
|
entitySelector.prop('onCreate')(entityTypeUri, initValue);
|
|
1375
|
-
expect(
|
|
1376
|
-
expect(
|
|
1374
|
+
expect(getEntityType).toHaveBeenCalledWith(metadata, entityTypeUri);
|
|
1375
|
+
expect(createTemporaryEntity).toHaveBeenCalledWith({
|
|
1377
1376
|
entityTypeUri: entityTypeUri,
|
|
1378
1377
|
initValue: initValue,
|
|
1379
1378
|
attributeTypes: [
|