@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
@@ -9,256 +9,247 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
13
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14
+ return new (P || (P = Promise))(function (resolve, reject) {
15
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
16
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
17
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
18
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
19
+ });
20
+ };
21
+ var __generator = (this && this.__generator) || function (thisArg, body) {
22
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
23
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
24
+ function verb(n) { return function (v) { return step([n, v]); }; }
25
+ function step(op) {
26
+ if (f) throw new TypeError("Generator is already executing.");
27
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
28
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
29
+ if (y = 0, t) op = [op[0] & 2, t.value];
30
+ switch (op[0]) {
31
+ case 0: case 1: t = op; break;
32
+ case 4: _.label++; return { value: op[1], done: false };
33
+ case 5: _.label++; y = op[1]; op = [0]; continue;
34
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
35
+ default:
36
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
37
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
38
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
39
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
40
+ if (t[2]) _.ops.pop();
41
+ _.trys.pop(); continue;
42
+ }
43
+ op = body.call(thisArg, _);
44
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
45
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
46
+ }
47
+ };
12
48
  import React from 'react';
13
- import { shallow, mount } from 'enzyme';
14
- import { act } from 'react-dom/test-utils';
15
- import { CollaborationObjectTypes, CrosswalksAttrTypes } from '@reltio/mdm-sdk';
16
- import Typography from '@mui/material/Typography';
49
+ import { render, screen } from '@testing-library/react';
50
+ import userEvent from '@testing-library/user-event';
51
+ import { CrosswalksAttrTypes } from '@reltio/mdm-sdk';
17
52
  import { ReadOnlyComplexAttribute } from './ReadOnlyComplexAttribute';
18
- import { ReadOnlyAttributesList } from '../ReadOnlyAttributesList';
19
- import { ArrowExpandButton } from '../ArrowExpandButton';
20
53
  import { nestedAttributeType } from './nestedAttrType.test-data';
21
54
  import { nestedAttributeValue } from './nestedAttrValue.test-data';
22
- import { COMMENTS_CONTAINER_VISIBILITY_AREA } from '../constants/classnames';
23
- import { CommentsContainer } from '../CommentsContainer';
24
55
  import { HighlightedValuesContext } from '../contexts/HighlightedValuesContext';
