@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.
Files changed (332) hide show
  1. package/AttributesView/AttributesView.js +1 -1
  2. package/ColumnsSettings/components/ColumnsSettingsPopup/ColumnsSettingsPopup.d.ts +2 -3
  3. package/ColumnsSettings/helpers.d.ts +3 -1
  4. package/ColumnsSettings/types.d.ts +8 -0
  5. package/CommentsContainer/CommentsContainer.js +1 -1
  6. package/ConfigureColumnsPopup/ConfigureColumnsPopup.d.ts +23 -40
  7. package/ConfigureColumnsPopup/ConfigureColumnsPopup.js +6 -26
  8. package/EditModeAttributesList/EditModeAttributesList.js +1 -1
  9. package/EditModeAttributesPager/EditModeAttributesPager.test.js +1 -1
  10. package/EditModeAttributesPager/components/AttributeRenderer/AttributeRenderer.js +1 -1
  11. package/FacetViewHeader/FacetViewHeader.js +1 -1
  12. package/ImageAttributesLine/imageAttributeValues.test-data.js +8 -0
  13. package/ImageAttributesLine/index.d.ts +1 -1
  14. package/ImageAttributesLine/index.js +1 -1
  15. package/ImageDetailsView/components/ImageDetailsViewCarousel/ImageDetailsViewCarousel.js +1 -1
  16. package/MergeButton/MergeButton.spec.js +55 -124
  17. package/MetadataTypesSelector/MetadataTypesSelector.d.ts +2 -1
  18. package/MetadataTypesSelector/MetadataTypesSelector.js +1 -1
  19. package/MetadataTypesSelector/MetadataTypesSelector.test.js +193 -190
  20. package/MetadataTypesSelector/components/SelectMetadataTypesList/SelectMetadataTypesList.d.ts +5 -6
  21. package/MoreAttributesButton/MoreAttributesButton.test.js +173 -166
  22. package/MoreAttributesButton/useMoreAttributesItems.d.ts +1 -1
  23. package/MultiValueSelector/MultiValueSelector.test.js +78 -38
  24. package/MultipliableSelect/MultipliableSelect.test.js +111 -47
  25. package/NestedAttribute/NestedAttribute.test.js +121 -42
  26. package/NestedAttributeEditor/NestedAttributeEditor.test.js +95 -41
  27. package/NotMatchButton/NotMatchButton.spec.js +51 -100
  28. package/PieChart/PieChart.test.js +130 -114
  29. package/PinButton/PinButton.spec.js +89 -22
  30. package/PivotingTooltip/PivotingTooltip.test.js +338 -174
  31. package/PotentialMatchReviewCard/PotentialMatchReviewCard.spec.js +94 -29
  32. package/ProfileBand/ProfileBand.spec.js +60 -53
  33. package/ProfileCard/ProfileCard.test.js +109 -27
  34. package/ProfilesList/ProfilesList.d.ts +1 -3
  35. package/ProfilesList/ProfilesList.js +1 -1
  36. package/ProfilesList/ProfilesList.spec.js +226 -211
  37. package/QueryBuilderRow/QueryBuilderRow.spec.js +83 -90
  38. package/QueryBuilderRowsGroup/QueryBuilderRowsGroup.spec.js +195 -86
  39. package/ReactSelectLoadMoreButton/ReactSelectLoadMoreButton.test.js +73 -15
  40. package/ReactSelectMenuWithPopper/ReactSelectMenuWithPopper.test.js +71 -117
  41. package/ReadOnlyAttributeValuesBlock/ReadOnlyAttributeValuesBlock.test.js +128 -61
  42. package/ReadOnlyAttributesFactory/components/ReadOnlyAttribute/ReadOnlyAttribute.test.js +179 -44
  43. package/ReadOnlyAttributesList/ReadOnlyAttributesList.js +1 -1
  44. package/ReadOnlyAttributesList/ReadOnlyAttributesList.test.js +254 -211
  45. package/ReadOnlyAttributesList/attributes.test-data.js +4 -4
  46. package/ReadOnlyAttributesPager/ReadOnlyAttributesPager.js +1 -1
  47. package/ReadOnlyAttributesPager/ReadOnlyAttributesPager.test.js +75 -18
  48. package/ReadOnlyAttributesView/ReadOnlyAttributesView.js +1 -1
  49. package/ReadOnlyAttributesView/ReadOnlyAttributesView.test.js +187 -312
  50. package/ReadOnlyComplexAttribute/ReadOnlyComplexAttribute.test.js +210 -219
  51. package/ReadOnlyImageAttributesLine/ReadOnlyImageAttributesLine.test.js +89 -89
  52. package/ReferenceAttributeEditor/ReferenceAttributeEditor.test.js +556 -602
  53. package/ReferenceAttributeEditor/metadata.test-data.d.ts +13 -13
  54. package/ReferenceAttributeEditor/metadata.test-data.js +2 -2
  55. package/ReferenceAttributeEditor/styles.d.ts +1 -1
  56. package/RelationEditor/RelationEditor.test.js +1448 -1392
  57. package/RelationTypeSelector/RelationTypeSelector.test.js +99 -17
  58. package/RelationTypesSelector/RelationTypesSelector.test.js +73 -22
  59. package/ReltioMap/ReltioMap.spec.js +51 -25
  60. package/Roles/Roles.test.js +54 -10
  61. package/ScreenProfileBand/ScreenProfileBand.test.js +142 -72
  62. package/ScrollableTabs/ScrollableTabs.test.js +69 -19
  63. package/SearchHighlighter/SearchHighlighter.test.js +18 -7
  64. package/SelectAttributesList/SelectAttributesList.d.ts +11 -6
  65. package/SelectAttributesList/SelectAttributesList.js +5 -2
  66. package/SelectorWithOnlyOptionAutoSelect/SelectorWithOnlyOptionAutoSelect.test.js +109 -60
  67. package/SidePanelContentHeader/SidePanelContentHeader.js +2 -2
  68. package/SidePanelContentHeader/SidePanelContentHeader.test.js +104 -0
  69. package/SidePanelEmptyState/SidePanelEmptyState.js +1 -1
  70. package/SidePanelEmptyState/SidePanelEmptyState.test.js +24 -0
  71. package/SimpleAttribute/SimpleAttribute.js +1 -1
  72. package/SimpleAttribute/SimpleAttribute.test.js +155 -80
  73. package/SimpleAttributeEditor/SimpleAttributeEditor.test.js +339 -330
  74. package/SimpleAttributeEditor/useAttributeValuePermissions.js +1 -1
  75. package/SimpleDropDownSelector/SimpleDropDownSelector.test.js +86 -10
  76. package/SimpleDropDownSelector/components/DropDownPlaceholder/DropDownPlaceholder.js +1 -1
  77. package/SimpleDropDownSelector/components/DropDownValue/DropDownValue.js +1 -1
  78. package/SimpleMatchRulesBlock/SimpleMatchRulesBlock.test.js +128 -32
  79. package/SmallIconButton/SmallIconButton.test.js +98 -25
  80. package/TableWithBars/TableWithBars.test.js +98 -60
  81. package/TableWithBars/components/AttributeCellRenderer/AttributeCellRenderer.js +1 -1
  82. package/TableWithBars/components/HeadCellRenderer/HeadCellRenderer.js +1 -1
  83. package/Tags/Tags.d.ts +0 -1
  84. package/Tags/Tags.test.js +8 -7
  85. package/TransitiveMatchBlock/TransitiveMatchBlock.test.js +78 -22
  86. package/TransitiveMatchRule/TransitiveMatchRule.test.js +78 -37
  87. package/TransitiveMatchRulesTooltip/TransitiveMatchRulesTooltip.js +1 -1
  88. package/TransitiveMatchRulesTooltip/TransitiveMatchRulesTooltip.test.js +12 -18
  89. package/UploadFileButton/UploadFileButton.d.ts +2 -2
  90. package/UploadFileButton/UploadFileButton.test.js +199 -0
  91. package/UploadImageDialog/UploadImageDialog.test.js +1 -0
  92. package/UploadImageDialog/components/DividerWithText/DividerWithText.js +1 -1
  93. package/UploadImageDialog/components/ErrorSnackbar/ErrorSnackbar.test.js +80 -22
  94. package/UploadImageDialog/components/ImageByUrlField/ImageByUrlField.js +1 -1
  95. package/UploadImageDialog/components/ImageByUrlField/ImageByUrlField.test.js +162 -49
  96. package/ValueChip/ValueChip.test.js +7 -23
  97. package/VirtualGroupedList/VirtualGroupedList.d.ts +19 -31
  98. package/VirtualGroupedList/VirtualGroupedList.js +11 -36
  99. package/VirtualGroupedList/VirtualGroupedList.test.js +224 -0
  100. package/VirtualGroupedList/helpers.d.ts +7 -2
  101. package/VirtualGroupedList/helpers.js +3 -1
  102. package/VirtualGroupedList/index.d.ts +1 -1
  103. package/VirtualGroupedList/types.d.ts +10 -6
  104. package/VirtualGroupedList/useScrollToFocusItem.d.ts +8 -5
  105. package/WhiteSearchInput/{WhiteSearchInput.spec.js → WhiteSearchInput.test.js} +3 -8
  106. package/cjs/AttributesView/AttributesView.js +2 -2
  107. package/cjs/ColumnsSettings/components/ColumnsSettingsPopup/ColumnsSettingsPopup.d.ts +2 -3
  108. package/cjs/ColumnsSettings/helpers.d.ts +3 -1
  109. package/cjs/ColumnsSettings/types.d.ts +8 -0
  110. package/cjs/ColumnsSettings/types.js +2 -0
  111. package/cjs/CommentsContainer/CommentsContainer.js +1 -1
  112. package/cjs/ConfigureColumnsPopup/ConfigureColumnsPopup.d.ts +23 -40
  113. package/cjs/ConfigureColumnsPopup/ConfigureColumnsPopup.js +6 -26
  114. package/cjs/EditModeAttributesList/EditModeAttributesList.js +2 -2
  115. package/cjs/EditModeAttributesPager/EditModeAttributesPager.test.js +2 -2
  116. package/cjs/EditModeAttributesPager/components/AttributeRenderer/AttributeRenderer.js +2 -2
  117. package/cjs/FacetViewHeader/FacetViewHeader.js +1 -1
  118. package/cjs/ImageAttributesLine/imageAttributeValues.test-data.js +8 -0
  119. package/cjs/ImageAttributesLine/index.d.ts +1 -1
  120. package/cjs/ImageAttributesLine/index.js +2 -1
  121. package/cjs/ImageDetailsView/components/ImageDetailsViewCarousel/ImageDetailsViewCarousel.js +1 -1
  122. package/cjs/MergeButton/MergeButton.spec.js +55 -124
  123. package/cjs/MetadataTypesSelector/MetadataTypesSelector.d.ts +2 -1
  124. package/cjs/MetadataTypesSelector/MetadataTypesSelector.js +1 -1
  125. package/cjs/MetadataTypesSelector/MetadataTypesSelector.test.js +193 -190
  126. package/cjs/MetadataTypesSelector/components/SelectMetadataTypesList/SelectMetadataTypesList.d.ts +5 -6
  127. package/cjs/MoreAttributesButton/MoreAttributesButton.test.js +172 -165
  128. package/cjs/MoreAttributesButton/useMoreAttributesItems.d.ts +1 -1
  129. package/cjs/MultiValueSelector/MultiValueSelector.test.js +78 -38
  130. package/cjs/MultipliableSelect/MultipliableSelect.test.js +111 -47
  131. package/cjs/NestedAttribute/NestedAttribute.test.js +121 -42
  132. package/cjs/NestedAttributeEditor/NestedAttributeEditor.test.js +94 -40
  133. package/cjs/NotMatchButton/NotMatchButton.spec.js +51 -100
  134. package/cjs/PieChart/PieChart.test.js +130 -114
  135. package/cjs/PinButton/PinButton.spec.js +89 -22
  136. package/cjs/PivotingTooltip/PivotingTooltip.test.js +338 -174
  137. package/cjs/PotentialMatchReviewCard/PotentialMatchReviewCard.spec.js +94 -29
  138. package/cjs/ProfileBand/ProfileBand.spec.js +60 -53
  139. package/cjs/ProfileCard/ProfileCard.test.js +109 -27
  140. package/cjs/ProfilesList/ProfilesList.d.ts +1 -3
  141. package/cjs/ProfilesList/ProfilesList.js +1 -1
  142. package/cjs/ProfilesList/ProfilesList.spec.js +226 -211
  143. package/cjs/QueryBuilderRow/QueryBuilderRow.spec.js +83 -90
  144. package/cjs/QueryBuilderRowsGroup/QueryBuilderRowsGroup.spec.js +195 -86
  145. package/cjs/ReactSelectLoadMoreButton/ReactSelectLoadMoreButton.test.js +73 -15
  146. package/cjs/ReactSelectMenuWithPopper/ReactSelectMenuWithPopper.test.js +71 -117
  147. package/cjs/ReadOnlyAttributeValuesBlock/ReadOnlyAttributeValuesBlock.test.js +128 -61
  148. package/cjs/ReadOnlyAttributesFactory/components/ReadOnlyAttribute/ReadOnlyAttribute.test.js +179 -44
  149. package/cjs/ReadOnlyAttributesList/ReadOnlyAttributesList.js +2 -2
  150. package/cjs/ReadOnlyAttributesList/ReadOnlyAttributesList.test.js +254 -211
  151. package/cjs/ReadOnlyAttributesList/attributes.test-data.js +4 -4
  152. package/cjs/ReadOnlyAttributesPager/ReadOnlyAttributesPager.js +2 -2
  153. package/cjs/ReadOnlyAttributesPager/ReadOnlyAttributesPager.test.js +75 -18
  154. package/cjs/ReadOnlyAttributesView/ReadOnlyAttributesView.js +2 -2
  155. package/cjs/ReadOnlyAttributesView/ReadOnlyAttributesView.test.js +185 -310
  156. package/cjs/ReadOnlyComplexAttribute/ReadOnlyComplexAttribute.test.js +209 -218
  157. package/cjs/ReadOnlyImageAttributesLine/ReadOnlyImageAttributesLine.test.js +89 -89
  158. package/cjs/ReferenceAttributeEditor/ReferenceAttributeEditor.test.js +555 -601
  159. package/cjs/ReferenceAttributeEditor/metadata.test-data.d.ts +13 -13
  160. package/cjs/ReferenceAttributeEditor/metadata.test-data.js +2 -2
  161. package/cjs/ReferenceAttributeEditor/styles.d.ts +1 -1
  162. package/cjs/RelationEditor/RelationEditor.test.js +1446 -1390
  163. package/cjs/RelationTypeSelector/RelationTypeSelector.test.js +99 -17
  164. package/cjs/RelationTypesSelector/RelationTypesSelector.test.js +73 -22
  165. package/cjs/ReltioMap/ReltioMap.spec.js +51 -25
  166. package/cjs/Roles/Roles.test.js +54 -10
  167. package/cjs/ScreenProfileBand/ScreenProfileBand.test.js +141 -71
  168. package/cjs/ScrollableTabs/ScrollableTabs.test.js +69 -19
  169. package/cjs/SearchHighlighter/SearchHighlighter.test.js +18 -7
  170. package/cjs/SelectAttributesList/SelectAttributesList.d.ts +11 -6
  171. package/cjs/SelectAttributesList/SelectAttributesList.js +5 -2
  172. package/cjs/SelectorWithOnlyOptionAutoSelect/SelectorWithOnlyOptionAutoSelect.test.js +109 -60
  173. package/cjs/SidePanelContentHeader/SidePanelContentHeader.js +2 -2
  174. package/cjs/SidePanelContentHeader/SidePanelContentHeader.test.js +109 -0
  175. package/cjs/SidePanelEmptyState/SidePanelEmptyState.js +1 -1
  176. package/cjs/SidePanelEmptyState/SidePanelEmptyState.test.js +29 -0
  177. package/cjs/SimpleAttribute/SimpleAttribute.js +1 -1
  178. package/cjs/SimpleAttribute/SimpleAttribute.test.js +155 -80
  179. package/cjs/SimpleAttributeEditor/SimpleAttributeEditor.test.js +338 -352
  180. package/cjs/SimpleAttributeEditor/useAttributeValuePermissions.js +2 -2
  181. package/cjs/SimpleDropDownSelector/SimpleDropDownSelector.test.js +86 -10
  182. package/cjs/SimpleDropDownSelector/components/DropDownPlaceholder/DropDownPlaceholder.js +1 -1
  183. package/cjs/SimpleDropDownSelector/components/DropDownValue/DropDownValue.js +1 -1
  184. package/cjs/SimpleMatchRulesBlock/SimpleMatchRulesBlock.test.js +127 -31
  185. package/cjs/SmallIconButton/SmallIconButton.test.js +98 -25
  186. package/cjs/TableWithBars/TableWithBars.test.js +98 -60
  187. package/cjs/TableWithBars/components/AttributeCellRenderer/AttributeCellRenderer.js +1 -1
  188. package/cjs/TableWithBars/components/HeadCellRenderer/HeadCellRenderer.js +1 -1
  189. package/cjs/Tags/Tags.d.ts +0 -1
  190. package/cjs/Tags/Tags.test.js +8 -7
  191. package/cjs/TransitiveMatchBlock/TransitiveMatchBlock.test.js +77 -21
  192. package/cjs/TransitiveMatchRule/TransitiveMatchRule.test.js +78 -37
  193. package/cjs/TransitiveMatchRulesTooltip/TransitiveMatchRulesTooltip.js +1 -1
  194. package/cjs/TransitiveMatchRulesTooltip/TransitiveMatchRulesTooltip.test.js +12 -18
  195. package/cjs/UploadFileButton/UploadFileButton.d.ts +2 -2
  196. package/cjs/UploadFileButton/UploadFileButton.test.js +204 -0
  197. package/cjs/UploadImageDialog/UploadImageDialog.test.js +1 -0
  198. package/cjs/UploadImageDialog/components/DividerWithText/DividerWithText.js +1 -1
  199. package/cjs/UploadImageDialog/components/ErrorSnackbar/ErrorSnackbar.test.js +80 -22
  200. package/cjs/UploadImageDialog/components/ImageByUrlField/ImageByUrlField.js +1 -1
  201. package/cjs/UploadImageDialog/components/ImageByUrlField/ImageByUrlField.test.js +162 -49
  202. package/cjs/ValueChip/ValueChip.test.js +7 -23
  203. package/cjs/VirtualGroupedList/VirtualGroupedList.d.ts +19 -31
  204. package/cjs/VirtualGroupedList/VirtualGroupedList.js +11 -36
  205. package/cjs/VirtualGroupedList/VirtualGroupedList.test.js +252 -0
  206. package/cjs/VirtualGroupedList/helpers.d.ts +7 -2
  207. package/cjs/VirtualGroupedList/helpers.js +3 -1
  208. package/cjs/VirtualGroupedList/index.d.ts +1 -1
  209. package/cjs/VirtualGroupedList/types.d.ts +10 -6
  210. package/cjs/VirtualGroupedList/useScrollToFocusItem.d.ts +8 -5
  211. package/cjs/WhiteSearchInput/{WhiteSearchInput.spec.js → WhiteSearchInput.test.js} +3 -8
  212. package/cjs/features/crosswalks/hooks/useAttributeActions.test.js +24 -25
  213. package/cjs/features/crosswalks/hooks/useCrosswalkActions.test.js +10 -11
  214. package/cjs/features/workflow/hooks/useChangeRequest.test.js +5 -6
  215. package/cjs/hooks/useCommentsEntitiesMap/useCommentsEntitiesMap.test.js +8 -9
  216. package/cjs/hooks/useKeyboardNavigation/useKeyboardNavigation.d.ts +9 -13
  217. package/features/crosswalks/hooks/useAttributeActions.test.js +1 -2
  218. package/features/crosswalks/hooks/useCrosswalkActions.test.js +1 -2
  219. package/features/workflow/hooks/useChangeRequest.test.js +1 -2
  220. package/hooks/useCommentsEntitiesMap/useCommentsEntitiesMap.test.js +1 -2
  221. package/hooks/useKeyboardNavigation/useKeyboardNavigation.d.ts +9 -13
  222. package/package.json +1 -1
  223. package/MetadataTypesSelector/components/ListLabel/ListLabel.test.js +0 -24
  224. package/PivotingTooltip/IntegrationPivotingTooltip.test.js +0 -356
  225. package/PivotingTooltip/components/PivotingTooltipContent/PivotingTooltipContent.test.js +0 -201
  226. package/ProfileCard/components/ProfileCardContent/ProfileCardContent.test.js +0 -43
  227. package/QueryBuilderRow/components/ReadOnlyFilter/ReadOnlyFilter.spec.js +0 -31
  228. package/QueryBuilderRow/components/ReadOnlyLogicOperator/ReadOnlyLogicOperator.spec.js +0 -31
  229. package/ReadOnlyAttributesPager/components/ImageLineRenderer/ImageLineRenderer.test.js +0 -45
  230. package/ReadOnlyAttributesPager/components/MultiLineRenderer/MultiLineRenderer.test.js +0 -114
  231. package/ReadOnlyAttributesPager/components/OneLineRenderer/OneLineRenderer.test.js +0 -107
  232. package/ReadOnlyAttributesPager/components/SpecialRenderer/SpecialRenderer.test.js +0 -72
  233. package/RelationEditor/IntegrationRelationEditor.test.js +0 -337
  234. package/ReltioMap/components/MapControlContainer/MapControlContainer.d.ts +0 -10
  235. package/ReltioMap/components/MapControlContainer/MapControlContainer.js +0 -24
  236. package/ReltioMap/components/MapControlContainer/MapControlContainer.spec.d.ts +0 -1
  237. package/ReltioMap/components/MapControlContainer/MapControlContainer.spec.js +0 -33
  238. package/ReltioMap/components/MapControlContainer/index.d.ts +0 -1
  239. package/ReltioMap/components/MapControlContainer/index.js +0 -1
  240. package/ReltioMap/components/TopCenterMapControls/TopCenterMapControls.spec.d.ts +0 -1
  241. package/ReltioMap/components/TopCenterMapControls/TopCenterMapControls.spec.js +0 -36
  242. package/ReltioMap/components/TopRightMapControls/TopRightMapControls.spec.d.ts +0 -1
  243. package/ReltioMap/components/TopRightMapControls/TopRightMapControls.spec.js +0 -60
  244. package/Roles/components/Role/Role.test.d.ts +0 -1
  245. package/Roles/components/Role/Role.test.js +0 -55
  246. package/SidePanelContentHeader/SidePanelContentHeader.spec.d.ts +0 -1
  247. package/SidePanelContentHeader/SidePanelContentHeader.spec.js +0 -49
  248. package/SidePanelEmptyState/SidePanelEmptyState.spec.d.ts +0 -1
  249. package/SidePanelEmptyState/SidePanelEmptyState.spec.js +0 -24
  250. package/SimpleAttributeEditor/SimpleAttributeEditorWithoutPermissions.test.d.ts +0 -1
  251. package/SimpleAttributeEditor/SimpleAttributeEditorWithoutPermissions.test.js +0 -103
  252. package/SimpleDropDownSelector/components/DropDownPlaceholder/DropDownPlaceholder.test.d.ts +0 -1
  253. package/SimpleDropDownSelector/components/DropDownPlaceholder/DropDownPlaceholder.test.js +0 -13
  254. package/TableWithBars/components/AttributeCellRenderer/AttributeCellRenderer.test.d.ts +0 -1
  255. package/TableWithBars/components/AttributeCellRenderer/AttributeCellRenderer.test.js +0 -21
  256. package/TableWithBars/components/HeadCellRenderer/HeadCellRenderer.test.d.ts +0 -1
  257. package/TableWithBars/components/HeadCellRenderer/HeadCellRenderer.test.js +0 -20
  258. package/UploadFileButton/UploadFileButton.spec.d.ts +0 -1
  259. package/UploadFileButton/UploadFileButton.spec.js +0 -219
  260. package/UploadImageDialog/components/DividerWithText/DividerWithText.test.d.ts +0 -1
  261. package/UploadImageDialog/components/DividerWithText/DividerWithText.test.js +0 -9
  262. package/VirtualGroupedList/VirtualGroupedList.spec.d.ts +0 -1
  263. package/VirtualGroupedList/VirtualGroupedList.spec.js +0 -282
  264. package/WhiteSearchInput/WhiteSearchInput.spec.d.ts +0 -1
  265. package/cjs/MetadataTypesSelector/components/ListLabel/ListLabel.test.d.ts +0 -1
  266. package/cjs/MetadataTypesSelector/components/ListLabel/ListLabel.test.js +0 -52
  267. package/cjs/PivotingTooltip/IntegrationPivotingTooltip.test.d.ts +0 -1
  268. package/cjs/PivotingTooltip/IntegrationPivotingTooltip.test.js +0 -361
  269. package/cjs/PivotingTooltip/components/PivotingTooltipContent/PivotingTooltipContent.test.d.ts +0 -1
  270. package/cjs/PivotingTooltip/components/PivotingTooltipContent/PivotingTooltipContent.test.js +0 -206
  271. package/cjs/ProfileCard/components/ProfileCardContent/ProfileCardContent.test.d.ts +0 -1
  272. package/cjs/ProfileCard/components/ProfileCardContent/ProfileCardContent.test.js +0 -48
  273. package/cjs/QueryBuilderRow/components/ReadOnlyFilter/ReadOnlyFilter.spec.d.ts +0 -1
  274. package/cjs/QueryBuilderRow/components/ReadOnlyFilter/ReadOnlyFilter.spec.js +0 -36
  275. package/cjs/QueryBuilderRow/components/ReadOnlyLogicOperator/ReadOnlyLogicOperator.spec.d.ts +0 -1
  276. package/cjs/QueryBuilderRow/components/ReadOnlyLogicOperator/ReadOnlyLogicOperator.spec.js +0 -36
  277. package/cjs/ReadOnlyAttributesPager/components/ImageLineRenderer/ImageLineRenderer.test.d.ts +0 -1
  278. package/cjs/ReadOnlyAttributesPager/components/ImageLineRenderer/ImageLineRenderer.test.js +0 -50
  279. package/cjs/ReadOnlyAttributesPager/components/MultiLineRenderer/MultiLineRenderer.test.d.ts +0 -1
  280. package/cjs/ReadOnlyAttributesPager/components/MultiLineRenderer/MultiLineRenderer.test.js +0 -119
  281. package/cjs/ReadOnlyAttributesPager/components/OneLineRenderer/OneLineRenderer.test.d.ts +0 -1
  282. package/cjs/ReadOnlyAttributesPager/components/OneLineRenderer/OneLineRenderer.test.js +0 -112
  283. package/cjs/ReadOnlyAttributesPager/components/SpecialRenderer/SpecialRenderer.test.d.ts +0 -1
  284. package/cjs/ReadOnlyAttributesPager/components/SpecialRenderer/SpecialRenderer.test.js +0 -77
  285. package/cjs/RelationEditor/IntegrationRelationEditor.test.d.ts +0 -1
  286. package/cjs/RelationEditor/IntegrationRelationEditor.test.js +0 -342
  287. package/cjs/ReltioMap/components/MapControlContainer/MapControlContainer.d.ts +0 -10
  288. package/cjs/ReltioMap/components/MapControlContainer/MapControlContainer.js +0 -28
  289. package/cjs/ReltioMap/components/MapControlContainer/MapControlContainer.spec.d.ts +0 -1
  290. package/cjs/ReltioMap/components/MapControlContainer/MapControlContainer.spec.js +0 -38
  291. package/cjs/ReltioMap/components/MapControlContainer/index.d.ts +0 -1
  292. package/cjs/ReltioMap/components/MapControlContainer/index.js +0 -5
  293. package/cjs/ReltioMap/components/TopCenterMapControls/TopCenterMapControls.spec.d.ts +0 -1
  294. package/cjs/ReltioMap/components/TopCenterMapControls/TopCenterMapControls.spec.js +0 -41
  295. package/cjs/ReltioMap/components/TopRightMapControls/TopRightMapControls.spec.d.ts +0 -1
  296. package/cjs/ReltioMap/components/TopRightMapControls/TopRightMapControls.spec.js +0 -65
  297. package/cjs/Roles/components/Role/Role.test.d.ts +0 -1
  298. package/cjs/Roles/components/Role/Role.test.js +0 -60
  299. package/cjs/SidePanelContentHeader/SidePanelContentHeader.spec.d.ts +0 -1
  300. package/cjs/SidePanelContentHeader/SidePanelContentHeader.spec.js +0 -54
  301. package/cjs/SidePanelEmptyState/SidePanelEmptyState.spec.d.ts +0 -1
  302. package/cjs/SidePanelEmptyState/SidePanelEmptyState.spec.js +0 -29
  303. package/cjs/SimpleAttributeEditor/SimpleAttributeEditorWithoutPermissions.test.d.ts +0 -1
  304. package/cjs/SimpleAttributeEditor/SimpleAttributeEditorWithoutPermissions.test.js +0 -108
  305. package/cjs/SimpleDropDownSelector/components/DropDownPlaceholder/DropDownPlaceholder.test.d.ts +0 -1
  306. package/cjs/SimpleDropDownSelector/components/DropDownPlaceholder/DropDownPlaceholder.test.js +0 -18
  307. package/cjs/TableWithBars/components/AttributeCellRenderer/AttributeCellRenderer.test.d.ts +0 -1
  308. package/cjs/TableWithBars/components/AttributeCellRenderer/AttributeCellRenderer.test.js +0 -26
  309. package/cjs/TableWithBars/components/HeadCellRenderer/HeadCellRenderer.test.d.ts +0 -1
  310. package/cjs/TableWithBars/components/HeadCellRenderer/HeadCellRenderer.test.js +0 -25
  311. package/cjs/UploadFileButton/UploadFileButton.spec.d.ts +0 -1
  312. package/cjs/UploadFileButton/UploadFileButton.spec.js +0 -224
  313. package/cjs/UploadImageDialog/components/DividerWithText/DividerWithText.test.d.ts +0 -1
  314. package/cjs/UploadImageDialog/components/DividerWithText/DividerWithText.test.js +0 -14
  315. package/cjs/VirtualGroupedList/VirtualGroupedList.spec.d.ts +0 -1
  316. package/cjs/VirtualGroupedList/VirtualGroupedList.spec.js +0 -287
  317. package/cjs/WhiteSearchInput/WhiteSearchInput.spec.d.ts +0 -1
  318. /package/{MetadataTypesSelector/components/ListLabel/ListLabel.test.d.ts → ColumnsSettings/types.js} +0 -0
  319. /package/{PivotingTooltip/IntegrationPivotingTooltip.test.d.ts → SidePanelContentHeader/SidePanelContentHeader.test.d.ts} +0 -0
  320. /package/{PivotingTooltip/components/PivotingTooltipContent/PivotingTooltipContent.test.d.ts → SidePanelEmptyState/SidePanelEmptyState.test.d.ts} +0 -0
  321. /package/{ProfileCard/components/ProfileCardContent/ProfileCardContent.test.d.ts → UploadFileButton/UploadFileButton.test.d.ts} +0 -0
  322. /package/{QueryBuilderRow/components/ReadOnlyFilter/ReadOnlyFilter.spec.d.ts → VirtualGroupedList/VirtualGroupedList.test.d.ts} +0 -0
  323. /package/{QueryBuilderRow/components/ReadOnlyLogicOperator/ReadOnlyLogicOperator.spec.d.ts → WhiteSearchInput/WhiteSearchInput.test.d.ts} +0 -0
  324. /package/{ReadOnlyAttributesPager/components/ImageLineRenderer/ImageLineRenderer.test.d.ts → cjs/SidePanelContentHeader/SidePanelContentHeader.test.d.ts} +0 -0
  325. /package/{ReadOnlyAttributesPager/components/MultiLineRenderer/MultiLineRenderer.test.d.ts → cjs/SidePanelEmptyState/SidePanelEmptyState.test.d.ts} +0 -0
  326. /package/{ReadOnlyAttributesPager/components/OneLineRenderer/OneLineRenderer.test.d.ts → cjs/UploadFileButton/UploadFileButton.test.d.ts} +0 -0
  327. /package/{ReadOnlyAttributesPager/components/SpecialRenderer/SpecialRenderer.test.d.ts → cjs/VirtualGroupedList/VirtualGroupedList.test.d.ts} +0 -0
  328. /package/{RelationEditor/IntegrationRelationEditor.test.d.ts → cjs/WhiteSearchInput/WhiteSearchInput.test.d.ts} +0 -0
  329. /package/cjs/contexts/{AllwaysVisibleAttributesContext → AlwaysVisibleAttributesContext}/index.d.ts +0 -0
  330. /package/cjs/contexts/{AllwaysVisibleAttributesContext → AlwaysVisibleAttributesContext}/index.js +0 -0
  331. /package/contexts/{AllwaysVisibleAttributesContext → AlwaysVisibleAttributesContext}/index.d.ts +0 -0
  332. /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 { mount } from 'enzyme';
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 onAddFn = jest.fn();
75
- var onDeleteFn = jest.fn();
76
- var onChangeFn = jest.fn();
77
- var onDeactivateErrorFn = jest.fn();
78
- var scrollToAttributeError = {
79
- ref: React.createRef(),
80
- errorClassName: 'errorClassName',
81
- path: []
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.mockReturnValue(scrollToAttributeError);
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
- describe('String attribute', function () {
98
- var mountComponent = function (_a) {
99
- var _b = _a === void 0 ? {} : _a, access = _b.access, ownError = _b.ownError, additionalControlsRenderer = _b.additionalControlsRenderer, state = _b.state;
100
- var mdmValues = {
101
- dependentLookups: {
102
- editors: {},
103
- structure: {},
104
- initedTypeUris: []
105
- }
106
- };
107
- var data = {
108
- attributeValue: {
109
- value: 'some string',
110
- uri: 'entities/eNt1/attributes/InternalCustomer/gd42423'
111
- },
112
- attributeType: {
113
- access: access || ['UPDATE', 'DELETE', 'CREATE', 'READ'],
114
- type: 'String',
115
- uri: 'configuration/entityTypes/HCA/attributes/InternalCustomer'
116
- },
117
- ownError: ownError,
118
- isReltioCrosswalk: true,
119
- mode: Mode.Editing,
120
- onAddOneMore: onAddFn,
121
- onDeleteAttribute: onDeleteFn,
122
- onChangeAttribute: onChangeFn,
123
- onDeactivateError: onDeactivateErrorFn,
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
- var component = mountComponent();
143
- var errorWrapper = component.find(ErrorWrapper);
144
- expect(errorWrapper.find(DataTypeValueEditor).props()).toMatchObject({
145
- fieldName: 'attributes.InternalCustomer',
146
- value: 'some string',
147
- dataTypeDefinition: {
148
- type: 'String',
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
- var AdditionalControls = function () { return React.createElement("div", null); };
165
- var component = mountComponent({
166
- additionalControlsRenderer: function (_a) {
167
- var attributeValue = _a.attributeValue, attributeType = _a.attributeType;
168
- return (React.createElement(AdditionalControls, { attributeValue: attributeValue, attributeType: attributeType }));
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
- var actionButtons = findActionButtons(component);
172
- expect(actionButtons.length).toBe(3);
173
- expect(actionButtons.at(1).prop('attributeValue').uri).toBe('entities/eNt1/attributes/InternalCustomer/gd42423');
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
- var component = mountComponent({ ownError: ownError });
185
- var errorWrapper = component.find(ErrorWrapper);
186
- expect(errorWrapper.find(DataTypeValueEditor).prop('value')).toEqual('some string');
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 component = mountComponent({ access: ['UPDATE', 'CREATE', 'READ'] });
191
- expect(component.find(DataTypeValueEditor).prop('value')).toEqual('some string');
192
- var actionButtons = findActionButtons(component);
193
- expect(actionButtons.length).toBe(1);
194
- actionButtons.at(0).find('button').simulate('click');
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 component = mountComponent({ access: ['UPDATE', 'DELETE', 'READ'] });
199
- expect(component.find(DataTypeValueEditor).prop('value')).toEqual('some string');
200
- var actionButtons = findActionButtons(component);
201
- expect(actionButtons.length).toBe(1);
202
- actionButtons.at(0).find('button').simulate('click');
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 component = mountComponent();
214
- var editor = component.find(DataTypeValueEditor);
215
- editor.prop('onChange')('new string');
216
- expect(onChangeFn).toHaveBeenCalledWith({
217
- attributeType: {
218
- access: ['UPDATE', 'DELETE', 'CREATE', 'READ'],
219
- type: 'String',
220
- uri: 'configuration/entityTypes/HCA/attributes/InternalCustomer'
221
- },
222
- uri: 'entities/eNt1/attributes/InternalCustomer/gd42423',
223
- value: 'new string'
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
- expect(onDeactivateErrorFn).not.toHaveBeenCalled();
226
- });
227
- it('should deactivate error when input value changes', function () {
228
- var ownError = {
229
- uri: 'entities/eNt1/attributes/InternalCustomer/gd42423',
230
- parentUri: 'entities/eNt1',
231
- attributeTypeUri: 'configuration/entityTypes/HCA/attributes/InternalCustomer',
232
- message: 'Error!!!',
233
- type: 'invalid'
234
- };
235
- var component = mountComponent({ ownError: ownError });
236
- var editor = component.find(DataTypeValueEditor);
237
- editor.prop('onChange')('new string');
238
- expect(onChangeFn).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
- value: 'new string'
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
- expect(onDeactivateErrorFn).toHaveBeenCalledWith('configuration/entityTypes/HCA/attributes/InternalCustomer-entities/eNt1/attributes/InternalCustomer/gd42423-entities/eNt1');
248
- });
249
- it('should call onDeleteAttribute after click on delete button', function () {
250
- var component = mountComponent();
251
- var actionButtons = findActionButtons(component);
252
- expect(actionButtons.length).toBe(2);
253
- actionButtons.at(1).find('button').simulate('click');
254
- expect(onDeleteFn).toHaveBeenCalledWith({
255
- attributeType: {
256
- access: ['UPDATE', 'DELETE', 'CREATE', 'READ'],
257
- type: 'String',
258
- uri: 'configuration/entityTypes/HCA/attributes/InternalCustomer'
259
- },
260
- uri: 'entities/eNt1/attributes/InternalCustomer/gd42423'
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
- expect(onDeactivateErrorFn).not.toHaveBeenCalled();
263
- });
264
- it('should deactivate "invalid" error after click on delete button', function () {
265
- var 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
- var component = mountComponent({ ownError: ownError });
273
- var actionButtons = findActionButtons(component);
274
- expect(actionButtons.length).toBe(2);
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
- expect(onDeactivateErrorFn).toHaveBeenCalledWith('configuration/entityTypes/HCA/attributes/InternalCustomer-entities/eNt1/attributes/InternalCustomer/gd42423-entities/eNt1');
285
- });
286
- it('should not deactivate "missed" error after click on delete button', function () {
287
- var ownError = {
288
- uri: '',
289
- parentUri: 'entities/eNt1',
290
- attributeTypeUri: 'configuration/entityTypes/HCA/attributes/InternalCustomer',
291
- message: 'Error!!!',
292
- type: 'missed'
293
- };
294
- var component = mountComponent({ ownError: ownError });
295
- var actionButtons = findActionButtons(component);
296
- expect(actionButtons.length).toBe(2);
297
- actionButtons.at(1).find('button').simulate('click');
298
- expect(onDeleteFn).toHaveBeenCalledWith({
299
- attributeType: {
300
- access: ['UPDATE', 'DELETE', 'CREATE', 'READ'],
301
- type: 'String',
302
- uri: 'configuration/entityTypes/HCA/attributes/InternalCustomer'
303
- },
304
- uri: 'entities/eNt1/attributes/InternalCustomer/gd42423'
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
- expect(onDeactivateErrorFn).not.toHaveBeenCalled();
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
- var component = mountComponent();
310
- expect(component.find('WithAsyncMount').exists()).toBe(true);
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
- var component = mountComponent({ state: 'deleted' });
315
- expect(component.find(DataTypeValueEditor).prop('disabled')).toBe(true);
316
- expect(component.find('.editor-value').hasClass('deleted')).toBe(true);
317
- expect(findActionButtons(component).length).toBe(1);
318
- expect(component.find('.editor-actions').text()).toBe('');
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
- var component = mountComponent({ state: 'edited' });
322
- expect(component.find(DataTypeValueEditor).prop('disabled')).toBeFalsy();
323
- expect(component.find('.editor-value').hasClass('deleted')).toBeFalsy();
324
- expect(findActionButtons(component).length).toBe(3);
325
- expect(component.find('.editor-actions').text()).toBe('(edited)');
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
- jest.spyOn(useAutopopulationContextValueExport, 'useAutopopulationContextValue').mockReturnValue({
332
- autopopulationContextValue: null
333
- });
344
+ useAutopopulationContextValue.mockReturnValue({ autopopulationContextValue: null });
334
345
  });
335
- var defaultProps = {
336
- attributeValue: {
337
- value: 'some string',
338
- uri: 'entities/eNt1/attributes/InternalCustomer/gd42423'
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: return [4 /*yield*/, setUp()];
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, defaultProps.attributeType);
384
- expect(useAutopopulationContextValueExport.useAutopopulationContextValue).toHaveBeenCalledWith({
359
+ expect(useMdmDependentLookupEditorContext).toHaveBeenCalledWith(defaultProps.attributeValue, attributeType);
360
+ expect(useAutopopulationContextValue).toHaveBeenCalledWith({
385
361
  enabled: true,
386
- attributeTypeUri: defaultProps.attributeType.uri,
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: return [4 /*yield*/, setUp({}, { isProfilePerspective: false })];
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(useAutopopulationContextValueExport.useAutopopulationContextValue).toHaveBeenCalledWith({
377
+ expect(useAutopopulationContextValue).toHaveBeenCalledWith({
400
378
  enabled: false,
401
- attributeTypeUri: defaultProps.attributeType.uri,
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
- return [4 /*yield*/, setUp()];
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: defaultProps.attributeType.dependentLookupCode
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
- jest.spyOn(useAutopopulationContextValueExport, 'useAutopopulationContextValue').mockReturnValue({
455
- autopopulationContextValue: autopopulationContextValue
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
- user = (_a.sent()).user;
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
- var component = setUp(fullError);
509
- expect(component.find('SimpleAttributeEditor').prop('highlightedError')).toBe(null);
510
- expect(useScrollToAttributeError.mock.calls[0][0]).toMatchObject({
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 component = setUp(error);
518
- var highlightedError = {
519
- element: error,
520
- highlightError: highlightErrorSpy,
521
- scrollIntoRef: scrollIntoRefSpy,
522
- type: ScrollType.Error
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
- expect(component.find('SimpleAttributeEditor').prop('highlightedError')).toMatchObject(highlightedError);
525
- expect(useScrollToAttributeError.mock.calls[0][0]).toMatchObject({ highlightedError: highlightedError, isSimple: true });
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
  });