@reltio/components 1.4.2070 → 1.4.2072
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/AttributesView/AttributesView.js +1 -1
- package/ColumnsSettings/components/ColumnsSettingsPopup/ColumnsSettingsPopup.d.ts +2 -3
- package/ColumnsSettings/helpers.d.ts +3 -1
- package/ColumnsSettings/types.d.ts +8 -0
- package/CommentsContainer/CommentsContainer.js +1 -1
- package/ConfigureColumnsPopup/ConfigureColumnsPopup.d.ts +23 -40
- package/ConfigureColumnsPopup/ConfigureColumnsPopup.js +6 -26
- package/EditModeAttributesList/EditModeAttributesList.js +1 -1
- package/EditModeAttributesPager/EditModeAttributesPager.test.js +1 -1
- package/EditModeAttributesPager/components/AttributeRenderer/AttributeRenderer.js +1 -1
- package/FacetViewHeader/FacetViewHeader.js +1 -1
- package/ImageAttributesLine/imageAttributeValues.test-data.js +8 -0
- package/ImageAttributesLine/index.d.ts +1 -1
- package/ImageAttributesLine/index.js +1 -1
- package/ImageDetailsView/components/ImageDetailsViewCarousel/ImageDetailsViewCarousel.js +1 -1
- package/MergeButton/MergeButton.spec.js +55 -124
- package/MetadataTypesSelector/MetadataTypesSelector.d.ts +2 -1
- package/MetadataTypesSelector/MetadataTypesSelector.js +1 -1
- package/MetadataTypesSelector/MetadataTypesSelector.test.js +193 -190
- package/MetadataTypesSelector/components/SelectMetadataTypesList/SelectMetadataTypesList.d.ts +5 -6
- package/MoreAttributesButton/MoreAttributesButton.test.js +173 -166
- package/MoreAttributesButton/useMoreAttributesItems.d.ts +1 -1
- package/MultiValueSelector/MultiValueSelector.test.js +78 -38
- package/MultipliableSelect/MultipliableSelect.test.js +111 -47
- package/NestedAttribute/NestedAttribute.test.js +121 -42
- package/NestedAttributeEditor/NestedAttributeEditor.test.js +95 -41
- package/NotMatchButton/NotMatchButton.spec.js +51 -100
- package/PieChart/PieChart.test.js +130 -114
- package/PinButton/PinButton.spec.js +89 -22
- package/PivotingTooltip/PivotingTooltip.test.js +338 -174
- package/PotentialMatchReviewCard/PotentialMatchReviewCard.spec.js +94 -29
- package/ProfileBand/ProfileBand.spec.js +60 -53
- package/ProfileCard/ProfileCard.test.js +109 -27
- package/ProfilesList/ProfilesList.d.ts +1 -3
- package/ProfilesList/ProfilesList.js +1 -1
- package/ProfilesList/ProfilesList.spec.js +226 -211
- package/QueryBuilderRow/QueryBuilderRow.spec.js +83 -90
- package/QueryBuilderRowsGroup/QueryBuilderRowsGroup.spec.js +195 -86
- package/ReactSelectLoadMoreButton/ReactSelectLoadMoreButton.test.js +73 -15
- package/ReactSelectMenuWithPopper/ReactSelectMenuWithPopper.test.js +71 -117
- package/ReadOnlyAttributeValuesBlock/ReadOnlyAttributeValuesBlock.test.js +128 -61
- package/ReadOnlyAttributesFactory/components/ReadOnlyAttribute/ReadOnlyAttribute.test.js +179 -44
- package/ReadOnlyAttributesList/ReadOnlyAttributesList.js +1 -1
- package/ReadOnlyAttributesList/ReadOnlyAttributesList.test.js +254 -211
- package/ReadOnlyAttributesList/attributes.test-data.js +4 -4
- package/ReadOnlyAttributesPager/ReadOnlyAttributesPager.js +1 -1
- package/ReadOnlyAttributesPager/ReadOnlyAttributesPager.test.js +75 -18
- package/ReadOnlyAttributesView/ReadOnlyAttributesView.js +1 -1
- package/ReadOnlyAttributesView/ReadOnlyAttributesView.test.js +187 -312
- package/ReadOnlyComplexAttribute/ReadOnlyComplexAttribute.test.js +210 -219
- package/ReadOnlyImageAttributesLine/ReadOnlyImageAttributesLine.test.js +89 -89
- package/ReferenceAttributeEditor/ReferenceAttributeEditor.test.js +556 -602
- package/ReferenceAttributeEditor/metadata.test-data.d.ts +13 -13
- package/ReferenceAttributeEditor/metadata.test-data.js +2 -2
- package/ReferenceAttributeEditor/styles.d.ts +1 -1
- package/RelationEditor/RelationEditor.test.js +1448 -1392
- package/RelationTypeSelector/RelationTypeSelector.test.js +99 -17
- package/RelationTypesSelector/RelationTypesSelector.test.js +73 -22
- package/ReltioMap/ReltioMap.spec.js +51 -25
- package/Roles/Roles.test.js +54 -10
- package/ScreenProfileBand/ScreenProfileBand.test.js +142 -72
- package/ScrollableTabs/ScrollableTabs.test.js +69 -19
- package/SearchHighlighter/SearchHighlighter.test.js +18 -7
- package/SelectAttributesList/SelectAttributesList.d.ts +11 -6
- package/SelectAttributesList/SelectAttributesList.js +5 -2
- package/SelectorWithOnlyOptionAutoSelect/SelectorWithOnlyOptionAutoSelect.test.js +109 -60
- package/SidePanelContentHeader/SidePanelContentHeader.js +2 -2
- package/SidePanelContentHeader/SidePanelContentHeader.test.js +104 -0
- package/SidePanelEmptyState/SidePanelEmptyState.js +1 -1
- package/SidePanelEmptyState/SidePanelEmptyState.test.js +24 -0
- package/SimpleAttribute/SimpleAttribute.js +1 -1
- package/SimpleAttribute/SimpleAttribute.test.js +155 -80
- package/SimpleAttributeEditor/SimpleAttributeEditor.test.js +339 -330
- package/SimpleAttributeEditor/useAttributeValuePermissions.js +1 -1
- package/SimpleDropDownSelector/SimpleDropDownSelector.test.js +86 -10
- package/SimpleDropDownSelector/components/DropDownPlaceholder/DropDownPlaceholder.js +1 -1
- package/SimpleDropDownSelector/components/DropDownValue/DropDownValue.js +1 -1
- package/SimpleMatchRulesBlock/SimpleMatchRulesBlock.test.js +128 -32
- package/SmallIconButton/SmallIconButton.test.js +98 -25
- package/TableWithBars/TableWithBars.test.js +98 -60
- package/TableWithBars/components/AttributeCellRenderer/AttributeCellRenderer.js +1 -1
- package/TableWithBars/components/HeadCellRenderer/HeadCellRenderer.js +1 -1
- package/Tags/Tags.d.ts +0 -1
- package/Tags/Tags.test.js +8 -7
- package/TransitiveMatchBlock/TransitiveMatchBlock.test.js +78 -22
- package/TransitiveMatchRule/TransitiveMatchRule.test.js +78 -37
- package/TransitiveMatchRulesTooltip/TransitiveMatchRulesTooltip.js +1 -1
- package/TransitiveMatchRulesTooltip/TransitiveMatchRulesTooltip.test.js +12 -18
- package/UploadFileButton/UploadFileButton.d.ts +2 -2
- package/UploadFileButton/UploadFileButton.test.js +199 -0
- package/UploadImageDialog/UploadImageDialog.test.js +1 -0
- package/UploadImageDialog/components/DividerWithText/DividerWithText.js +1 -1
- package/UploadImageDialog/components/ErrorSnackbar/ErrorSnackbar.test.js +80 -22
- package/UploadImageDialog/components/ImageByUrlField/ImageByUrlField.js +1 -1
- package/UploadImageDialog/components/ImageByUrlField/ImageByUrlField.test.js +162 -49
- package/ValueChip/ValueChip.test.js +7 -23
- package/VirtualGroupedList/VirtualGroupedList.d.ts +19 -31
- package/VirtualGroupedList/VirtualGroupedList.js +11 -36
- package/VirtualGroupedList/VirtualGroupedList.test.js +224 -0
- package/VirtualGroupedList/helpers.d.ts +7 -2
- package/VirtualGroupedList/helpers.js +3 -1
- package/VirtualGroupedList/index.d.ts +1 -1
- package/VirtualGroupedList/types.d.ts +10 -6
- package/VirtualGroupedList/useScrollToFocusItem.d.ts +8 -5
- package/WhiteSearchInput/{WhiteSearchInput.spec.js → WhiteSearchInput.test.js} +3 -8
- package/cjs/AttributesView/AttributesView.js +2 -2
- package/cjs/ColumnsSettings/components/ColumnsSettingsPopup/ColumnsSettingsPopup.d.ts +2 -3
- package/cjs/ColumnsSettings/helpers.d.ts +3 -1
- package/cjs/ColumnsSettings/types.d.ts +8 -0
- package/cjs/ColumnsSettings/types.js +2 -0
- package/cjs/CommentsContainer/CommentsContainer.js +1 -1
- package/cjs/ConfigureColumnsPopup/ConfigureColumnsPopup.d.ts +23 -40
- package/cjs/ConfigureColumnsPopup/ConfigureColumnsPopup.js +6 -26
- package/cjs/EditModeAttributesList/EditModeAttributesList.js +2 -2
- package/cjs/EditModeAttributesPager/EditModeAttributesPager.test.js +2 -2
- package/cjs/EditModeAttributesPager/components/AttributeRenderer/AttributeRenderer.js +2 -2
- package/cjs/FacetViewHeader/FacetViewHeader.js +1 -1
- package/cjs/ImageAttributesLine/imageAttributeValues.test-data.js +8 -0
- package/cjs/ImageAttributesLine/index.d.ts +1 -1
- package/cjs/ImageAttributesLine/index.js +2 -1
- package/cjs/ImageDetailsView/components/ImageDetailsViewCarousel/ImageDetailsViewCarousel.js +1 -1
- package/cjs/MergeButton/MergeButton.spec.js +55 -124
- package/cjs/MetadataTypesSelector/MetadataTypesSelector.d.ts +2 -1
- package/cjs/MetadataTypesSelector/MetadataTypesSelector.js +1 -1
- package/cjs/MetadataTypesSelector/MetadataTypesSelector.test.js +193 -190
- package/cjs/MetadataTypesSelector/components/SelectMetadataTypesList/SelectMetadataTypesList.d.ts +5 -6
- package/cjs/MoreAttributesButton/MoreAttributesButton.test.js +172 -165
- package/cjs/MoreAttributesButton/useMoreAttributesItems.d.ts +1 -1
- package/cjs/MultiValueSelector/MultiValueSelector.test.js +78 -38
- package/cjs/MultipliableSelect/MultipliableSelect.test.js +111 -47
- package/cjs/NestedAttribute/NestedAttribute.test.js +121 -42
- package/cjs/NestedAttributeEditor/NestedAttributeEditor.test.js +94 -40
- package/cjs/NotMatchButton/NotMatchButton.spec.js +51 -100
- package/cjs/PieChart/PieChart.test.js +130 -114
- package/cjs/PinButton/PinButton.spec.js +89 -22
- package/cjs/PivotingTooltip/PivotingTooltip.test.js +338 -174
- package/cjs/PotentialMatchReviewCard/PotentialMatchReviewCard.spec.js +94 -29
- package/cjs/ProfileBand/ProfileBand.spec.js +60 -53
- package/cjs/ProfileCard/ProfileCard.test.js +109 -27
- package/cjs/ProfilesList/ProfilesList.d.ts +1 -3
- package/cjs/ProfilesList/ProfilesList.js +1 -1
- package/cjs/ProfilesList/ProfilesList.spec.js +226 -211
- package/cjs/QueryBuilderRow/QueryBuilderRow.spec.js +83 -90
- package/cjs/QueryBuilderRowsGroup/QueryBuilderRowsGroup.spec.js +195 -86
- package/cjs/ReactSelectLoadMoreButton/ReactSelectLoadMoreButton.test.js +73 -15
- package/cjs/ReactSelectMenuWithPopper/ReactSelectMenuWithPopper.test.js +71 -117
- package/cjs/ReadOnlyAttributeValuesBlock/ReadOnlyAttributeValuesBlock.test.js +128 -61
- package/cjs/ReadOnlyAttributesFactory/components/ReadOnlyAttribute/ReadOnlyAttribute.test.js +179 -44
- package/cjs/ReadOnlyAttributesList/ReadOnlyAttributesList.js +2 -2
- package/cjs/ReadOnlyAttributesList/ReadOnlyAttributesList.test.js +254 -211
- package/cjs/ReadOnlyAttributesList/attributes.test-data.js +4 -4
- package/cjs/ReadOnlyAttributesPager/ReadOnlyAttributesPager.js +2 -2
- package/cjs/ReadOnlyAttributesPager/ReadOnlyAttributesPager.test.js +75 -18
- package/cjs/ReadOnlyAttributesView/ReadOnlyAttributesView.js +2 -2
- package/cjs/ReadOnlyAttributesView/ReadOnlyAttributesView.test.js +185 -310
- package/cjs/ReadOnlyComplexAttribute/ReadOnlyComplexAttribute.test.js +209 -218
- package/cjs/ReadOnlyImageAttributesLine/ReadOnlyImageAttributesLine.test.js +89 -89
- package/cjs/ReferenceAttributeEditor/ReferenceAttributeEditor.test.js +555 -601
- package/cjs/ReferenceAttributeEditor/metadata.test-data.d.ts +13 -13
- package/cjs/ReferenceAttributeEditor/metadata.test-data.js +2 -2
- package/cjs/ReferenceAttributeEditor/styles.d.ts +1 -1
- package/cjs/RelationEditor/RelationEditor.test.js +1446 -1390
- package/cjs/RelationTypeSelector/RelationTypeSelector.test.js +99 -17
- package/cjs/RelationTypesSelector/RelationTypesSelector.test.js +73 -22
- package/cjs/ReltioMap/ReltioMap.spec.js +51 -25
- package/cjs/Roles/Roles.test.js +54 -10
- package/cjs/ScreenProfileBand/ScreenProfileBand.test.js +141 -71
- package/cjs/ScrollableTabs/ScrollableTabs.test.js +69 -19
- package/cjs/SearchHighlighter/SearchHighlighter.test.js +18 -7
- package/cjs/SelectAttributesList/SelectAttributesList.d.ts +11 -6
- package/cjs/SelectAttributesList/SelectAttributesList.js +5 -2
- package/cjs/SelectorWithOnlyOptionAutoSelect/SelectorWithOnlyOptionAutoSelect.test.js +109 -60
- package/cjs/SidePanelContentHeader/SidePanelContentHeader.js +2 -2
- package/cjs/SidePanelContentHeader/SidePanelContentHeader.test.js +109 -0
- package/cjs/SidePanelEmptyState/SidePanelEmptyState.js +1 -1
- package/cjs/SidePanelEmptyState/SidePanelEmptyState.test.js +29 -0
- package/cjs/SimpleAttribute/SimpleAttribute.js +1 -1
- package/cjs/SimpleAttribute/SimpleAttribute.test.js +155 -80
- package/cjs/SimpleAttributeEditor/SimpleAttributeEditor.test.js +338 -352
- package/cjs/SimpleAttributeEditor/useAttributeValuePermissions.js +2 -2
- package/cjs/SimpleDropDownSelector/SimpleDropDownSelector.test.js +86 -10
- package/cjs/SimpleDropDownSelector/components/DropDownPlaceholder/DropDownPlaceholder.js +1 -1
- package/cjs/SimpleDropDownSelector/components/DropDownValue/DropDownValue.js +1 -1
- package/cjs/SimpleMatchRulesBlock/SimpleMatchRulesBlock.test.js +127 -31
- package/cjs/SmallIconButton/SmallIconButton.test.js +98 -25
- package/cjs/TableWithBars/TableWithBars.test.js +98 -60
- package/cjs/TableWithBars/components/AttributeCellRenderer/AttributeCellRenderer.js +1 -1
- package/cjs/TableWithBars/components/HeadCellRenderer/HeadCellRenderer.js +1 -1
- package/cjs/Tags/Tags.d.ts +0 -1
- package/cjs/Tags/Tags.test.js +8 -7
- package/cjs/TransitiveMatchBlock/TransitiveMatchBlock.test.js +77 -21
- package/cjs/TransitiveMatchRule/TransitiveMatchRule.test.js +78 -37
- package/cjs/TransitiveMatchRulesTooltip/TransitiveMatchRulesTooltip.js +1 -1
- package/cjs/TransitiveMatchRulesTooltip/TransitiveMatchRulesTooltip.test.js +12 -18
- package/cjs/UploadFileButton/UploadFileButton.d.ts +2 -2
- package/cjs/UploadFileButton/UploadFileButton.test.js +204 -0
- package/cjs/UploadImageDialog/UploadImageDialog.test.js +1 -0
- package/cjs/UploadImageDialog/components/DividerWithText/DividerWithText.js +1 -1
- package/cjs/UploadImageDialog/components/ErrorSnackbar/ErrorSnackbar.test.js +80 -22
- package/cjs/UploadImageDialog/components/ImageByUrlField/ImageByUrlField.js +1 -1
- package/cjs/UploadImageDialog/components/ImageByUrlField/ImageByUrlField.test.js +162 -49
- package/cjs/ValueChip/ValueChip.test.js +7 -23
- package/cjs/VirtualGroupedList/VirtualGroupedList.d.ts +19 -31
- package/cjs/VirtualGroupedList/VirtualGroupedList.js +11 -36
- package/cjs/VirtualGroupedList/VirtualGroupedList.test.js +252 -0
- package/cjs/VirtualGroupedList/helpers.d.ts +7 -2
- package/cjs/VirtualGroupedList/helpers.js +3 -1
- package/cjs/VirtualGroupedList/index.d.ts +1 -1
- package/cjs/VirtualGroupedList/types.d.ts +10 -6
- package/cjs/VirtualGroupedList/useScrollToFocusItem.d.ts +8 -5
- package/cjs/WhiteSearchInput/{WhiteSearchInput.spec.js → WhiteSearchInput.test.js} +3 -8
- package/cjs/features/crosswalks/hooks/useAttributeActions.test.js +24 -25
- package/cjs/features/crosswalks/hooks/useCrosswalkActions.test.js +10 -11
- package/cjs/features/workflow/hooks/useChangeRequest.test.js +5 -6
- package/cjs/hooks/useCommentsEntitiesMap/useCommentsEntitiesMap.test.js +8 -9
- package/cjs/hooks/useKeyboardNavigation/useKeyboardNavigation.d.ts +9 -13
- package/features/crosswalks/hooks/useAttributeActions.test.js +1 -2
- package/features/crosswalks/hooks/useCrosswalkActions.test.js +1 -2
- package/features/workflow/hooks/useChangeRequest.test.js +1 -2
- package/hooks/useCommentsEntitiesMap/useCommentsEntitiesMap.test.js +1 -2
- package/hooks/useKeyboardNavigation/useKeyboardNavigation.d.ts +9 -13
- package/package.json +1 -1
- package/MetadataTypesSelector/components/ListLabel/ListLabel.test.js +0 -24
- package/PivotingTooltip/IntegrationPivotingTooltip.test.js +0 -356
- package/PivotingTooltip/components/PivotingTooltipContent/PivotingTooltipContent.test.js +0 -201
- package/ProfileCard/components/ProfileCardContent/ProfileCardContent.test.js +0 -43
- package/QueryBuilderRow/components/ReadOnlyFilter/ReadOnlyFilter.spec.js +0 -31
- package/QueryBuilderRow/components/ReadOnlyLogicOperator/ReadOnlyLogicOperator.spec.js +0 -31
- package/ReadOnlyAttributesPager/components/ImageLineRenderer/ImageLineRenderer.test.js +0 -45
- package/ReadOnlyAttributesPager/components/MultiLineRenderer/MultiLineRenderer.test.js +0 -114
- package/ReadOnlyAttributesPager/components/OneLineRenderer/OneLineRenderer.test.js +0 -107
- package/ReadOnlyAttributesPager/components/SpecialRenderer/SpecialRenderer.test.js +0 -72
- package/RelationEditor/IntegrationRelationEditor.test.js +0 -337
- package/ReltioMap/components/MapControlContainer/MapControlContainer.d.ts +0 -10
- package/ReltioMap/components/MapControlContainer/MapControlContainer.js +0 -24
- package/ReltioMap/components/MapControlContainer/MapControlContainer.spec.d.ts +0 -1
- package/ReltioMap/components/MapControlContainer/MapControlContainer.spec.js +0 -33
- package/ReltioMap/components/MapControlContainer/index.d.ts +0 -1
- package/ReltioMap/components/MapControlContainer/index.js +0 -1
- package/ReltioMap/components/TopCenterMapControls/TopCenterMapControls.spec.d.ts +0 -1
- package/ReltioMap/components/TopCenterMapControls/TopCenterMapControls.spec.js +0 -36
- package/ReltioMap/components/TopRightMapControls/TopRightMapControls.spec.d.ts +0 -1
- package/ReltioMap/components/TopRightMapControls/TopRightMapControls.spec.js +0 -60
- package/Roles/components/Role/Role.test.d.ts +0 -1
- package/Roles/components/Role/Role.test.js +0 -55
- package/SidePanelContentHeader/SidePanelContentHeader.spec.d.ts +0 -1
- package/SidePanelContentHeader/SidePanelContentHeader.spec.js +0 -49
- package/SidePanelEmptyState/SidePanelEmptyState.spec.d.ts +0 -1
- package/SidePanelEmptyState/SidePanelEmptyState.spec.js +0 -24
- package/SimpleAttributeEditor/SimpleAttributeEditorWithoutPermissions.test.d.ts +0 -1
- package/SimpleAttributeEditor/SimpleAttributeEditorWithoutPermissions.test.js +0 -103
- package/SimpleDropDownSelector/components/DropDownPlaceholder/DropDownPlaceholder.test.d.ts +0 -1
- package/SimpleDropDownSelector/components/DropDownPlaceholder/DropDownPlaceholder.test.js +0 -13
- package/TableWithBars/components/AttributeCellRenderer/AttributeCellRenderer.test.d.ts +0 -1
- package/TableWithBars/components/AttributeCellRenderer/AttributeCellRenderer.test.js +0 -21
- package/TableWithBars/components/HeadCellRenderer/HeadCellRenderer.test.d.ts +0 -1
- package/TableWithBars/components/HeadCellRenderer/HeadCellRenderer.test.js +0 -20
- package/UploadFileButton/UploadFileButton.spec.d.ts +0 -1
- package/UploadFileButton/UploadFileButton.spec.js +0 -219
- package/UploadImageDialog/components/DividerWithText/DividerWithText.test.d.ts +0 -1
- package/UploadImageDialog/components/DividerWithText/DividerWithText.test.js +0 -9
- package/VirtualGroupedList/VirtualGroupedList.spec.d.ts +0 -1
- package/VirtualGroupedList/VirtualGroupedList.spec.js +0 -282
- package/WhiteSearchInput/WhiteSearchInput.spec.d.ts +0 -1
- package/cjs/MetadataTypesSelector/components/ListLabel/ListLabel.test.d.ts +0 -1
- package/cjs/MetadataTypesSelector/components/ListLabel/ListLabel.test.js +0 -52
- package/cjs/PivotingTooltip/IntegrationPivotingTooltip.test.d.ts +0 -1
- package/cjs/PivotingTooltip/IntegrationPivotingTooltip.test.js +0 -361
- package/cjs/PivotingTooltip/components/PivotingTooltipContent/PivotingTooltipContent.test.d.ts +0 -1
- package/cjs/PivotingTooltip/components/PivotingTooltipContent/PivotingTooltipContent.test.js +0 -206
- package/cjs/ProfileCard/components/ProfileCardContent/ProfileCardContent.test.d.ts +0 -1
- package/cjs/ProfileCard/components/ProfileCardContent/ProfileCardContent.test.js +0 -48
- package/cjs/QueryBuilderRow/components/ReadOnlyFilter/ReadOnlyFilter.spec.d.ts +0 -1
- package/cjs/QueryBuilderRow/components/ReadOnlyFilter/ReadOnlyFilter.spec.js +0 -36
- package/cjs/QueryBuilderRow/components/ReadOnlyLogicOperator/ReadOnlyLogicOperator.spec.d.ts +0 -1
- package/cjs/QueryBuilderRow/components/ReadOnlyLogicOperator/ReadOnlyLogicOperator.spec.js +0 -36
- package/cjs/ReadOnlyAttributesPager/components/ImageLineRenderer/ImageLineRenderer.test.d.ts +0 -1
- package/cjs/ReadOnlyAttributesPager/components/ImageLineRenderer/ImageLineRenderer.test.js +0 -50
- package/cjs/ReadOnlyAttributesPager/components/MultiLineRenderer/MultiLineRenderer.test.d.ts +0 -1
- package/cjs/ReadOnlyAttributesPager/components/MultiLineRenderer/MultiLineRenderer.test.js +0 -119
- package/cjs/ReadOnlyAttributesPager/components/OneLineRenderer/OneLineRenderer.test.d.ts +0 -1
- package/cjs/ReadOnlyAttributesPager/components/OneLineRenderer/OneLineRenderer.test.js +0 -112
- package/cjs/ReadOnlyAttributesPager/components/SpecialRenderer/SpecialRenderer.test.d.ts +0 -1
- package/cjs/ReadOnlyAttributesPager/components/SpecialRenderer/SpecialRenderer.test.js +0 -77
- package/cjs/RelationEditor/IntegrationRelationEditor.test.d.ts +0 -1
- package/cjs/RelationEditor/IntegrationRelationEditor.test.js +0 -342
- package/cjs/ReltioMap/components/MapControlContainer/MapControlContainer.d.ts +0 -10
- package/cjs/ReltioMap/components/MapControlContainer/MapControlContainer.js +0 -28
- package/cjs/ReltioMap/components/MapControlContainer/MapControlContainer.spec.d.ts +0 -1
- package/cjs/ReltioMap/components/MapControlContainer/MapControlContainer.spec.js +0 -38
- package/cjs/ReltioMap/components/MapControlContainer/index.d.ts +0 -1
- package/cjs/ReltioMap/components/MapControlContainer/index.js +0 -5
- package/cjs/ReltioMap/components/TopCenterMapControls/TopCenterMapControls.spec.d.ts +0 -1
- package/cjs/ReltioMap/components/TopCenterMapControls/TopCenterMapControls.spec.js +0 -41
- package/cjs/ReltioMap/components/TopRightMapControls/TopRightMapControls.spec.d.ts +0 -1
- package/cjs/ReltioMap/components/TopRightMapControls/TopRightMapControls.spec.js +0 -65
- package/cjs/Roles/components/Role/Role.test.d.ts +0 -1
- package/cjs/Roles/components/Role/Role.test.js +0 -60
- package/cjs/SidePanelContentHeader/SidePanelContentHeader.spec.d.ts +0 -1
- package/cjs/SidePanelContentHeader/SidePanelContentHeader.spec.js +0 -54
- package/cjs/SidePanelEmptyState/SidePanelEmptyState.spec.d.ts +0 -1
- package/cjs/SidePanelEmptyState/SidePanelEmptyState.spec.js +0 -29
- package/cjs/SimpleAttributeEditor/SimpleAttributeEditorWithoutPermissions.test.d.ts +0 -1
- package/cjs/SimpleAttributeEditor/SimpleAttributeEditorWithoutPermissions.test.js +0 -108
- package/cjs/SimpleDropDownSelector/components/DropDownPlaceholder/DropDownPlaceholder.test.d.ts +0 -1
- package/cjs/SimpleDropDownSelector/components/DropDownPlaceholder/DropDownPlaceholder.test.js +0 -18
- package/cjs/TableWithBars/components/AttributeCellRenderer/AttributeCellRenderer.test.d.ts +0 -1
- package/cjs/TableWithBars/components/AttributeCellRenderer/AttributeCellRenderer.test.js +0 -26
- package/cjs/TableWithBars/components/HeadCellRenderer/HeadCellRenderer.test.d.ts +0 -1
- package/cjs/TableWithBars/components/HeadCellRenderer/HeadCellRenderer.test.js +0 -25
- package/cjs/UploadFileButton/UploadFileButton.spec.d.ts +0 -1
- package/cjs/UploadFileButton/UploadFileButton.spec.js +0 -224
- package/cjs/UploadImageDialog/components/DividerWithText/DividerWithText.test.d.ts +0 -1
- package/cjs/UploadImageDialog/components/DividerWithText/DividerWithText.test.js +0 -14
- package/cjs/VirtualGroupedList/VirtualGroupedList.spec.d.ts +0 -1
- package/cjs/VirtualGroupedList/VirtualGroupedList.spec.js +0 -287
- package/cjs/WhiteSearchInput/WhiteSearchInput.spec.d.ts +0 -1
- /package/{MetadataTypesSelector/components/ListLabel/ListLabel.test.d.ts → ColumnsSettings/types.js} +0 -0
- /package/{PivotingTooltip/IntegrationPivotingTooltip.test.d.ts → SidePanelContentHeader/SidePanelContentHeader.test.d.ts} +0 -0
- /package/{PivotingTooltip/components/PivotingTooltipContent/PivotingTooltipContent.test.d.ts → SidePanelEmptyState/SidePanelEmptyState.test.d.ts} +0 -0
- /package/{ProfileCard/components/ProfileCardContent/ProfileCardContent.test.d.ts → UploadFileButton/UploadFileButton.test.d.ts} +0 -0
- /package/{QueryBuilderRow/components/ReadOnlyFilter/ReadOnlyFilter.spec.d.ts → VirtualGroupedList/VirtualGroupedList.test.d.ts} +0 -0
- /package/{QueryBuilderRow/components/ReadOnlyLogicOperator/ReadOnlyLogicOperator.spec.d.ts → WhiteSearchInput/WhiteSearchInput.test.d.ts} +0 -0
- /package/{ReadOnlyAttributesPager/components/ImageLineRenderer/ImageLineRenderer.test.d.ts → cjs/SidePanelContentHeader/SidePanelContentHeader.test.d.ts} +0 -0
- /package/{ReadOnlyAttributesPager/components/MultiLineRenderer/MultiLineRenderer.test.d.ts → cjs/SidePanelEmptyState/SidePanelEmptyState.test.d.ts} +0 -0
- /package/{ReadOnlyAttributesPager/components/OneLineRenderer/OneLineRenderer.test.d.ts → cjs/UploadFileButton/UploadFileButton.test.d.ts} +0 -0
- /package/{ReadOnlyAttributesPager/components/SpecialRenderer/SpecialRenderer.test.d.ts → cjs/VirtualGroupedList/VirtualGroupedList.test.d.ts} +0 -0
- /package/{RelationEditor/IntegrationRelationEditor.test.d.ts → cjs/WhiteSearchInput/WhiteSearchInput.test.d.ts} +0 -0
- /package/cjs/contexts/{AllwaysVisibleAttributesContext → AlwaysVisibleAttributesContext}/index.d.ts +0 -0
- /package/cjs/contexts/{AllwaysVisibleAttributesContext → AlwaysVisibleAttributesContext}/index.js +0 -0
- /package/contexts/{AllwaysVisibleAttributesContext → AlwaysVisibleAttributesContext}/index.d.ts +0 -0
- /package/contexts/{AllwaysVisibleAttributesContext → AlwaysVisibleAttributesContext}/index.js +0 -0
|
@@ -10,29 +10,6 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
-
if (k2 === undefined) k2 = k;
|
|
15
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
-
}
|
|
19
|
-
Object.defineProperty(o, k2, desc);
|
|
20
|
-
}) : (function(o, m, k, k2) {
|
|
21
|
-
if (k2 === undefined) k2 = k;
|
|
22
|
-
o[k2] = m[k];
|
|
23
|
-
}));
|
|
24
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
-
}) : function(o, v) {
|
|
27
|
-
o["default"] = v;
|
|
28
|
-
});
|
|
29
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
-
if (mod && mod.__esModule) return mod;
|
|
31
|
-
var result = {};
|
|
32
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
-
__setModuleDefault(result, mod);
|
|
34
|
-
return result;
|
|
35
|
-
};
|
|
36
13
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
37
14
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
38
15
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -69,137 +46,106 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
69
46
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
70
47
|
}
|
|
71
48
|
};
|
|
72
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
73
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
74
|
-
if (ar || !(i in from)) {
|
|
75
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
76
|
-
ar[i] = from[i];
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
80
|
-
};
|
|
81
49
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
82
50
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
83
51
|
};
|
|
84
52
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
85
53
|
var react_1 = __importDefault(require("react"));
|
|
86
|
-
var enzyme_1 = require("enzyme");
|
|
87
54
|
var react_2 = require("@testing-library/react");
|
|
88
55
|
var user_event_1 = __importDefault(require("@testing-library/user-event"));
|
|
89
56
|
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
90
|
-
var DataTypeValueEditor_1 = require("../DataTypeValueEditor");
|
|
91
|
-
var useAutopopulationContextValueExport = __importStar(require("./useAutopopulationContextValue"));
|
|
92
|
-
var ErrorWrapper_1 = require("../ErrorWrapper");
|
|
93
57
|
var SimpleAttributeEditor_1 = __importDefault(require("./SimpleAttributeEditor"));
|
|
94
|
-
var useScrollToAttributeError_1 = require("../hooks/useScrollToAttributeError");
|
|
95
58
|
var ProfilePerspectiveViewContext_1 = require("../contexts/ProfilePerspectiveViewContext");
|
|
96
59
|
var ScrollToElementContext_1 = require("../contexts/ScrollToElementContext");
|
|
97
60
|
var MdmModuleContext_1 = require("../contexts/MdmModuleContext");
|
|
61
|
+
var AlwaysVisibleAttributesContext_1 = require("../contexts/AlwaysVisibleAttributesContext");
|
|
62
|
+
var useAutopopulationContextValue_1 = require("./useAutopopulationContextValue");
|
|
63
|
+
var useScrollToAttributeError_1 = require("../hooks/useScrollToAttributeError");
|
|
64
|
+
var useAsyncMount_1 = require("../hooks/useAsyncMount");
|
|
98
65
|
jest.mock('@reltio/mdm-sdk', function () { return (__assign(__assign({}, jest.requireActual('@reltio/mdm-sdk')), { getDependentLookups: jest.fn(function () { return Promise.resolve(); }), getLookups: jest.fn(function () { return Promise.resolve(); }) })); });
|
|
99
66
|
jest.mock('../contexts/MdmModuleContext', function () { return (__assign(__assign({}, jest.requireActual('../contexts/MdmModuleContext')), { useMdmDependentLookupEditorContext: jest.fn() })); });
|
|
67
|
+
jest.mock('./useAutopopulationContextValue', function () { return (__assign(__assign({}, jest.requireActual('./useAutopopulationContextValue')), { useAutopopulationContextValue: jest.fn() })); });
|
|
100
68
|
jest.mock('../hooks/useScrollToAttributeError', function () { return (__assign(__assign({}, jest.requireActual('../hooks/useScrollToAttributeError')), { useScrollToAttributeError: jest.fn() })); });
|
|
69
|
+
jest.mock('../hooks/useAsyncMount', function () { return (__assign(__assign({}, jest.requireActual('../hooks/useAsyncMount')), { useAsyncMount: jest.fn() })); });
|
|
101
70
|
describe('SimpleAttributeEditor', function () {
|
|
102
|
-
var
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
71
|
+
var getScrollToElementContextValue = function (error) {
|
|
72
|
+
if (error === void 0) { error = null; }
|
|
73
|
+
return ({
|
|
74
|
+
element: error,
|
|
75
|
+
highlightError: jest.fn(),
|
|
76
|
+
scrollIntoRef: jest.fn(),
|
|
77
|
+
type: ScrollToElementContext_1.ScrollType.Error
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
var mdmValues = {
|
|
81
|
+
dependentLookups: {
|
|
82
|
+
editors: {},
|
|
83
|
+
structure: {},
|
|
84
|
+
initedTypeUris: []
|
|
85
|
+
}
|
|
110
86
|
};
|
|
111
|
-
var highlightErrorSpy = jest.fn();
|
|
112
|
-
var scrollIntoRefSpy = jest.fn();
|
|
113
87
|
beforeAll(function () {
|
|
114
|
-
useScrollToAttributeError_1.useScrollToAttributeError.
|
|
88
|
+
useScrollToAttributeError_1.useScrollToAttributeError.mockImplementation(jest.requireActual('../hooks/useScrollToAttributeError').useScrollToAttributeError);
|
|
89
|
+
useAsyncMount_1.useAsyncMount.mockImplementation(jest.requireActual('../hooks/useAsyncMount').useAsyncMount);
|
|
90
|
+
useAutopopulationContextValue_1.useAutopopulationContextValue.mockImplementation(jest.requireActual('./useAutopopulationContextValue').useAutopopulationContextValue);
|
|
115
91
|
});
|
|
116
92
|
beforeEach(function () {
|
|
117
|
-
onAddFn = jest.fn();
|
|
118
|
-
onDeleteFn = jest.fn();
|
|
119
|
-
onChangeFn = jest.fn();
|
|
120
|
-
onDeactivateErrorFn = jest.fn();
|
|
121
|
-
});
|
|
122
|
-
afterEach(function () {
|
|
123
93
|
jest.clearAllMocks();
|
|
124
94
|
});
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
additionalControlsRenderer: additionalControlsRenderer,
|
|
153
|
-
state: state
|
|
154
|
-
};
|
|
155
|
-
return (0, enzyme_1.mount)(react_1.default.createElement(MdmModuleContext_1.MdmModuleProvider, { values: mdmValues },
|
|
156
|
-
react_1.default.createElement(ScrollToElementContext_1.ScrollToElementContext.Provider, { value: {
|
|
157
|
-
element: null,
|
|
158
|
-
highlightError: highlightErrorSpy,
|
|
159
|
-
scrollIntoRef: scrollIntoRefSpy,
|
|
160
|
-
type: ScrollToElementContext_1.ScrollType.Error
|
|
161
|
-
} },
|
|
162
|
-
react_1.default.createElement(SimpleAttributeEditor_1.default, __assign({}, data)))));
|
|
163
|
-
};
|
|
164
|
-
var findActionButtons = function (component) {
|
|
165
|
-
return component
|
|
166
|
-
.findWhere(function (n) { return n.prop('className') && n.prop('className').includes('editor-actions'); })
|
|
167
|
-
.children();
|
|
95
|
+
var defaultProps = {
|
|
96
|
+
attributeValue: {
|
|
97
|
+
value: 'some string',
|
|
98
|
+
uri: 'entities/eNt1/attributes/InternalCustomer/gd42423'
|
|
99
|
+
},
|
|
100
|
+
attributeType: {
|
|
101
|
+
access: ['UPDATE', 'DELETE', 'CREATE', 'READ'],
|
|
102
|
+
type: 'String',
|
|
103
|
+
uri: 'configuration/entityTypes/HCA/attributes/InternalCustomer'
|
|
104
|
+
},
|
|
105
|
+
isReltioCrosswalk: true,
|
|
106
|
+
mode: mdm_sdk_1.Mode.Editing,
|
|
107
|
+
onAddOneMore: jest.fn(),
|
|
108
|
+
onDeleteAttribute: jest.fn(),
|
|
109
|
+
onChangeAttribute: jest.fn(),
|
|
110
|
+
onDeactivateError: jest.fn()
|
|
111
|
+
};
|
|
112
|
+
var setUp = function (_a) {
|
|
113
|
+
var _b = _a === void 0 ? {} : _a, _c = _b.props, props = _c === void 0 ? {} : _c, _d = _b.error, error = _d === void 0 ? null : _d, _e = _b.isProfilePerspective, isProfilePerspective = _e === void 0 ? false : _e, _f = _b.alwaysVisibleAttributes, alwaysVisibleAttributes = _f === void 0 ? [] : _f;
|
|
114
|
+
var user = user_event_1.default.setup();
|
|
115
|
+
var scrollToElementContextValue = getScrollToElementContextValue(error);
|
|
116
|
+
var Providers = function (_a) {
|
|
117
|
+
var children = _a.children;
|
|
118
|
+
return (react_1.default.createElement(MdmModuleContext_1.MdmModuleProvider, { values: mdmValues },
|
|
119
|
+
react_1.default.createElement(AlwaysVisibleAttributesContext_1.AlwaysVisibleAttributesContext.Provider, { value: alwaysVisibleAttributes },
|
|
120
|
+
react_1.default.createElement(ProfilePerspectiveViewContext_1.ProfilePerspectiveViewContext.Provider, { value: isProfilePerspective },
|
|
121
|
+
react_1.default.createElement(ScrollToElementContext_1.ScrollToElementContext.Provider, { value: scrollToElementContextValue }, children)))));
|
|
168
122
|
};
|
|
123
|
+
return __assign({ user: user, scrollToElementContextValue: scrollToElementContextValue }, (0, react_2.render)(react_1.default.createElement(SimpleAttributeEditor_1.default, __assign({}, defaultProps, props)), { wrapper: Providers }));
|
|
124
|
+
};
|
|
125
|
+
describe('String attribute', function () {
|
|
169
126
|
it('should render the simple attribute to edit with action buttons', function () {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
expect(
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
uri: 'configuration/entityTypes/HCA/attributes/InternalCustomer'
|
|
178
|
-
}
|
|
179
|
-
});
|
|
180
|
-
expect(errorWrapper.prop('errorMessage')).toBeFalsy();
|
|
181
|
-
var editor = component.find('.editor');
|
|
182
|
-
expect(editor.hasClass(scrollToAttributeError.errorClassName)).toBeTruthy();
|
|
183
|
-
expect(editor.getElement().ref).toBe(scrollToAttributeError.ref);
|
|
184
|
-
var actionButtons = findActionButtons(component);
|
|
185
|
-
expect(actionButtons.length).toBe(2);
|
|
186
|
-
actionButtons.at(0).find('button').simulate('click');
|
|
187
|
-
expect(onAddFn).toHaveBeenCalled();
|
|
188
|
-
actionButtons.at(1).find('button').simulate('click');
|
|
189
|
-
expect(onDeleteFn).toHaveBeenCalled();
|
|
127
|
+
setUp();
|
|
128
|
+
expect(react_2.screen.getByRole('textbox')).toHaveValue('some string');
|
|
129
|
+
expect(react_2.screen.queryByTestId('error-message')).not.toBeInTheDocument();
|
|
130
|
+
var actions = react_2.screen.getByTestId('reltio-attribute-actions');
|
|
131
|
+
expect((0, react_2.within)(actions).getAllByRole('button')).toHaveLength(2);
|
|
132
|
+
expect(react_2.screen.getByTestId('reltio-add-one-more-simple-attribute-button')).toBeInTheDocument();
|
|
133
|
+
expect(react_2.screen.getByTestId('reltio-delete-simple-attribute-button')).toBeInTheDocument();
|
|
190
134
|
});
|
|
191
135
|
it('should render additional control between plus and delete buttons if additionalControlsRenderer prop is specified', function () {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
136
|
+
setUp({
|
|
137
|
+
props: {
|
|
138
|
+
additionalControlsRenderer: function (_a) {
|
|
139
|
+
var attributeValue = _a.attributeValue, attributeType = _a.attributeType;
|
|
140
|
+
return (react_1.default.createElement("div", { "data-reltio-id": "additional-controls" },
|
|
141
|
+
react_1.default.createElement("div", { "data-reltio-id": "attribute-value" }, attributeValue.uri),
|
|
142
|
+
react_1.default.createElement("div", { "data-reltio-id": "attribute-type" }, attributeType.uri)));
|
|
143
|
+
}
|
|
197
144
|
}
|
|
198
145
|
});
|
|
199
|
-
|
|
200
|
-
expect(
|
|
201
|
-
expect(
|
|
202
|
-
expect(actionButtons.at(1).prop('attributeType').uri).toBe('configuration/entityTypes/HCA/attributes/InternalCustomer');
|
|
146
|
+
expect(react_2.screen.getByTestId('additional-controls')).toBeInTheDocument();
|
|
147
|
+
expect(react_2.screen.getByTestId('attribute-value')).toHaveTextContent('entities/eNt1/attributes/InternalCustomer/gd42423');
|
|
148
|
+
expect(react_2.screen.getByTestId('attribute-type')).toHaveTextContent('configuration/entityTypes/HCA/attributes/InternalCustomer');
|
|
203
149
|
});
|
|
204
150
|
it('should render error message if ownError prop is specified', function () {
|
|
205
151
|
var ownError = {
|
|
@@ -209,209 +155,216 @@ describe('SimpleAttributeEditor', function () {
|
|
|
209
155
|
message: 'Error!!!',
|
|
210
156
|
type: 'invalid'
|
|
211
157
|
};
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
expect(
|
|
215
|
-
expect(errorWrapper.prop('errorMessage')).toBe(ownError.message);
|
|
158
|
+
setUp({ props: { ownError: ownError } });
|
|
159
|
+
expect(react_2.screen.getByRole('textbox')).toHaveValue('some string');
|
|
160
|
+
expect(react_2.screen.getByTestId('error-message')).toHaveTextContent('Error!!!');
|
|
216
161
|
});
|
|
217
162
|
it('should not render delete button in case of missed DELETE permission', function () {
|
|
218
|
-
var
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
expect(
|
|
222
|
-
|
|
223
|
-
expect(onAddFn).toHaveBeenCalled();
|
|
163
|
+
var attributeType = __assign(__assign({}, defaultProps.attributeType), { access: ['UPDATE', 'CREATE', 'READ'] });
|
|
164
|
+
setUp({ props: { attributeType: attributeType } });
|
|
165
|
+
expect(react_2.screen.getByRole('textbox')).toHaveValue('some string');
|
|
166
|
+
expect(react_2.screen.getByTestId('reltio-add-one-more-simple-attribute-button')).toBeInTheDocument();
|
|
167
|
+
expect(react_2.screen.queryByTestId('reltio-delete-simple-attribute-button')).not.toBeInTheDocument();
|
|
224
168
|
});
|
|
225
169
|
it('should not render plus button in case of missed CREATE permission', function () {
|
|
226
|
-
var
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
expect(
|
|
230
|
-
|
|
231
|
-
expect(onDeleteFn).toHaveBeenCalledWith({
|
|
232
|
-
attributeType: {
|
|
233
|
-
access: ['UPDATE', 'DELETE', 'READ'],
|
|
234
|
-
type: 'String',
|
|
235
|
-
uri: 'configuration/entityTypes/HCA/attributes/InternalCustomer'
|
|
236
|
-
},
|
|
237
|
-
uri: 'entities/eNt1/attributes/InternalCustomer/gd42423'
|
|
238
|
-
});
|
|
170
|
+
var attributeType = __assign(__assign({}, defaultProps.attributeType), { access: ['UPDATE', 'DELETE', 'READ'] });
|
|
171
|
+
setUp({ props: { attributeType: attributeType } });
|
|
172
|
+
expect(react_2.screen.getByRole('textbox')).toHaveValue('some string');
|
|
173
|
+
expect(react_2.screen.getByTestId('reltio-delete-simple-attribute-button')).toBeInTheDocument();
|
|
174
|
+
expect(react_2.screen.queryByTestId('reltio-add-one-more-simple-attribute-button')).not.toBeInTheDocument();
|
|
239
175
|
});
|
|
240
|
-
it('should call onChangeAttribute prop when input value changes', function () {
|
|
241
|
-
var
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
176
|
+
it('should call onChangeAttribute prop when input value changes', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
177
|
+
var user;
|
|
178
|
+
return __generator(this, function (_a) {
|
|
179
|
+
switch (_a.label) {
|
|
180
|
+
case 0:
|
|
181
|
+
user = setUp().user;
|
|
182
|
+
return [4 /*yield*/, user.type(react_2.screen.getByRole('textbox'), ' new{enter}')];
|
|
183
|
+
case 1:
|
|
184
|
+
_a.sent();
|
|
185
|
+
expect(defaultProps.onChangeAttribute).toHaveBeenCalledWith({
|
|
186
|
+
attributeType: {
|
|
187
|
+
access: ['UPDATE', 'DELETE', 'CREATE', 'READ'],
|
|
188
|
+
type: 'String',
|
|
189
|
+
uri: 'configuration/entityTypes/HCA/attributes/InternalCustomer'
|
|
190
|
+
},
|
|
191
|
+
uri: 'entities/eNt1/attributes/InternalCustomer/gd42423',
|
|
192
|
+
value: 'some string new'
|
|
193
|
+
});
|
|
194
|
+
expect(defaultProps.onDeactivateError).not.toHaveBeenCalled();
|
|
195
|
+
return [2 /*return*/];
|
|
196
|
+
}
|
|
252
197
|
});
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
198
|
+
}); });
|
|
199
|
+
it('should deactivate error when input value changes', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
200
|
+
var ownError, user;
|
|
201
|
+
return __generator(this, function (_a) {
|
|
202
|
+
switch (_a.label) {
|
|
203
|
+
case 0:
|
|
204
|
+
ownError = {
|
|
205
|
+
uri: 'entities/eNt1/attributes/InternalCustomer/gd42423',
|
|
206
|
+
parentUri: 'entities/eNt1',
|
|
207
|
+
attributeTypeUri: 'configuration/entityTypes/HCA/attributes/InternalCustomer',
|
|
208
|
+
message: 'Error!!!',
|
|
209
|
+
type: 'invalid'
|
|
210
|
+
};
|
|
211
|
+
user = setUp({ props: { ownError: ownError } }).user;
|
|
212
|
+
return [4 /*yield*/, user.type(react_2.screen.getByRole('textbox'), ' new{enter}')];
|
|
213
|
+
case 1:
|
|
214
|
+
_a.sent();
|
|
215
|
+
expect(defaultProps.onChangeAttribute).toHaveBeenCalledWith({
|
|
216
|
+
attributeType: {
|
|
217
|
+
access: ['UPDATE', 'DELETE', 'CREATE', 'READ'],
|
|
218
|
+
type: 'String',
|
|
219
|
+
uri: 'configuration/entityTypes/HCA/attributes/InternalCustomer'
|
|
220
|
+
},
|
|
221
|
+
uri: 'entities/eNt1/attributes/InternalCustomer/gd42423',
|
|
222
|
+
value: 'some string new'
|
|
223
|
+
});
|
|
224
|
+
expect(defaultProps.onDeactivateError).toHaveBeenCalledWith('configuration/entityTypes/HCA/attributes/InternalCustomer-entities/eNt1/attributes/InternalCustomer/gd42423-entities/eNt1');
|
|
225
|
+
return [2 /*return*/];
|
|
226
|
+
}
|
|
274
227
|
});
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
228
|
+
}); });
|
|
229
|
+
it('should call onDeleteAttribute after click on delete button', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
230
|
+
var user;
|
|
231
|
+
return __generator(this, function (_a) {
|
|
232
|
+
switch (_a.label) {
|
|
233
|
+
case 0:
|
|
234
|
+
user = setUp().user;
|
|
235
|
+
return [4 /*yield*/, user.click(react_2.screen.getByTestId('reltio-delete-simple-attribute-button'))];
|
|
236
|
+
case 1:
|
|
237
|
+
_a.sent();
|
|
238
|
+
expect(defaultProps.onDeleteAttribute).toHaveBeenCalledWith({
|
|
239
|
+
attributeType: {
|
|
240
|
+
access: ['UPDATE', 'DELETE', 'CREATE', 'READ'],
|
|
241
|
+
type: 'String',
|
|
242
|
+
uri: 'configuration/entityTypes/HCA/attributes/InternalCustomer'
|
|
243
|
+
},
|
|
244
|
+
uri: 'entities/eNt1/attributes/InternalCustomer/gd42423'
|
|
245
|
+
});
|
|
246
|
+
expect(defaultProps.onDeactivateError).not.toHaveBeenCalled();
|
|
247
|
+
return [2 /*return*/];
|
|
248
|
+
}
|
|
289
249
|
});
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
actionButtons.at(1).find('button').simulate('click');
|
|
304
|
-
expect(onDeleteFn).toHaveBeenCalledWith({
|
|
305
|
-
attributeType: {
|
|
306
|
-
access: ['UPDATE', 'DELETE', 'CREATE', 'READ'],
|
|
307
|
-
type: 'String',
|
|
308
|
-
uri: 'configuration/entityTypes/HCA/attributes/InternalCustomer'
|
|
309
|
-
},
|
|
310
|
-
uri: 'entities/eNt1/attributes/InternalCustomer/gd42423'
|
|
250
|
+
}); });
|
|
251
|
+
it('should call onAddOneMore on click on add more button', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
252
|
+
var user;
|
|
253
|
+
return __generator(this, function (_a) {
|
|
254
|
+
switch (_a.label) {
|
|
255
|
+
case 0:
|
|
256
|
+
user = setUp().user;
|
|
257
|
+
return [4 /*yield*/, user.click(react_2.screen.getByTestId('reltio-add-one-more-simple-attribute-button'))];
|
|
258
|
+
case 1:
|
|
259
|
+
_a.sent();
|
|
260
|
+
expect(defaultProps.onAddOneMore).toHaveBeenCalledTimes(1);
|
|
261
|
+
return [2 /*return*/];
|
|
262
|
+
}
|
|
311
263
|
});
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
264
|
+
}); });
|
|
265
|
+
it('should deactivate "invalid" error after click on delete button', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
266
|
+
var ownError, user;
|
|
267
|
+
return __generator(this, function (_a) {
|
|
268
|
+
switch (_a.label) {
|
|
269
|
+
case 0:
|
|
270
|
+
ownError = {
|
|
271
|
+
uri: 'entities/eNt1/attributes/InternalCustomer/gd42423',
|
|
272
|
+
parentUri: 'entities/eNt1',
|
|
273
|
+
attributeTypeUri: 'configuration/entityTypes/HCA/attributes/InternalCustomer',
|
|
274
|
+
message: 'Error!!!',
|
|
275
|
+
type: 'invalid'
|
|
276
|
+
};
|
|
277
|
+
user = setUp({ props: { ownError: ownError } }).user;
|
|
278
|
+
return [4 /*yield*/, user.click(react_2.screen.getByTestId('reltio-delete-simple-attribute-button'))];
|
|
279
|
+
case 1:
|
|
280
|
+
_a.sent();
|
|
281
|
+
expect(defaultProps.onDeleteAttribute).toHaveBeenCalledWith({
|
|
282
|
+
attributeType: {
|
|
283
|
+
access: ['UPDATE', 'DELETE', 'CREATE', 'READ'],
|
|
284
|
+
type: 'String',
|
|
285
|
+
uri: 'configuration/entityTypes/HCA/attributes/InternalCustomer'
|
|
286
|
+
},
|
|
287
|
+
uri: 'entities/eNt1/attributes/InternalCustomer/gd42423'
|
|
288
|
+
});
|
|
289
|
+
expect(defaultProps.onDeactivateError).toHaveBeenCalledWith('configuration/entityTypes/HCA/attributes/InternalCustomer-entities/eNt1/attributes/InternalCustomer/gd42423-entities/eNt1');
|
|
290
|
+
return [2 /*return*/];
|
|
291
|
+
}
|
|
333
292
|
});
|
|
334
|
-
|
|
335
|
-
|
|
293
|
+
}); });
|
|
294
|
+
it('should not deactivate "missed" error after click on delete button', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
295
|
+
var ownError, user;
|
|
296
|
+
return __generator(this, function (_a) {
|
|
297
|
+
switch (_a.label) {
|
|
298
|
+
case 0:
|
|
299
|
+
ownError = {
|
|
300
|
+
uri: '',
|
|
301
|
+
parentUri: 'entities/eNt1',
|
|
302
|
+
attributeTypeUri: 'configuration/entityTypes/HCA/attributes/InternalCustomer',
|
|
303
|
+
message: 'Error!!!',
|
|
304
|
+
type: 'missed'
|
|
305
|
+
};
|
|
306
|
+
user = setUp({ props: { ownError: ownError } }).user;
|
|
307
|
+
return [4 /*yield*/, user.click(react_2.screen.getByTestId('reltio-delete-simple-attribute-button'))];
|
|
308
|
+
case 1:
|
|
309
|
+
_a.sent();
|
|
310
|
+
expect(defaultProps.onDeleteAttribute).toHaveBeenCalledWith({
|
|
311
|
+
attributeType: {
|
|
312
|
+
access: ['UPDATE', 'DELETE', 'CREATE', 'READ'],
|
|
313
|
+
type: 'String',
|
|
314
|
+
uri: 'configuration/entityTypes/HCA/attributes/InternalCustomer'
|
|
315
|
+
},
|
|
316
|
+
uri: 'entities/eNt1/attributes/InternalCustomer/gd42423'
|
|
317
|
+
});
|
|
318
|
+
expect(defaultProps.onDeactivateError).not.toHaveBeenCalled();
|
|
319
|
+
return [2 /*return*/];
|
|
320
|
+
}
|
|
321
|
+
});
|
|
322
|
+
}); });
|
|
336
323
|
it('should be wrapped in withAsyncMount HOC', function () {
|
|
337
|
-
|
|
338
|
-
expect(
|
|
339
|
-
expect(component.find('WithAsyncMount').find('SimpleAttributeEditor').exists()).toBe(true);
|
|
324
|
+
setUp();
|
|
325
|
+
expect(useAsyncMount_1.useAsyncMount).toHaveBeenCalled();
|
|
340
326
|
});
|
|
341
327
|
it('should render component in "deleted" state', function () {
|
|
342
|
-
|
|
343
|
-
expect(
|
|
344
|
-
expect(
|
|
345
|
-
expect(
|
|
346
|
-
expect(
|
|
328
|
+
setUp({ props: { state: 'deleted' } });
|
|
329
|
+
expect(react_2.screen.getByRole('textbox')).toBeDisabled();
|
|
330
|
+
expect(react_2.screen.getByTestId('reltio-attribute-value')).toHaveClass('deleted');
|
|
331
|
+
expect(react_2.screen.getAllByRole('button')).toHaveLength(1);
|
|
332
|
+
expect(react_2.screen.getByTestId('reltio-add-one-more-simple-attribute-button')).toBeInTheDocument();
|
|
333
|
+
expect(react_2.screen.queryByTestId('reltio-delete-simple-attribute-button')).not.toBeInTheDocument();
|
|
334
|
+
expect(react_2.screen.getByTestId('reltio-attribute-actions')).toHaveTextContent('');
|
|
347
335
|
});
|
|
348
336
|
it('should render component in "edited" state', function () {
|
|
349
|
-
|
|
350
|
-
expect(
|
|
351
|
-
expect(
|
|
352
|
-
expect(
|
|
353
|
-
expect(
|
|
337
|
+
setUp({ props: { state: 'edited' } });
|
|
338
|
+
expect(react_2.screen.getByRole('textbox')).not.toBeDisabled();
|
|
339
|
+
expect(react_2.screen.getByTestId('reltio-attribute-value')).not.toHaveClass('deleted');
|
|
340
|
+
expect(react_2.screen.getAllByRole('button')).toHaveLength(2);
|
|
341
|
+
expect(react_2.screen.getByTestId('reltio-add-one-more-simple-attribute-button')).toBeInTheDocument();
|
|
342
|
+
expect(react_2.screen.getByTestId('reltio-delete-simple-attribute-button')).toBeInTheDocument();
|
|
343
|
+
expect(react_2.screen.getByTestId('reltio-attribute-actions')).toHaveTextContent('(edited)');
|
|
354
344
|
});
|
|
355
345
|
});
|
|
356
346
|
describe('Dependent Lookup attribute', function () {
|
|
357
347
|
beforeEach(function () {
|
|
358
348
|
MdmModuleContext_1.useMdmDependentLookupEditorContext.mockReturnValue({});
|
|
359
|
-
|
|
360
|
-
autopopulationContextValue: null
|
|
361
|
-
});
|
|
349
|
+
useAutopopulationContextValue_1.useAutopopulationContextValue.mockReturnValue({ autopopulationContextValue: null });
|
|
362
350
|
});
|
|
363
|
-
var
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
},
|
|
368
|
-
attributeType: {
|
|
369
|
-
type: 'String',
|
|
370
|
-
uri: 'configuration/entityTypes/HCA/attributes/InternalCustomer',
|
|
371
|
-
dependentLookupCode: 'Code'
|
|
372
|
-
},
|
|
373
|
-
mode: mdm_sdk_1.Mode.Editing,
|
|
374
|
-
onChangeAttribute: jest.fn()
|
|
375
|
-
};
|
|
376
|
-
var setUp = function () {
|
|
377
|
-
var args_1 = [];
|
|
378
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
379
|
-
args_1[_i] = arguments[_i];
|
|
380
|
-
}
|
|
381
|
-
return __awaiter(void 0, __spreadArray([], args_1, true), void 0, function (props, _a) {
|
|
382
|
-
var user, renderResult;
|
|
383
|
-
if (props === void 0) { props = {}; }
|
|
384
|
-
var _b = _a === void 0 ? {} : _a, _c = _b.isProfilePerspective, isProfilePerspective = _c === void 0 ? true : _c;
|
|
385
|
-
return __generator(this, function (_d) {
|
|
386
|
-
switch (_d.label) {
|
|
387
|
-
case 0:
|
|
388
|
-
user = user_event_1.default.setup();
|
|
389
|
-
renderResult = (0, react_2.render)(react_1.default.createElement(ProfilePerspectiveViewContext_1.ProfilePerspectiveViewContext.Provider, { value: isProfilePerspective },
|
|
390
|
-
react_1.default.createElement(ScrollToElementContext_1.ScrollToElementContext.Provider, { value: {
|
|
391
|
-
element: null,
|
|
392
|
-
highlightError: highlightErrorSpy,
|
|
393
|
-
scrollIntoRef: scrollIntoRefSpy,
|
|
394
|
-
type: ScrollToElementContext_1.ScrollType.Error
|
|
395
|
-
} },
|
|
396
|
-
react_1.default.createElement(SimpleAttributeEditor_1.default, __assign({}, defaultProps, props)))));
|
|
397
|
-
return [4 /*yield*/, (0, react_2.act)(function () { return Promise.resolve(); })];
|
|
398
|
-
case 1:
|
|
399
|
-
_d.sent();
|
|
400
|
-
return [2 /*return*/, __assign({ user: user }, renderResult)];
|
|
401
|
-
}
|
|
402
|
-
});
|
|
403
|
-
});
|
|
351
|
+
var attributeType = {
|
|
352
|
+
type: 'String',
|
|
353
|
+
uri: 'configuration/entityTypes/HCA/attributes/InternalCustomer',
|
|
354
|
+
dependentLookupCode: 'Code'
|
|
404
355
|
};
|
|
405
356
|
it('should call getDependentLookupEditorContext selector with correct arguments', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
406
357
|
return __generator(this, function (_a) {
|
|
407
358
|
switch (_a.label) {
|
|
408
|
-
case 0:
|
|
359
|
+
case 0:
|
|
360
|
+
setUp({ props: { attributeType: attributeType }, isProfilePerspective: true });
|
|
361
|
+
return [4 /*yield*/, (0, react_2.act)(function () { return Promise.resolve(); })];
|
|
409
362
|
case 1:
|
|
410
363
|
_a.sent();
|
|
411
|
-
expect(MdmModuleContext_1.useMdmDependentLookupEditorContext).toHaveBeenCalledWith(defaultProps.attributeValue,
|
|
412
|
-
expect(
|
|
364
|
+
expect(MdmModuleContext_1.useMdmDependentLookupEditorContext).toHaveBeenCalledWith(defaultProps.attributeValue, attributeType);
|
|
365
|
+
expect(useAutopopulationContextValue_1.useAutopopulationContextValue).toHaveBeenCalledWith({
|
|
413
366
|
enabled: true,
|
|
414
|
-
attributeTypeUri:
|
|
367
|
+
attributeTypeUri: attributeType.uri,
|
|
415
368
|
valueUri: defaultProps.attributeValue.uri
|
|
416
369
|
});
|
|
417
370
|
return [2 /*return*/];
|
|
@@ -421,12 +374,14 @@ describe('SimpleAttributeEditor', function () {
|
|
|
421
374
|
it('should call useAutopopulationContextValue with enabled: false if component is outside of Profile perspective', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
422
375
|
return __generator(this, function (_a) {
|
|
423
376
|
switch (_a.label) {
|
|
424
|
-
case 0:
|
|
377
|
+
case 0:
|
|
378
|
+
setUp({ props: { attributeType: attributeType }, isProfilePerspective: false });
|
|
379
|
+
return [4 /*yield*/, (0, react_2.act)(function () { return Promise.resolve(); })];
|
|
425
380
|
case 1:
|
|
426
381
|
_a.sent();
|
|
427
|
-
expect(
|
|
382
|
+
expect(useAutopopulationContextValue_1.useAutopopulationContextValue).toHaveBeenCalledWith({
|
|
428
383
|
enabled: false,
|
|
429
|
-
attributeTypeUri:
|
|
384
|
+
attributeTypeUri: attributeType.uri,
|
|
430
385
|
valueUri: defaultProps.attributeValue.uri
|
|
431
386
|
});
|
|
432
387
|
return [2 /*return*/];
|
|
@@ -450,7 +405,8 @@ describe('SimpleAttributeEditor', function () {
|
|
|
450
405
|
value: null
|
|
451
406
|
};
|
|
452
407
|
MdmModuleContext_1.useMdmDependentLookupEditorContext.mockReturnValue(dlEditorContext);
|
|
453
|
-
|
|
408
|
+
setUp({ props: { attributeType: attributeType }, isProfilePerspective: true });
|
|
409
|
+
return [4 /*yield*/, (0, react_2.act)(function () { return Promise.resolve(); })];
|
|
454
410
|
case 1:
|
|
455
411
|
_a.sent();
|
|
456
412
|
expect(react_2.screen.getByText('Some placeholder')).toBeDefined();
|
|
@@ -463,7 +419,7 @@ describe('SimpleAttributeEditor', function () {
|
|
|
463
419
|
max: 51,
|
|
464
420
|
offset: 0,
|
|
465
421
|
parents: dlEditorContext.parents,
|
|
466
|
-
type:
|
|
422
|
+
type: attributeType.dependentLookupCode
|
|
467
423
|
});
|
|
468
424
|
return [2 /*return*/];
|
|
469
425
|
}
|
|
@@ -479,12 +435,11 @@ describe('SimpleAttributeEditor', function () {
|
|
|
479
435
|
isTouched: true,
|
|
480
436
|
onTouch: jest.fn()
|
|
481
437
|
};
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
});
|
|
485
|
-
return [4 /*yield*/, setUp()];
|
|
438
|
+
useAutopopulationContextValue_1.useAutopopulationContextValue.mockReturnValue({ autopopulationContextValue: autopopulationContextValue });
|
|
439
|
+
user = setUp({ props: { attributeType: attributeType }, isProfilePerspective: true }).user;
|
|
440
|
+
return [4 /*yield*/, (0, react_2.act)(function () { return Promise.resolve(); })];
|
|
486
441
|
case 1:
|
|
487
|
-
|
|
442
|
+
_a.sent();
|
|
488
443
|
input = react_2.screen.getByRole('combobox');
|
|
489
444
|
expect(input).toBeDefined();
|
|
490
445
|
return [4 /*yield*/, user.clear(input)];
|
|
@@ -497,33 +452,6 @@ describe('SimpleAttributeEditor', function () {
|
|
|
497
452
|
}); });
|
|
498
453
|
});
|
|
499
454
|
describe('useScrollToAttributeError tests', function () {
|
|
500
|
-
var mdmValues = {
|
|
501
|
-
dependentLookups: {
|
|
502
|
-
editors: {}
|
|
503
|
-
}
|
|
504
|
-
};
|
|
505
|
-
var defaultProps = {
|
|
506
|
-
attributeValue: {
|
|
507
|
-
value: 'some string',
|
|
508
|
-
uri: 'entities/eNt1/attributes/InternalCustomer/gd42423'
|
|
509
|
-
},
|
|
510
|
-
attributeType: {
|
|
511
|
-
type: 'String',
|
|
512
|
-
uri: 'configuration/entityTypes/HCA/attributes/InternalCustomer'
|
|
513
|
-
},
|
|
514
|
-
mode: mdm_sdk_1.Mode.Editing
|
|
515
|
-
};
|
|
516
|
-
var setUp = function (error) {
|
|
517
|
-
if (error === void 0) { error = null; }
|
|
518
|
-
return (0, enzyme_1.mount)(react_1.default.createElement(MdmModuleContext_1.MdmModuleProvider, { values: mdmValues },
|
|
519
|
-
react_1.default.createElement(ScrollToElementContext_1.ScrollToElementContext.Provider, { value: {
|
|
520
|
-
element: error,
|
|
521
|
-
highlightError: highlightErrorSpy,
|
|
522
|
-
scrollIntoRef: scrollIntoRefSpy,
|
|
523
|
-
type: ScrollToElementContext_1.ScrollType.Error
|
|
524
|
-
} },
|
|
525
|
-
react_1.default.createElement(SimpleAttributeEditor_1.default, __assign({}, defaultProps)))));
|
|
526
|
-
};
|
|
527
455
|
var fullError = {
|
|
528
456
|
type: 'invalid',
|
|
529
457
|
attributeTypeUri: defaultProps.attributeType.uri,
|
|
@@ -533,24 +461,82 @@ describe('SimpleAttributeEditor', function () {
|
|
|
533
461
|
severity: 'ERROR'
|
|
534
462
|
};
|
|
535
463
|
it('should not highlight error if it have wrong uri', function () {
|
|
536
|
-
|
|
537
|
-
expect(
|
|
538
|
-
expect(useScrollToAttributeError_1.useScrollToAttributeError
|
|
539
|
-
highlightedError: null,
|
|
540
|
-
isSimple: true
|
|
541
|
-
});
|
|
464
|
+
setUp({ error: fullError });
|
|
465
|
+
expect(react_2.screen.getByTestId('simple-attribute-editor')).not.toHaveClass('highlightError simpleAttribute');
|
|
466
|
+
expect(useScrollToAttributeError_1.useScrollToAttributeError).toHaveBeenCalledWith({ highlightedError: null, isSimple: true });
|
|
542
467
|
});
|
|
543
468
|
it('should highlight error if it have right uri', function () {
|
|
544
469
|
var error = __assign(__assign({}, fullError), { uri: defaultProps.attributeValue.uri });
|
|
545
|
-
var
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
470
|
+
var scrollToElementContextValue = setUp({ error: error }).scrollToElementContextValue;
|
|
471
|
+
expect(react_2.screen.getByTestId('simple-attribute-editor')).toHaveClass('highlightError simpleAttribute');
|
|
472
|
+
expect(useScrollToAttributeError_1.useScrollToAttributeError).toHaveBeenCalledWith({
|
|
473
|
+
highlightedError: scrollToElementContextValue,
|
|
474
|
+
isSimple: true
|
|
475
|
+
});
|
|
476
|
+
});
|
|
477
|
+
});
|
|
478
|
+
describe('without permissions', function () {
|
|
479
|
+
it('should render just text, if there is only READ permission', function () {
|
|
480
|
+
var props = {
|
|
481
|
+
attributeValue: {
|
|
482
|
+
value: 'some string',
|
|
483
|
+
uri: '1'
|
|
484
|
+
},
|
|
485
|
+
attributeType: {
|
|
486
|
+
access: ['READ'],
|
|
487
|
+
type: 'String',
|
|
488
|
+
uri: 'configuration/entityTypes/HCA/attributes/InternalCustomer'
|
|
489
|
+
}
|
|
490
|
+
};
|
|
491
|
+
setUp({ props: props });
|
|
492
|
+
expect(react_2.screen.getByText('some string')).toBeInTheDocument();
|
|
493
|
+
expect(react_2.screen.queryByTestId('reltio-delete-simple-attribute-button')).not.toBeInTheDocument();
|
|
494
|
+
});
|
|
495
|
+
it('should render text and DELETE button, if there are only READ and DELETE permission', function () {
|
|
496
|
+
var props = {
|
|
497
|
+
attributeValue: {
|
|
498
|
+
value: 'some string',
|
|
499
|
+
uri: '1'
|
|
500
|
+
},
|
|
501
|
+
attributeType: {
|
|
502
|
+
access: ['READ', 'DELETE'],
|
|
503
|
+
type: 'String',
|
|
504
|
+
uri: 'configuration/entityTypes/HCA/attributes/InternalCustomer'
|
|
505
|
+
}
|
|
506
|
+
};
|
|
507
|
+
setUp({ props: props });
|
|
508
|
+
expect(react_2.screen.getByText('some string')).toBeInTheDocument();
|
|
509
|
+
expect(react_2.screen.getByTestId('reltio-delete-simple-attribute-button')).toBeInTheDocument();
|
|
510
|
+
});
|
|
511
|
+
it('should render always visible attribute without value correct, if there are only READ permission', function () {
|
|
512
|
+
var props = {
|
|
513
|
+
attributeValue: {
|
|
514
|
+
uri: 'uri$$'
|
|
515
|
+
},
|
|
516
|
+
attributeType: {
|
|
517
|
+
access: ['READ'],
|
|
518
|
+
type: 'String',
|
|
519
|
+
uri: 'configuration/entityTypes/HCA/attributes/InternalCustomer'
|
|
520
|
+
}
|
|
521
|
+
};
|
|
522
|
+
setUp({ props: props, alwaysVisibleAttributes: ['configuration/entityTypes/HCA/attributes/InternalCustomer'] });
|
|
523
|
+
expect(react_2.screen.queryByRole('textbox')).not.toBeInTheDocument();
|
|
524
|
+
expect(react_2.screen.queryByTestId('reltio-delete-simple-attribute-button')).not.toBeInTheDocument();
|
|
525
|
+
});
|
|
526
|
+
it('should render always visible attribute without value correct, if there are only READ and DELETE permission', function () {
|
|
527
|
+
var props = {
|
|
528
|
+
attributeValue: {
|
|
529
|
+
uri: 'uri$$'
|
|
530
|
+
},
|
|
531
|
+
attributeType: {
|
|
532
|
+
access: ['READ', 'DELETE'],
|
|
533
|
+
type: 'String',
|
|
534
|
+
uri: 'configuration/entityTypes/HCA/attributes/InternalCustomer'
|
|
535
|
+
}
|
|
551
536
|
};
|
|
552
|
-
|
|
553
|
-
expect(
|
|
537
|
+
setUp({ props: props, alwaysVisibleAttributes: ['configuration/entityTypes/HCA/attributes/InternalCustomer'] });
|
|
538
|
+
expect(react_2.screen.queryByRole('textbox')).not.toBeInTheDocument();
|
|
539
|
+
expect(react_2.screen.getByTestId('reltio-delete-simple-attribute-button')).toBeInTheDocument();
|
|
554
540
|
});
|
|
555
541
|
});
|
|
556
542
|
});
|