25
- describe('ReadOnlyComplexAttribute', function () {
26
- var findExpandButton = function (component) { return component.find(ArrowExpandButton); };
27
- var findLabel = function (component) { return component.find(Typography); };
28
- var defaultProps = {
29
- label: 'ComplexAttribute Label',
30
- attributeType: nestedAttributeType,
31
- attributeValue: nestedAttributeValue,
32
- attributeTypesList: nestedAttributeType.attributes
56
+ import { CollaborationContext } from '../contexts/CollaborationContext';
57
+ var collaboration = { commentsMap: {} };
58
+ var defaultHighlightedValues = {
59
+ highlightedValuesUris: [],
60
+ highlightedClassName: ''
61
+ };
62
+ var defaultProps = {
63
+ label: 'Complex attribute label',
64
+ attributeType: nestedAttributeType,
65
+ attributeValue: nestedAttributeValue,
66
+ attributeTypesList: nestedAttributeType.attributes
67
+ };
68
+ var setUp = function (_a) {
69
+ var _b = _a === void 0 ? {} : _a, _c = _b.props, props = _c === void 0 ? defaultProps : _c, _d = _b.highlightedValues, highlightedValues = _d === void 0 ? defaultHighlightedValues : _d;
70
+ var user = userEvent.setup();
71
+ var Providers = function (_a) {
72
+ var children = _a.children;
73
+ return (React.createElement(HighlightedValuesContext.Provider, { value: highlightedValues },
74
+ React.createElement(CollaborationContext.Provider, { value: collaboration }, children)));
33
75
  };
76
+ return __assign(__assign({}, render(React.createElement(ReadOnlyComplexAttribute, __assign({}, props)), { wrapper: Providers })), { user: user });
77
+ };
78
+ describe('read only complex attribute tests', function () {
34
79
  afterEach(function () {
35
80
  jest.clearAllMocks();
36
81
  });
37
82
  it('should render expand button and label', function () {
38
- var component = shallow(React.createElement(ReadOnlyComplexAttribute, __assign({}, defaultProps)));
39
- expect(findExpandButton(component).length).toBe(1);
40
- var label = findLabel(component);
41
- expect(label.length).toBe(1);
42
- expect(label.text()).toBe(defaultProps.label);
43
- expect(component.find(ReadOnlyAttributesList).length).toBe(0);
83
+ setUp();
84
+ screen.getByText('Complex attribute label');
85
+ screen.getByTestId('arrow-expand-button');
44
86
  });
45
87
  it('should render highlighted label', function () {
46
- var highlightedValuesContextValues = {
88
+ var highlightedValues = {
47
89
  highlightedValuesUris: ['relations/sIeHttl/attributes/AdditionalAttributes/2zoXFFwDl'],
48
- highlightedClassName: 'hlClassName'
90
+ highlightedClassName: 'highlightedClassName'
49
91
  };
50
- var component = mount(React.createElement(HighlightedValuesContext.Provider, { value: highlightedValuesContextValues },
51
- React.createElement(ReadOnlyComplexAttribute, __assign({}, defaultProps))));
52
- var label = findLabel(component);
53
- expect(label.hasClass('hlClassName')).toBeTruthy();
92
+ setUp({ highlightedValues: highlightedValues });
93
+ expect(screen.getByText('Complex attribute label')).toHaveClass('highlightedClassName');
54
94
  });
55
- it('should render label without highlights if HighlightedValuesContext.Provider.highlightedValuesContextValues contains subattributes', function () {
56
- var highlightedValuesContextValues = {
95
+ it('should render label without highlights if highlighted values contains subattributes', function () {
96
+ var highlightedValues = {
57
97
  highlightedValuesUris: [
58
98
  'relations/sIeHttl/attributes/AdditionalAttributes/2zoXFFwDl/SubNested/gdggfgfgdf/SubSubNested/1'
59
99
  ],
60
- highlightedClassName: 'hlClassName'
100
+ highlightedClassName: 'highlightedClassName'
61
101
  };
62
- var component = mount(React.createElement(HighlightedValuesContext.Provider, { value: highlightedValuesContextValues },
63
- React.createElement(ReadOnlyComplexAttribute, __assign({}, defaultProps))));
64
- var label = findLabel(component);
65
- expect(label.hasClass('hlClassName')).toBeFalsy();
102
+ setUp({ highlightedValues: highlightedValues });
103
+ expect(screen.getByText('Complex attribute label')).not.toHaveClass('highlightedClassName');
66
104
  });
67
105
  it('should render label without highlights', function () {
68
- var highlightedValuesContextValues = {
106
+ var highlightedValues = {
69
107
  highlightedValuesUris: ['relations/sIeHttl/attributes/AdditionalAttributes/2zoXFFwD'],
70
- highlightedClassName: 'hlClassName'
108
+ highlightedClassName: 'highlightedClassName'
71
109
  };
72
- var component = mount(React.createElement(HighlightedValuesContext.Provider, { value: highlightedValuesContextValues },
73
- React.createElement(ReadOnlyComplexAttribute, __assign({}, defaultProps))));
74
- var label = findLabel(component);
75
- expect(label.hasClass('hlClassName')).toBeFalsy();
110
+ setUp({ highlightedValues: highlightedValues });
111
+ expect(screen.getByText('Complex attribute label')).not.toHaveClass('highlightedClassName');
76
112
  });
77
- it('should render ReadOnlyAttributesList after click on expand button', function () {
78
- var props = __assign({}, defaultProps);
79
- var children = React.createElement("span", null, "children");
80
- var component = shallow(React.createElement(ReadOnlyComplexAttribute, __assign({}, props), children));
81
- expect(component.find(ReadOnlyAttributesList).length).toBe(0);
82
- findExpandButton(component).prop('onClick')();
83
- var attributesList = component.find(ReadOnlyAttributesList);
84
- expect(attributesList.length).toBe(1);
85
- expect(attributesList.prop('children')).toBe(children);
86
- });
87
- it('should set correct props for ReadOnlyAttributesList', function () {
88
- var component = shallow(React.createElement(ReadOnlyComplexAttribute, __assign({}, defaultProps)));
89
- findExpandButton(component).prop('onClick')();
90
- var attributesList = component.find(ReadOnlyAttributesList);
91
- expect(attributesList.length).toBe(1);
92
- expect(attributesList.props()).toMatchObject({
93
- parentUri: defaultProps.attributeValue.uri,
94
- drawLines: true,
95
- attrTypes: defaultProps.attributeType.attributes,
96
- entity: {
97
- attributes: defaultProps.attributeValue.value
113
+ it('should render read only attributes list after click on expand button', function () { return __awaiter(void 0, void 0, void 0, function () {
114
+ var user, getLastExpandButton;
115
+ return __generator(this, function (_a) {
116
+ switch (_a.label) {
117
+ case 0:
118
+ user = setUp().user;
119
+ getLastExpandButton = function () {
120
+ var buttons = screen.getAllByTestId('arrow-expand-button');
121
+ return buttons[buttons.length - 1];
122
+ };
123
+ screen.getByText('Complex attribute label');
124
+ return [4 /*yield*/, user.click(getLastExpandButton())];
125
+ case 1:
126
+ _a.sent();
127
+ screen.getByText('Sub Nested');
128
+ screen.getByText('SubNested 1 Label');
129
+ return [4 /*yield*/, user.click(getLastExpandButton())];
130
+ case 2:
131
+ _a.sent();
132
+ screen.getByText('Sub Sub Nested');
133
+ screen.getByText('SubSubNested 1 Label');
134
+ return [4 /*yield*/, user.click(getLastExpandButton())];
135
+ case 3:
136
+ _a.sent();
137
+ screen.getByText('Attribute Value');
138
+ screen.getByText('12321');
139
+ return [2 /*return*/];
98
140
  }
99
141
  });
100
- });
101
- it('should set "entity" prop of ReadOnlyAttributesList correctly for special attributes', function () {
102
- var props = {
103
- label: 'Crosswalks',
104
- attributeType: {
105
- uri: 'crosswalks',
106
- type: 'Nested',
107
- attributes: Object.values(CrosswalksAttrTypes)
108
- },
109
- attributeValue: {
110
- uri: '1',
111
- value: {
112
- value: 'value',
113
- count: 5,
114
- reltioLoadDate: 123456775
115
- }
116
- },
117
- attributeTypesList: Object.values(CrosswalksAttrTypes)
118
- };
119
- var component = shallow(React.createElement(ReadOnlyComplexAttribute, __assign({}, props)));
120
- findExpandButton(component).prop('onClick')();
121
- var attributesList = component.find(ReadOnlyAttributesList);
122
- expect(attributesList.length).toBe(1);
123
- expect(attributesList.props()).toMatchObject({
124
- parentUri: props.attributeValue.uri,
125
- drawLines: true,
126
- attrTypes: props.attributeType.attributes,
127
- entity: __assign({ attributes: props.attributeValue.value }, props.attributeValue.value)
128
- });
129
- });
130
- var expandSubNesteds = function (component) {
131
- act(function () {
132
- findExpandButton(component).prop('onClick')();
133
- });
134
- component.update();
135
- var complexes = component.find(ReadOnlyComplexAttribute);
136
- expect(complexes.length).toBe(2);
137
- var subComplex = complexes.at(1);
138
- act(function () {
139
- findExpandButton(subComplex).prop('onClick')();
140
- });
141
- component.update();
142
- complexes = component.find(ReadOnlyComplexAttribute);
143
- expect(complexes.length).toBe(3);
144
- var subSubComplex = complexes.at(2);
145
- act(function () {
146
- findExpandButton(subSubComplex).prop('onClick')();
142
+ }); });
143
+ it('should render special attributes correctly', function () { return __awaiter(void 0, void 0, void 0, function () {
144
+ var props, user, specialRenderers;
145
+ return __generator(this, function (_a) {
146
+ switch (_a.label) {
147
+ case 0:
148
+ props = {
149
+ label: 'Crosswalks',
150
+ attributeType: {
151
+ uri: 'crosswalks',
152
+ type: 'Nested',
153
+ name: 'crosswalks',
154
+ attributes: Object.values(CrosswalksAttrTypes)
155
+ },
156
+ attributeValue: {
157
+ uri: '1',
158
+ value: {
159
+ value: 'value',
160
+ count: 5,
161
+ reltioLoadDate: 123456775
162
+ }
163
+ },
164
+ attributeTypesList: Object.values(CrosswalksAttrTypes)
165
+ };
166
+ user = setUp({ props: props }).user;
167
+ return [4 /*yield*/, user.click(screen.getByTestId('arrow-expand-button'))];
168
+ case 1:
169
+ _a.sent();
170
+ specialRenderers = screen.getAllByTestId('special-renderer');
171
+ expect(specialRenderers).toHaveLength(3);
172
+ expect(specialRenderers[0]).toHaveTextContent('ID Value');
173
+ expect(specialRenderers[0]).toHaveTextContent('value');
174
+ expect(specialRenderers[1]).toHaveTextContent('Crosswalk Count');
175
+ expect(specialRenderers[1]).toHaveTextContent('5');
176
+ expect(specialRenderers[2]).toHaveTextContent('Reltio Load Date');
177
+ expect(specialRenderers[2]).toHaveTextContent('01/02/1970 10:17:36 AM');
178
+ return [2 /*return*/];
179
+ }
147
180
  });
148
- component.update();
149
- };
150
- it('should render deep nested attributes', function () {
151
- var component = mount(React.createElement(ReadOnlyComplexAttribute, __assign({}, defaultProps)));
152
- expect(component.find(ReadOnlyComplexAttribute).length).toBe(1);
153
- expandSubNesteds(component);
154
- expect(component.find(ReadOnlyComplexAttribute).length).toBe(3);
155
- var deepComplex = component.find(ReadOnlyComplexAttribute).at(2);
156
- expect(deepComplex.prop('attributeValue')).toBe(defaultProps.attributeValue.value.SubNested[0].value.SubSubNested[0]);
157
- expect(deepComplex.prop('attributeTypesList')).toBe(defaultProps.attributeType.attributes[0].attributes[0].attributes);
158
- });
159
- it('should render analytics attributes correctly', function () {
160
- var nestedAnalyticsAttributeType = {
161
- label: 'Nested',
162
- name: 'Nested',
163
- type: 'Nested',
164
- uri: 'configuration/entityTypes/Type/analyticsAttributes/Nested',
165
- analyticsAttributes: [
166
- {
167
- label: 'String',
168
- name: 'String',
169
- type: 'String',
170
- uri: 'configuration/entityTypes/Type/analyticsAttributes/Nested/analyticsAttributes/String'
171
- }
172
- ]
173
- };
174
- var nestedAttributeValue = {
175
- label: 'Nested Label',
176
- value: {
177
- String: [
178
- {
179
- type: 'configuration/entityTypes/Type/analyticsAttributes/Nested/analyticsAttributes/String',
181
+ }); });
182
+ it('should render analytics attributes correctly', function () { return __awaiter(void 0, void 0, void 0, function () {
183
+ var attributeType, attributeValue, props, user;
184
+ return __generator(this, function (_a) {
185
+ switch (_a.label) {
186
+ case 0:
187
+ attributeType = {
188
+ label: 'Nested',
189
+ name: 'Nested',
190
+ type: 'Nested',
191
+ uri: 'configuration/entityTypes/Type/analyticsAttributes/Nested',
192
+ analyticsAttributes: [
193
+ {
194
+ label: 'String',
195
+ name: 'String',
196
+ type: 'String',
197
+ uri: 'configuration/entityTypes/Type/analyticsAttributes/Nested/analyticsAttributes/String'
198
+ }
199
+ ]
200
+ };
201
+ attributeValue = {
202
+ label: 'Nested Label',
203
+ value: {
204
+ String: [
205
+ {
206
+ type: 'configuration/entityTypes/Type/analyticsAttributes/Nested/analyticsAttributes/String',
207
+ ov: true,
208
+ value: '12321',
209
+ uri: 'entities/sIeHttl/attributes/Nested/2zoXFFwDl/String/gdggfgfgdf'
210
+ }
211
+ ]
212
+ },
180
213
  ov: true,
181
- value: '12321',
182
- uri: 'entities/sIeHttl/attributes/Nested/2zoXFFwDl/String/gdggfgfgdf'
183
- }
184
- ]
185
- },
186
- ov: true,
187
- uri: 'entities/sIeHttl/attributes/Nested/2zoXFFwDl'
188
- };
189
- var component = mount(React.createElement(ReadOnlyComplexAttribute, { label: "test", attributeType: nestedAnalyticsAttributeType, attributeValue: nestedAttributeValue, attributeTypesList: nestedAnalyticsAttributeType.analyticsAttributes }));
190
- expect(component.find(ReadOnlyComplexAttribute).length).toBe(1);
191
- act(function () {
192
- findExpandButton(component).prop('onClick')();
193
- });
194
- component.update();
195
- var complex = component.find(ReadOnlyComplexAttribute);
196
- var attributesList = complex.find(ReadOnlyAttributesList);
197
- expect(attributesList.prop('entity')).toEqual({
198
- analyticsAttributes: nestedAttributeValue.value,
199
- attributes: null
200
- });
201
- expect(attributesList.prop('attrTypes')).toBe(nestedAnalyticsAttributeType.analyticsAttributes);
202
- });
203
- it('should render CommentsContainer inside COMMENTS_CONTAINER_VISIBILITY_AREA with correct uri', function () {
204
- var component = shallow(React.createElement(ReadOnlyComplexAttribute, __assign({}, defaultProps)));
205
- var commentsContainer = component
206
- .find(".labelContainer.".concat(COMMENTS_CONTAINER_VISIBILITY_AREA))
207
- .find(CommentsContainer);
208
- expect(commentsContainer.length).toBe(1);
209
- expect(commentsContainer.prop('uri')).toBe(nestedAttributeValue.uri);
210
- expect(commentsContainer.prop('relatedObjectUris')).toEqual(['relations/sIeHttl']);
211
- expect(commentsContainer.prop('objectType')).toBe(CollaborationObjectTypes.RELATION_ATTRIBUTE);
212
- component.setProps({
213
- attributeValue: __assign(__assign({}, nestedAttributeValue), { uri: 'entities/123/attributes/Reference/r123/AdditionalAttributes/2zoXFFwDl' })
214
+ uri: 'entities/sIeHttl/attributes/Nested/2zoXFFwDl'
215
+ };
216
+ props = {
217
+ label: 'test',
218
+ attributeType: attributeType,
219
+ attributeValue: attributeValue,
220
+ attributeTypesList: attributeType.analyticsAttributes
221
+ };
222
+ user = setUp({ props: props }).user;
223
+ return [4 /*yield*/, user.click(screen.getByTestId('arrow-expand-button'))];
224
+ case 1:
225
+ _a.sent();
226
+ screen.getByText('test');
227
+ screen.getByText('String');
228
+ screen.getByText('12321');
229
+ return [2 /*return*/];
230
+ }
214
231
  });
215
- commentsContainer = component.find(CommentsContainer);
216
- expect(commentsContainer.prop('relatedObjectUris')).toEqual(['entities/123']);
217
- expect(commentsContainer.prop('objectType')).toBe(CollaborationObjectTypes.ENTITY_ATTRIBUTE);
232
+ }); });
233
+ it('should render custom label instead of label and comments container if "LabelRenderer" prop is defined', function () {
234
+ var props = __assign(__assign({}, defaultProps), { LabelRenderer: function () { return React.createElement("div", null, "Custom label"); } });
235
+ setUp({ props: props });
236
+ screen.getByText('Custom label');
237
+ expect(screen.queryByText('Complex attribute label')).not.toBeInTheDocument();
218
238
  });
219
- it('should render LabelRenderer instead of label and CommentsContainer if "LabelRenderer" prop is defined', function () {
220
- var LabelRenderer = function () { return React.createElement("span", null); };
221
- var component = shallow(React.createElement(ReadOnlyComplexAttribute, __assign({}, defaultProps, { LabelRenderer: LabelRenderer })));
222
- expect(findExpandButton(component).length).toBe(1);
223
- expect(findLabel(component).length).toBe(0);
224
- expect(component.find(CommentsContainer).length).toBe(0);
225
- var labelRenderer = component.find(LabelRenderer);
226
- expect(labelRenderer.length).toBe(1);
227
- expect(labelRenderer.prop('attributeType')).toBe(defaultProps.attributeType);
228
- expect(labelRenderer.prop('attributeValue')).toBe(defaultProps.attributeValue);
229
- });
230
- it('should render RightSlot if "RightSlot" prop is defined', function () {
231
- var RightSlot = function () { return React.createElement("span", null); };
232
- var component = shallow(React.createElement(ReadOnlyComplexAttribute, __assign({}, defaultProps, { RightSlot: RightSlot })));
233
- expect(findExpandButton(component).length).toBe(1);
234
- expect(findLabel(component).length).toBe(1);
235
- expect(component.find(CommentsContainer).length).toBe(1);
236
- var rightSlot = component.find(RightSlot);
237
- expect(rightSlot.length).toBe(1);
238
- expect(rightSlot.prop('attributeType')).toBe(defaultProps.attributeType);
239
- expect(rightSlot.prop('attributeValue')).toBe(defaultProps.attributeValue);
240
- });
241
- it('should set correct props for CommentsContainer component if we have entity attribute', function () {
242
- var attributeType = {
243
- uri: 'configuration/entityTypes/HCA/attributes/ContactPreference',
244
- type: 'Nested',
245
- name: 'ContactPreference',
246
- label: 'Contact Preference'
247
- };
248
- var attributeValue = {
249
- uri: 'entities/1Gw3QsjR/attributes/Affiliations/pdVWCxm/ContactPreference/14wY5z5Nr',
250
- value: {},
251
- ov: true
252
- };
253
- var props = __assign(__assign({}, defaultProps), { attributeType: attributeType, attributeValue: attributeValue });
254
- var component = shallow(React.createElement(ReadOnlyComplexAttribute, __assign({}, props)));
255
- var commentsContainer = component.find(CommentsContainer);
256
- expect(commentsContainer.prop('relatedObjectUris')).toEqual(['entities/1Gw3QsjR']);
257
- expect(commentsContainer.prop('objectType')).toBe(CollaborationObjectTypes.ENTITY_ATTRIBUTE);
239
+ it('should render right slot if "RightSlot" prop is defined', function () {
240
+ var props = __assign(__assign({}, defaultProps), { RightSlot: function () { return React.createElement("div", null, "Right slot"); } });
241
+ setUp({ props: props });
242
+ screen.getByText('Complex attribute label');
243
+ screen.getByText('Right slot');
258
244
  });
259
245
  it('should add ovFalse style for attribute', function () {
260
- var component = shallow(React.createElement(ReadOnlyComplexAttribute, __assign({}, defaultProps, { attributeValue: __assign(__assign({}, nestedAttributeValue), { ov: false }) })));
261
- var label = findLabel(component);
262
- expect(label.hasClass('ovFalse')).toBe(true);
246
+ var attributeValue = __assign(__assign({}, nestedAttributeValue), { ov: false });
247
+ var props = __assign(__assign({}, defaultProps), { attributeValue: attributeValue });
248
+ setUp({ props: props });
249
+ expect(screen.getByText('Complex attribute label')).toHaveClass('ovFalse');
250
+ });
251
+ it('should render comments container', function () {
252
+ setUp();
253
+ screen.getByLabelText('Add comment');
263
254
  });
264
255
  });