@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
|
@@ -45,133 +45,102 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
45
45
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
49
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
50
|
-
if (ar || !(i in from)) {
|
|
51
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
52
|
-
ar[i] = from[i];
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
56
|
-
};
|
|
57
48
|
import React from 'react';
|
|
58
|
-
import {
|
|
59
|
-
import { act, screen, render } from '@testing-library/react';
|
|
49
|
+
import { act, screen, render, within } from '@testing-library/react';
|
|
60
50
|
import userEvent from '@testing-library/user-event';
|
|
61
51
|
import { Mode, getDependentLookups } from '@reltio/mdm-sdk';
|
|
62
|
-
import { DataTypeValueEditor } from '../DataTypeValueEditor';
|
|
63
|
-
import * as useAutopopulationContextValueExport from './useAutopopulationContextValue';
|
|
64
|
-
import { ErrorWrapper } from '../ErrorWrapper';
|
|
65
52
|
import SimpleAttributeEditor from './SimpleAttributeEditor';
|
|
66
|
-
import { useScrollToAttributeError } from '../hooks/useScrollToAttributeError';
|
|
67
53
|
import { ProfilePerspectiveViewContext } from '../contexts/ProfilePerspectiveViewContext';
|
|
68
54
|
import { ScrollType, ScrollToElementContext } from '../contexts/ScrollToElementContext';
|
|
69
55
|
import { MdmModuleProvider, useMdmDependentLookupEditorContext } from '../contexts/MdmModuleContext';
|
|
56
|
+
import { AlwaysVisibleAttributesContext } from '../contexts/AlwaysVisibleAttributesContext';
|
|
57
|
+
import { useAutopopulationContextValue } from './useAutopopulationContextValue';
|
|
58
|
+
import { useScrollToAttributeError } from '../hooks/useScrollToAttributeError';
|
|
59
|
+
import { useAsyncMount } from '../hooks/useAsyncMount';
|
|
70
60
|
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(); }) })); });
|
|
71
61
|
jest.mock('../contexts/MdmModuleContext', function () { return (__assign(__assign({}, jest.requireActual('../contexts/MdmModuleContext')), { useMdmDependentLookupEditorContext: jest.fn() })); });
|
|
62
|
+
jest.mock('./useAutopopulationContextValue', function () { return (__assign(__assign({}, jest.requireActual('./useAutopopulationContextValue')), { useAutopopulationContextValue: jest.fn() })); });
|
|
72
63
|
jest.mock('../hooks/useScrollToAttributeError', function () { return (__assign(__assign({}, jest.requireActual('../hooks/useScrollToAttributeError')), { useScrollToAttributeError: jest.fn() })); });
|
|
64
|
+
jest.mock('../hooks/useAsyncMount', function () { return (__assign(__assign({}, jest.requireActual('../hooks/useAsyncMount')), { useAsyncMount: jest.fn() })); });
|
|
73
65
|
describe('SimpleAttributeEditor', function () {
|
|
74
|
-
var
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
66
|
+
var getScrollToElementContextValue = function (error) {
|
|
67
|
+
if (error === void 0) { error = null; }
|
|
68
|
+
return ({
|
|
69
|
+
element: error,
|
|
70
|
+
highlightError: jest.fn(),
|
|
71
|
+
scrollIntoRef: jest.fn(),
|
|
72
|
+
type: ScrollType.Error
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
var mdmValues = {
|
|
76
|
+
dependentLookups: {
|
|
77
|
+
editors: {},
|
|
78
|
+
structure: {},
|
|
79
|
+
initedTypeUris: []
|
|
80
|
+
}
|
|
82
81
|
};
|
|
83
|
-
var highlightErrorSpy = jest.fn();
|
|
84
|
-
var scrollIntoRefSpy = jest.fn();
|
|
85
82
|
beforeAll(function () {
|
|
86
|
-
useScrollToAttributeError.
|
|
83
|
+
useScrollToAttributeError.mockImplementation(jest.requireActual('../hooks/useScrollToAttributeError').useScrollToAttributeError);
|
|
84
|
+
useAsyncMount.mockImplementation(jest.requireActual('../hooks/useAsyncMount').useAsyncMount);
|
|
85
|
+
useAutopopulationContextValue.mockImplementation(jest.requireActual('./useAutopopulationContextValue').useAutopopulationContextValue);
|
|
87
86
|
});
|
|
88
87
|
beforeEach(function () {
|
|
89
|
-
onAddFn = jest.fn();
|
|
90
|
-
onDeleteFn = jest.fn();
|
|
91
|
-
onChangeFn = jest.fn();
|
|
92
|
-
onDeactivateErrorFn = jest.fn();
|
|
93
|
-
});
|
|
94
|
-
afterEach(function () {
|
|
95
88
|
jest.clearAllMocks();
|
|
96
89
|
});
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
additionalControlsRenderer: additionalControlsRenderer,
|
|
125
|
-
state: state
|
|
126
|
-
};
|
|
127
|
-
return mount(React.createElement(MdmModuleProvider, { values: mdmValues },
|
|
128
|
-
React.createElement(ScrollToElementContext.Provider, { value: {
|
|
129
|
-
element: null,
|
|
130
|
-
highlightError: highlightErrorSpy,
|
|
131
|
-
scrollIntoRef: scrollIntoRefSpy,
|
|
132
|
-
type: ScrollType.Error
|
|
133
|
-
} },
|
|
134
|
-
React.createElement(SimpleAttributeEditor, __assign({}, data)))));
|
|
135
|
-
};
|
|
136
|
-
var findActionButtons = function (component) {
|
|
137
|
-
return component
|
|
138
|
-
.findWhere(function (n) { return n.prop('className') && n.prop('className').includes('editor-actions'); })
|
|
139
|
-
.children();
|
|
90
|
+
var defaultProps = {
|
|
91
|
+
attributeValue: {
|
|
92
|
+
value: 'some string',
|
|
93
|
+
uri: 'entities/eNt1/attributes/InternalCustomer/gd42423'
|
|
94
|
+
},
|
|
95
|
+
attributeType: {
|
|
96
|
+
access: ['UPDATE', 'DELETE', 'CREATE', 'READ'],
|
|
97
|
+
type: 'String',
|
|
98
|
+
uri: 'configuration/entityTypes/HCA/attributes/InternalCustomer'
|
|
99
|
+
},
|
|
100
|
+
isReltioCrosswalk: true,
|
|
101
|
+
mode: Mode.Editing,
|
|
102
|
+
onAddOneMore: jest.fn(),
|
|
103
|
+
onDeleteAttribute: jest.fn(),
|
|
104
|
+
onChangeAttribute: jest.fn(),
|
|
105
|
+
onDeactivateError: jest.fn()
|
|
106
|
+
};
|
|
107
|
+
var setUp = function (_a) {
|
|
108
|
+
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;
|
|
109
|
+
var user = userEvent.setup();
|
|
110
|
+
var scrollToElementContextValue = getScrollToElementContextValue(error);
|
|
111
|
+
var Providers = function (_a) {
|
|
112
|
+
var children = _a.children;
|
|
113
|
+
return (React.createElement(MdmModuleProvider, { values: mdmValues },
|
|
114
|
+
React.createElement(AlwaysVisibleAttributesContext.Provider, { value: alwaysVisibleAttributes },
|
|
115
|
+
React.createElement(ProfilePerspectiveViewContext.Provider, { value: isProfilePerspective },
|
|
116
|
+
React.createElement(ScrollToElementContext.Provider, { value: scrollToElementContextValue }, children)))));
|
|
140
117
|
};
|
|
118
|
+
return __assign({ user: user, scrollToElementContextValue: scrollToElementContextValue }, render(React.createElement(SimpleAttributeEditor, __assign({}, defaultProps, props)), { wrapper: Providers }));
|
|
119
|
+
};
|
|
120
|
+
describe('String attribute', function () {
|
|
141
121
|
it('should render the simple attribute to edit with action buttons', function () {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
expect(
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
uri: 'configuration/entityTypes/HCA/attributes/InternalCustomer'
|
|
150
|
-
}
|
|
151
|
-
});
|
|
152
|
-
expect(errorWrapper.prop('errorMessage')).toBeFalsy();
|
|
153
|
-
var editor = component.find('.editor');
|
|
154
|
-
expect(editor.hasClass(scrollToAttributeError.errorClassName)).toBeTruthy();
|
|
155
|
-
expect(editor.getElement().ref).toBe(scrollToAttributeError.ref);
|
|
156
|
-
var actionButtons = findActionButtons(component);
|
|
157
|
-
expect(actionButtons.length).toBe(2);
|
|
158
|
-
actionButtons.at(0).find('button').simulate('click');
|
|
159
|
-
expect(onAddFn).toHaveBeenCalled();
|
|
160
|
-
actionButtons.at(1).find('button').simulate('click');
|
|
161
|
-
expect(onDeleteFn).toHaveBeenCalled();
|
|
122
|
+
setUp();
|
|
123
|
+
expect(screen.getByRole('textbox')).toHaveValue('some string');
|
|
124
|
+
expect(screen.queryByTestId('error-message')).not.toBeInTheDocument();
|
|
125
|
+
var actions = screen.getByTestId('reltio-attribute-actions');
|
|
126
|
+
expect(within(actions).getAllByRole('button')).toHaveLength(2);
|
|
127
|
+
expect(screen.getByTestId('reltio-add-one-more-simple-attribute-button')).toBeInTheDocument();
|
|
128
|
+
expect(screen.getByTestId('reltio-delete-simple-attribute-button')).toBeInTheDocument();
|
|
162
129
|
});
|
|
163
130
|
it('should render additional control between plus and delete buttons if additionalControlsRenderer prop is specified', function () {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
131
|
+
setUp({
|
|
132
|
+
props: {
|
|
133
|
+
additionalControlsRenderer: function (_a) {
|
|
134
|
+
var attributeValue = _a.attributeValue, attributeType = _a.attributeType;
|
|
135
|
+
return (React.createElement("div", { "data-reltio-id": "additional-controls" },
|
|
136
|
+
React.createElement("div", { "data-reltio-id": "attribute-value" }, attributeValue.uri),
|
|
137
|
+
React.createElement("div", { "data-reltio-id": "attribute-type" }, attributeType.uri)));
|
|
138
|
+
}
|
|
169
139
|
}
|
|
170
140
|
});
|
|
171
|
-
|
|
172
|
-
expect(
|
|
173
|
-
expect(
|
|
174
|
-
expect(actionButtons.at(1).prop('attributeType').uri).toBe('configuration/entityTypes/HCA/attributes/InternalCustomer');
|
|
141
|
+
expect(screen.getByTestId('additional-controls')).toBeInTheDocument();
|
|
142
|
+
expect(screen.getByTestId('attribute-value')).toHaveTextContent('entities/eNt1/attributes/InternalCustomer/gd42423');
|
|
143
|
+
expect(screen.getByTestId('attribute-type')).toHaveTextContent('configuration/entityTypes/HCA/attributes/InternalCustomer');
|
|
175
144
|
});
|
|
176
145
|
it('should render error message if ownError prop is specified', function () {
|
|
177
146
|
var ownError = {
|
|
@@ -181,209 +150,216 @@ describe('SimpleAttributeEditor', function () {
|
|
|
181
150
|
message: 'Error!!!',
|
|
182
151
|
type: 'invalid'
|
|
183
152
|
};
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
expect(
|
|
187
|
-
expect(errorWrapper.prop('errorMessage')).toBe(ownError.message);
|
|
153
|
+
setUp({ props: { ownError: ownError } });
|
|
154
|
+
expect(screen.getByRole('textbox')).toHaveValue('some string');
|
|
155
|
+
expect(screen.getByTestId('error-message')).toHaveTextContent('Error!!!');
|
|
188
156
|
});
|
|
189
157
|
it('should not render delete button in case of missed DELETE permission', function () {
|
|
190
|
-
var
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
expect(
|
|
194
|
-
|
|
195
|
-
expect(onAddFn).toHaveBeenCalled();
|
|
158
|
+
var attributeType = __assign(__assign({}, defaultProps.attributeType), { access: ['UPDATE', 'CREATE', 'READ'] });
|
|
159
|
+
setUp({ props: { attributeType: attributeType } });
|
|
160
|
+
expect(screen.getByRole('textbox')).toHaveValue('some string');
|
|
161
|
+
expect(screen.getByTestId('reltio-add-one-more-simple-attribute-button')).toBeInTheDocument();
|
|
162
|
+
expect(screen.queryByTestId('reltio-delete-simple-attribute-button')).not.toBeInTheDocument();
|
|
196
163
|
});
|
|
197
164
|
it('should not render plus button in case of missed CREATE permission', function () {
|
|
198
|
-
var
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
expect(
|
|
202
|
-
|
|
203
|
-
expect(onDeleteFn).toHaveBeenCalledWith({
|
|
204
|
-
attributeType: {
|
|
205
|
-
access: ['UPDATE', 'DELETE', 'READ'],
|
|
206
|
-
type: 'String',
|
|
207
|
-
uri: 'configuration/entityTypes/HCA/attributes/InternalCustomer'
|
|
208
|
-
},
|
|
209
|
-
uri: 'entities/eNt1/attributes/InternalCustomer/gd42423'
|
|
210
|
-
});
|
|
165
|
+
var attributeType = __assign(__assign({}, defaultProps.attributeType), { access: ['UPDATE', 'DELETE', 'READ'] });
|
|
166
|
+
setUp({ props: { attributeType: attributeType } });
|
|
167
|
+
expect(screen.getByRole('textbox')).toHaveValue('some string');
|
|
168
|
+
expect(screen.getByTestId('reltio-delete-simple-attribute-button')).toBeInTheDocument();
|
|
169
|
+
expect(screen.queryByTestId('reltio-add-one-more-simple-attribute-button')).not.toBeInTheDocument();
|
|
211
170
|
});
|
|
212
|
-
it('should call onChangeAttribute prop when input value changes', function () {
|
|
213
|
-
var
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
171
|
+
it('should call onChangeAttribute prop when input value changes', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
172
|
+
var user;
|
|
173
|
+
return __generator(this, function (_a) {
|
|
174
|
+
switch (_a.label) {
|
|
175
|
+
case 0:
|
|
176
|
+
user = setUp().user;
|
|
177
|
+
return [4 /*yield*/, user.type(screen.getByRole('textbox'), ' new{enter}')];
|
|
178
|
+
case 1:
|
|
179
|
+
_a.sent();
|
|
180
|
+
expect(defaultProps.onChangeAttribute).toHaveBeenCalledWith({
|
|
181
|
+
attributeType: {
|
|
182
|
+
access: ['UPDATE', 'DELETE', 'CREATE', 'READ'],
|
|
183
|
+
type: 'String',
|
|
184
|
+
uri: 'configuration/entityTypes/HCA/attributes/InternalCustomer'
|
|
185
|
+
},
|
|
186
|
+
uri: 'entities/eNt1/attributes/InternalCustomer/gd42423',
|
|
187
|
+
value: 'some string new'
|
|
188
|
+
});
|
|
189
|
+
expect(defaultProps.onDeactivateError).not.toHaveBeenCalled();
|
|
190
|
+
return [2 /*return*/];
|
|
191
|
+
}
|
|
224
192
|
});
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
193
|
+
}); });
|
|
194
|
+
it('should deactivate error when input value changes', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
195
|
+
var ownError, user;
|
|
196
|
+
return __generator(this, function (_a) {
|
|
197
|
+
switch (_a.label) {
|
|
198
|
+
case 0:
|
|
199
|
+
ownError = {
|
|
200
|
+
uri: 'entities/eNt1/attributes/InternalCustomer/gd42423',
|
|
201
|
+
parentUri: 'entities/eNt1',
|
|
202
|
+
attributeTypeUri: 'configuration/entityTypes/HCA/attributes/InternalCustomer',
|
|
203
|
+
message: 'Error!!!',
|
|
204
|
+
type: 'invalid'
|
|
205
|
+
};
|
|
206
|
+
user = setUp({ props: { ownError: ownError } }).user;
|
|
207
|
+
return [4 /*yield*/, user.type(screen.getByRole('textbox'), ' new{enter}')];
|
|
208
|
+
case 1:
|
|
209
|
+
_a.sent();
|
|
210
|
+
expect(defaultProps.onChangeAttribute).toHaveBeenCalledWith({
|
|
211
|
+
attributeType: {
|
|
212
|
+
access: ['UPDATE', 'DELETE', 'CREATE', 'READ'],
|
|
213
|
+
type: 'String',
|
|
214
|
+
uri: 'configuration/entityTypes/HCA/attributes/InternalCustomer'
|
|
215
|
+
},
|
|
216
|
+
uri: 'entities/eNt1/attributes/InternalCustomer/gd42423',
|
|
217
|
+
value: 'some string new'
|
|
218
|
+
});
|
|
219
|
+
expect(defaultProps.onDeactivateError).toHaveBeenCalledWith('configuration/entityTypes/HCA/attributes/InternalCustomer-entities/eNt1/attributes/InternalCustomer/gd42423-entities/eNt1');
|
|
220
|
+
return [2 /*return*/];
|
|
221
|
+
}
|
|
246
222
|
});
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
223
|
+
}); });
|
|
224
|
+
it('should call onDeleteAttribute after click on delete button', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
225
|
+
var user;
|
|
226
|
+
return __generator(this, function (_a) {
|
|
227
|
+
switch (_a.label) {
|
|
228
|
+
case 0:
|
|
229
|
+
user = setUp().user;
|
|
230
|
+
return [4 /*yield*/, user.click(screen.getByTestId('reltio-delete-simple-attribute-button'))];
|
|
231
|
+
case 1:
|
|
232
|
+
_a.sent();
|
|
233
|
+
expect(defaultProps.onDeleteAttribute).toHaveBeenCalledWith({
|
|
234
|
+
attributeType: {
|
|
235
|
+
access: ['UPDATE', 'DELETE', 'CREATE', 'READ'],
|
|
236
|
+
type: 'String',
|
|
237
|
+
uri: 'configuration/entityTypes/HCA/attributes/InternalCustomer'
|
|
238
|
+
},
|
|
239
|
+
uri: 'entities/eNt1/attributes/InternalCustomer/gd42423'
|
|
240
|
+
});
|
|
241
|
+
expect(defaultProps.onDeactivateError).not.toHaveBeenCalled();
|
|
242
|
+
return [2 /*return*/];
|
|
243
|
+
}
|
|
261
244
|
});
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
actionButtons.at(1).find('button').simulate('click');
|
|
276
|
-
expect(onDeleteFn).toHaveBeenCalledWith({
|
|
277
|
-
attributeType: {
|
|
278
|
-
access: ['UPDATE', 'DELETE', 'CREATE', 'READ'],
|
|
279
|
-
type: 'String',
|
|
280
|
-
uri: 'configuration/entityTypes/HCA/attributes/InternalCustomer'
|
|
281
|
-
},
|
|
282
|
-
uri: 'entities/eNt1/attributes/InternalCustomer/gd42423'
|
|
245
|
+
}); });
|
|
246
|
+
it('should call onAddOneMore on click on add more button', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
247
|
+
var user;
|
|
248
|
+
return __generator(this, function (_a) {
|
|
249
|
+
switch (_a.label) {
|
|
250
|
+
case 0:
|
|
251
|
+
user = setUp().user;
|
|
252
|
+
return [4 /*yield*/, user.click(screen.getByTestId('reltio-add-one-more-simple-attribute-button'))];
|
|
253
|
+
case 1:
|
|
254
|
+
_a.sent();
|
|
255
|
+
expect(defaultProps.onAddOneMore).toHaveBeenCalledTimes(1);
|
|
256
|
+
return [2 /*return*/];
|
|
257
|
+
}
|
|
283
258
|
});
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
259
|
+
}); });
|
|
260
|
+
it('should deactivate "invalid" error after click on delete button', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
261
|
+
var ownError, user;
|
|
262
|
+
return __generator(this, function (_a) {
|
|
263
|
+
switch (_a.label) {
|
|
264
|
+
case 0:
|
|
265
|
+
ownError = {
|
|
266
|
+
uri: 'entities/eNt1/attributes/InternalCustomer/gd42423',
|
|
267
|
+
parentUri: 'entities/eNt1',
|
|
268
|
+
attributeTypeUri: 'configuration/entityTypes/HCA/attributes/InternalCustomer',
|
|
269
|
+
message: 'Error!!!',
|
|
270
|
+
type: 'invalid'
|
|
271
|
+
};
|
|
272
|
+
user = setUp({ props: { ownError: ownError } }).user;
|
|
273
|
+
return [4 /*yield*/, user.click(screen.getByTestId('reltio-delete-simple-attribute-button'))];
|
|
274
|
+
case 1:
|
|
275
|
+
_a.sent();
|
|
276
|
+
expect(defaultProps.onDeleteAttribute).toHaveBeenCalledWith({
|
|
277
|
+
attributeType: {
|
|
278
|
+
access: ['UPDATE', 'DELETE', 'CREATE', 'READ'],
|
|
279
|
+
type: 'String',
|
|
280
|
+
uri: 'configuration/entityTypes/HCA/attributes/InternalCustomer'
|
|
281
|
+
},
|
|
282
|
+
uri: 'entities/eNt1/attributes/InternalCustomer/gd42423'
|
|
283
|
+
});
|
|
284
|
+
expect(defaultProps.onDeactivateError).toHaveBeenCalledWith('configuration/entityTypes/HCA/attributes/InternalCustomer-entities/eNt1/attributes/InternalCustomer/gd42423-entities/eNt1');
|
|
285
|
+
return [2 /*return*/];
|
|
286
|
+
}
|
|
305
287
|
});
|
|
306
|
-
|
|
307
|
-
|
|
288
|
+
}); });
|
|
289
|
+
it('should not deactivate "missed" error after click on delete button', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
290
|
+
var ownError, user;
|
|
291
|
+
return __generator(this, function (_a) {
|
|
292
|
+
switch (_a.label) {
|
|
293
|
+
case 0:
|
|
294
|
+
ownError = {
|
|
295
|
+
uri: '',
|
|
296
|
+
parentUri: 'entities/eNt1',
|
|
297
|
+
attributeTypeUri: 'configuration/entityTypes/HCA/attributes/InternalCustomer',
|
|
298
|
+
message: 'Error!!!',
|
|
299
|
+
type: 'missed'
|
|
300
|
+
};
|
|
301
|
+
user = setUp({ props: { ownError: ownError } }).user;
|
|
302
|
+
return [4 /*yield*/, user.click(screen.getByTestId('reltio-delete-simple-attribute-button'))];
|
|
303
|
+
case 1:
|
|
304
|
+
_a.sent();
|
|
305
|
+
expect(defaultProps.onDeleteAttribute).toHaveBeenCalledWith({
|
|
306
|
+
attributeType: {
|
|
307
|
+
access: ['UPDATE', 'DELETE', 'CREATE', 'READ'],
|
|
308
|
+
type: 'String',
|
|
309
|
+
uri: 'configuration/entityTypes/HCA/attributes/InternalCustomer'
|
|
310
|
+
},
|
|
311
|
+
uri: 'entities/eNt1/attributes/InternalCustomer/gd42423'
|
|
312
|
+
});
|
|
313
|
+
expect(defaultProps.onDeactivateError).not.toHaveBeenCalled();
|
|
314
|
+
return [2 /*return*/];
|
|
315
|
+
}
|
|
316
|
+
});
|
|
317
|
+
}); });
|
|
308
318
|
it('should be wrapped in withAsyncMount HOC', function () {
|
|
309
|
-
|
|
310
|
-
expect(
|
|
311
|
-
expect(component.find('WithAsyncMount').find('SimpleAttributeEditor').exists()).toBe(true);
|
|
319
|
+
setUp();
|
|
320
|
+
expect(useAsyncMount).toHaveBeenCalled();
|
|
312
321
|
});
|
|
313
322
|
it('should render component in "deleted" state', function () {
|
|
314
|
-
|
|
315
|
-
expect(
|
|
316
|
-
expect(
|
|
317
|
-
expect(
|
|
318
|
-
expect(
|
|
323
|
+
setUp({ props: { state: 'deleted' } });
|
|
324
|
+
expect(screen.getByRole('textbox')).toBeDisabled();
|
|
325
|
+
expect(screen.getByTestId('reltio-attribute-value')).toHaveClass('deleted');
|
|
326
|
+
expect(screen.getAllByRole('button')).toHaveLength(1);
|
|
327
|
+
expect(screen.getByTestId('reltio-add-one-more-simple-attribute-button')).toBeInTheDocument();
|
|
328
|
+
expect(screen.queryByTestId('reltio-delete-simple-attribute-button')).not.toBeInTheDocument();
|
|
329
|
+
expect(screen.getByTestId('reltio-attribute-actions')).toHaveTextContent('');
|
|
319
330
|
});
|
|
320
331
|
it('should render component in "edited" state', function () {
|
|
321
|
-
|
|
322
|
-
expect(
|
|
323
|
-
expect(
|
|
324
|
-
expect(
|
|
325
|
-
expect(
|
|
332
|
+
setUp({ props: { state: 'edited' } });
|
|
333
|
+
expect(screen.getByRole('textbox')).not.toBeDisabled();
|
|
334
|
+
expect(screen.getByTestId('reltio-attribute-value')).not.toHaveClass('deleted');
|
|
335
|
+
expect(screen.getAllByRole('button')).toHaveLength(2);
|
|
336
|
+
expect(screen.getByTestId('reltio-add-one-more-simple-attribute-button')).toBeInTheDocument();
|
|
337
|
+
expect(screen.getByTestId('reltio-delete-simple-attribute-button')).toBeInTheDocument();
|
|
338
|
+
expect(screen.getByTestId('reltio-attribute-actions')).toHaveTextContent('(edited)');
|
|
326
339
|
});
|
|
327
340
|
});
|
|
328
341
|
describe('Dependent Lookup attribute', function () {
|
|
329
342
|
beforeEach(function () {
|
|
330
343
|
useMdmDependentLookupEditorContext.mockReturnValue({});
|
|
331
|
-
|
|
332
|
-
autopopulationContextValue: null
|
|
333
|
-
});
|
|
344
|
+
useAutopopulationContextValue.mockReturnValue({ autopopulationContextValue: null });
|
|
334
345
|
});
|
|
335
|
-
var
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
},
|
|
340
|
-
attributeType: {
|
|
341
|
-
type: 'String',
|
|
342
|
-
uri: 'configuration/entityTypes/HCA/attributes/InternalCustomer',
|
|
343
|
-
dependentLookupCode: 'Code'
|
|
344
|
-
},
|
|
345
|
-
mode: Mode.Editing,
|
|
346
|
-
onChangeAttribute: jest.fn()
|
|
347
|
-
};
|
|
348
|
-
var setUp = function () {
|
|
349
|
-
var args_1 = [];
|
|
350
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
351
|
-
args_1[_i] = arguments[_i];
|
|
352
|
-
}
|
|
353
|
-
return __awaiter(void 0, __spreadArray([], args_1, true), void 0, function (props, _a) {
|
|
354
|
-
var user, renderResult;
|
|
355
|
-
if (props === void 0) { props = {}; }
|
|
356
|
-
var _b = _a === void 0 ? {} : _a, _c = _b.isProfilePerspective, isProfilePerspective = _c === void 0 ? true : _c;
|
|
357
|
-
return __generator(this, function (_d) {
|
|
358
|
-
switch (_d.label) {
|
|
359
|
-
case 0:
|
|
360
|
-
user = userEvent.setup();
|
|
361
|
-
renderResult = render(React.createElement(ProfilePerspectiveViewContext.Provider, { value: isProfilePerspective },
|
|
362
|
-
React.createElement(ScrollToElementContext.Provider, { value: {
|
|
363
|
-
element: null,
|
|
364
|
-
highlightError: highlightErrorSpy,
|
|
365
|
-
scrollIntoRef: scrollIntoRefSpy,
|
|
366
|
-
type: ScrollType.Error
|
|
367
|
-
} },
|
|
368
|
-
React.createElement(SimpleAttributeEditor, __assign({}, defaultProps, props)))));
|
|
369
|
-
return [4 /*yield*/, act(function () { return Promise.resolve(); })];
|
|
370
|
-
case 1:
|
|
371
|
-
_d.sent();
|
|
372
|
-
return [2 /*return*/, __assign({ user: user }, renderResult)];
|
|
373
|
-
}
|
|
374
|
-
});
|
|
375
|
-
});
|
|
346
|
+
var attributeType = {
|
|
347
|
+
type: 'String',
|
|
348
|
+
uri: 'configuration/entityTypes/HCA/attributes/InternalCustomer',
|
|
349
|
+
dependentLookupCode: 'Code'
|
|
376
350
|
};
|
|
377
351
|
it('should call getDependentLookupEditorContext selector with correct arguments', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
378
352
|
return __generator(this, function (_a) {
|
|
379
353
|
switch (_a.label) {
|
|
380
|
-
case 0:
|
|
354
|
+
case 0:
|
|
355
|
+
setUp({ props: { attributeType: attributeType }, isProfilePerspective: true });
|
|
356
|
+
return [4 /*yield*/, act(function () { return Promise.resolve(); })];
|
|
381
357
|
case 1:
|
|
382
358
|
_a.sent();
|
|
383
|
-
expect(useMdmDependentLookupEditorContext).toHaveBeenCalledWith(defaultProps.attributeValue,
|
|
384
|
-
expect(
|
|
359
|
+
expect(useMdmDependentLookupEditorContext).toHaveBeenCalledWith(defaultProps.attributeValue, attributeType);
|
|
360
|
+
expect(useAutopopulationContextValue).toHaveBeenCalledWith({
|
|
385
361
|
enabled: true,
|
|
386
|
-
attributeTypeUri:
|
|
362
|
+
attributeTypeUri: attributeType.uri,
|
|
387
363
|
valueUri: defaultProps.attributeValue.uri
|
|
388
364
|
});
|
|
389
365
|
return [2 /*return*/];
|
|
@@ -393,12 +369,14 @@ describe('SimpleAttributeEditor', function () {
|
|
|
393
369
|
it('should call useAutopopulationContextValue with enabled: false if component is outside of Profile perspective', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
394
370
|
return __generator(this, function (_a) {
|
|
395
371
|
switch (_a.label) {
|
|
396
|
-
case 0:
|
|
372
|
+
case 0:
|
|
373
|
+
setUp({ props: { attributeType: attributeType }, isProfilePerspective: false });
|
|
374
|
+
return [4 /*yield*/, act(function () { return Promise.resolve(); })];
|
|
397
375
|
case 1:
|
|
398
376
|
_a.sent();
|
|
399
|
-
expect(
|
|
377
|
+
expect(useAutopopulationContextValue).toHaveBeenCalledWith({
|
|
400
378
|
enabled: false,
|
|
401
|
-
attributeTypeUri:
|
|
379
|
+
attributeTypeUri: attributeType.uri,
|
|
402
380
|
valueUri: defaultProps.attributeValue.uri
|
|
403
381
|
});
|
|
404
382
|
return [2 /*return*/];
|
|
@@ -422,7 +400,8 @@ describe('SimpleAttributeEditor', function () {
|
|
|
422
400
|
value: null
|
|
423
401
|
};
|
|
424
402
|
useMdmDependentLookupEditorContext.mockReturnValue(dlEditorContext);
|
|
425
|
-
|
|
403
|
+
setUp({ props: { attributeType: attributeType }, isProfilePerspective: true });
|
|
404
|
+
return [4 /*yield*/, act(function () { return Promise.resolve(); })];
|
|
426
405
|
case 1:
|
|
427
406
|
_a.sent();
|
|
428
407
|
expect(screen.getByText('Some placeholder')).toBeDefined();
|
|
@@ -435,7 +414,7 @@ describe('SimpleAttributeEditor', function () {
|
|
|
435
414
|
max: 51,
|
|
436
415
|
offset: 0,
|
|
437
416
|
parents: dlEditorContext.parents,
|
|
438
|
-
type:
|
|
417
|
+
type: attributeType.dependentLookupCode
|
|
439
418
|
});
|
|
440
419
|
return [2 /*return*/];
|
|
441
420
|
}
|
|
@@ -451,12 +430,11 @@ describe('SimpleAttributeEditor', function () {
|
|
|
451
430
|
isTouched: true,
|
|
452
431
|
onTouch: jest.fn()
|
|
453
432
|
};
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
});
|
|
457
|
-
return [4 /*yield*/, setUp()];
|
|
433
|
+
useAutopopulationContextValue.mockReturnValue({ autopopulationContextValue: autopopulationContextValue });
|
|
434
|
+
user = setUp({ props: { attributeType: attributeType }, isProfilePerspective: true }).user;
|
|
435
|
+
return [4 /*yield*/, act(function () { return Promise.resolve(); })];
|
|
458
436
|
case 1:
|
|
459
|
-
|
|
437
|
+
_a.sent();
|
|
460
438
|
input = screen.getByRole('combobox');
|
|
461
439
|
expect(input).toBeDefined();
|
|
462
440
|
return [4 /*yield*/, user.clear(input)];
|
|
@@ -469,33 +447,6 @@ describe('SimpleAttributeEditor', function () {
|
|
|
469
447
|
}); });
|
|
470
448
|
});
|
|
471
449
|
describe('useScrollToAttributeError tests', function () {
|
|
472
|
-
var mdmValues = {
|
|
473
|
-
dependentLookups: {
|
|
474
|
-
editors: {}
|
|
475
|
-
}
|
|
476
|
-
};
|
|
477
|
-
var defaultProps = {
|
|
478
|
-
attributeValue: {
|
|
479
|
-
value: 'some string',
|
|
480
|
-
uri: 'entities/eNt1/attributes/InternalCustomer/gd42423'
|
|
481
|
-
},
|
|
482
|
-
attributeType: {
|
|
483
|
-
type: 'String',
|
|
484
|
-
uri: 'configuration/entityTypes/HCA/attributes/InternalCustomer'
|
|
485
|
-
},
|
|
486
|
-
mode: Mode.Editing
|
|
487
|
-
};
|
|
488
|
-
var setUp = function (error) {
|
|
489
|
-
if (error === void 0) { error = null; }
|
|
490
|
-
return mount(React.createElement(MdmModuleProvider, { values: mdmValues },
|
|
491
|
-
React.createElement(ScrollToElementContext.Provider, { value: {
|
|
492
|
-
element: error,
|
|
493
|
-
highlightError: highlightErrorSpy,
|
|
494
|
-
scrollIntoRef: scrollIntoRefSpy,
|
|
495
|
-
type: ScrollType.Error
|
|
496
|
-
} },
|
|
497
|
-
React.createElement(SimpleAttributeEditor, __assign({}, defaultProps)))));
|
|
498
|
-
};
|
|
499
450
|
var fullError = {
|
|
500
451
|
type: 'invalid',
|
|
501
452
|
attributeTypeUri: defaultProps.attributeType.uri,
|
|
@@ -505,24 +456,82 @@ describe('SimpleAttributeEditor', function () {
|
|
|
505
456
|
severity: 'ERROR'
|
|
506
457
|
};
|
|
507
458
|
it('should not highlight error if it have wrong uri', function () {
|
|
508
|
-
|
|
509
|
-
expect(
|
|
510
|
-
expect(useScrollToAttributeError
|
|
511
|
-
highlightedError: null,
|
|
512
|
-
isSimple: true
|
|
513
|
-
});
|
|
459
|
+
setUp({ error: fullError });
|
|
460
|
+
expect(screen.getByTestId('simple-attribute-editor')).not.toHaveClass('highlightError simpleAttribute');
|
|
461
|
+
expect(useScrollToAttributeError).toHaveBeenCalledWith({ highlightedError: null, isSimple: true });
|
|
514
462
|
});
|
|
515
463
|
it('should highlight error if it have right uri', function () {
|
|
516
464
|
var error = __assign(__assign({}, fullError), { uri: defaultProps.attributeValue.uri });
|
|
517
|
-
var
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
465
|
+
var scrollToElementContextValue = setUp({ error: error }).scrollToElementContextValue;
|
|
466
|
+
expect(screen.getByTestId('simple-attribute-editor')).toHaveClass('highlightError simpleAttribute');
|
|
467
|
+
expect(useScrollToAttributeError).toHaveBeenCalledWith({
|
|
468
|
+
highlightedError: scrollToElementContextValue,
|
|
469
|
+
isSimple: true
|
|
470
|
+
});
|
|
471
|
+
});
|
|
472
|
+
});
|
|
473
|
+
describe('without permissions', function () {
|
|
474
|
+
it('should render just text, if there is only READ permission', function () {
|
|
475
|
+
var props = {
|
|
476
|
+
attributeValue: {
|
|
477
|
+
value: 'some string',
|
|
478
|
+
uri: '1'
|
|
479
|
+
},
|
|
480
|
+
attributeType: {
|
|
481
|
+
access: ['READ'],
|
|
482
|
+
type: 'String',
|
|
483
|
+
uri: 'configuration/entityTypes/HCA/attributes/InternalCustomer'
|
|
484
|
+
}
|
|
485
|
+
};
|
|
486
|
+
setUp({ props: props });
|
|
487
|
+
expect(screen.getByText('some string')).toBeInTheDocument();
|
|
488
|
+
expect(screen.queryByTestId('reltio-delete-simple-attribute-button')).not.toBeInTheDocument();
|
|
489
|
+
});
|
|
490
|
+
it('should render text and DELETE button, if there are only READ and DELETE permission', function () {
|
|
491
|
+
var props = {
|
|
492
|
+
attributeValue: {
|
|
493
|
+
value: 'some string',
|
|
494
|
+
uri: '1'
|
|
495
|
+
},
|
|
496
|
+
attributeType: {
|
|
497
|
+
access: ['READ', 'DELETE'],
|
|
498
|
+
type: 'String',
|
|
499
|
+
uri: 'configuration/entityTypes/HCA/attributes/InternalCustomer'
|
|
500
|
+
}
|
|
501
|
+
};
|
|
502
|
+
setUp({ props: props });
|
|
503
|
+
expect(screen.getByText('some string')).toBeInTheDocument();
|
|
504
|
+
expect(screen.getByTestId('reltio-delete-simple-attribute-button')).toBeInTheDocument();
|
|
505
|
+
});
|
|
506
|
+
it('should render always visible attribute without value correct, if there are only READ permission', function () {
|
|
507
|
+
var props = {
|
|
508
|
+
attributeValue: {
|
|
509
|
+
uri: 'uri$$'
|
|
510
|
+
},
|
|
511
|
+
attributeType: {
|
|
512
|
+
access: ['READ'],
|
|
513
|
+
type: 'String',
|
|
514
|
+
uri: 'configuration/entityTypes/HCA/attributes/InternalCustomer'
|
|
515
|
+
}
|
|
516
|
+
};
|
|
517
|
+
setUp({ props: props, alwaysVisibleAttributes: ['configuration/entityTypes/HCA/attributes/InternalCustomer'] });
|
|
518
|
+
expect(screen.queryByRole('textbox')).not.toBeInTheDocument();
|
|
519
|
+
expect(screen.queryByTestId('reltio-delete-simple-attribute-button')).not.toBeInTheDocument();
|
|
520
|
+
});
|
|
521
|
+
it('should render always visible attribute without value correct, if there are only READ and DELETE permission', function () {
|
|
522
|
+
var props = {
|
|
523
|
+
attributeValue: {
|
|
524
|
+
uri: 'uri$$'
|
|
525
|
+
},
|
|
526
|
+
attributeType: {
|
|
527
|
+
access: ['READ', 'DELETE'],
|
|
528
|
+
type: 'String',
|
|
529
|
+
uri: 'configuration/entityTypes/HCA/attributes/InternalCustomer'
|
|
530
|
+
}
|
|
523
531
|
};
|
|
524
|
-
|
|
525
|
-
expect(
|
|
532
|
+
setUp({ props: props, alwaysVisibleAttributes: ['configuration/entityTypes/HCA/attributes/InternalCustomer'] });
|
|
533
|
+
expect(screen.queryByRole('textbox')).not.toBeInTheDocument();
|
|
534
|
+
expect(screen.getByTestId('reltio-delete-simple-attribute-button')).toBeInTheDocument();
|
|
526
535
|
});
|
|
527
536
|
});
|
|
528
537
|
});
|