@axinom/mosaic-ui 0.69.0-rc.2 → 0.69.0-rc.21

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 (326) hide show
  1. package/dist/components/Buttons/Button/Button.d.ts +3 -3
  2. package/dist/components/Buttons/Button/Button.d.ts.map +1 -1
  3. package/dist/components/Buttons/Button.model.d.ts +2 -1
  4. package/dist/components/Buttons/Button.model.d.ts.map +1 -1
  5. package/dist/components/ConfirmDialog/ConfirmDialog.d.ts.map +1 -1
  6. package/dist/components/ConfirmDialog/ConfirmDialog.models.d.ts +0 -1
  7. package/dist/components/ConfirmDialog/ConfirmDialog.models.d.ts.map +1 -1
  8. package/dist/components/DateTime/TimePicker/ScrollColumn/ScrollColumn.d.ts +2 -2
  9. package/dist/components/DateTime/TimePicker/ScrollColumn/ScrollColumn.d.ts.map +1 -1
  10. package/dist/components/DynamicDataList/DynamicDataList.d.ts +1 -1
  11. package/dist/components/DynamicDataList/DynamicDataList.d.ts.map +1 -1
  12. package/dist/components/DynamicDataList/DynamicDataList.model.d.ts +0 -1
  13. package/dist/components/DynamicDataList/DynamicDataList.model.d.ts.map +1 -1
  14. package/dist/components/DynamicDataList/DynamicListDataEntry/DynamicListDataEntry.d.ts +2 -2
  15. package/dist/components/DynamicDataList/DynamicListDataEntry/DynamicListDataEntry.d.ts.map +1 -1
  16. package/dist/components/DynamicDataList/DynamicListDataEntry/Renderers/createInputRenderer/createInputRenderer.d.ts +1 -1
  17. package/dist/components/DynamicDataList/DynamicListDataEntry/Renderers/createInputRenderer/createInputRenderer.d.ts.map +1 -1
  18. package/dist/components/DynamicDataList/DynamicListDataEntry/Renderers/createSelectRenderer/createSelectRenderer.d.ts +1 -1
  19. package/dist/components/DynamicDataList/DynamicListDataEntry/Renderers/createSelectRenderer/createSelectRenderer.d.ts.map +1 -1
  20. package/dist/components/DynamicDataList/DynamicListDataEntry/Renderers/renderers.model.d.ts +2 -0
  21. package/dist/components/DynamicDataList/DynamicListDataEntry/Renderers/renderers.model.d.ts.map +1 -1
  22. package/dist/components/DynamicDataList/DynamicListHeader/DynamicListHeader.d.ts +2 -2
  23. package/dist/components/DynamicDataList/DynamicListHeader/DynamicListHeader.d.ts.map +1 -1
  24. package/dist/components/DynamicDataList/DynamicListRow/DynamicListRow.d.ts +2 -2
  25. package/dist/components/DynamicDataList/DynamicListRow/DynamicListRow.d.ts.map +1 -1
  26. package/dist/components/DynamicDataList/helpers/DynamicListReducer/DynamicListReducer.actions.d.ts +2 -2
  27. package/dist/components/DynamicDataList/helpers/DynamicListReducer/DynamicListReducer.actions.d.ts.map +1 -1
  28. package/dist/components/DynamicDataList/helpers/DynamicListReducer/DynamicListReducer.d.ts.map +1 -1
  29. package/dist/components/DynamicDataList/helpers/DynamicListReducer/DynamicListReducer.init.d.ts.map +1 -1
  30. package/dist/components/DynamicDataList/helpers/useColumnDefs.d.ts +1 -1
  31. package/dist/components/DynamicDataList/helpers/useColumnDefs.d.ts.map +1 -1
  32. package/dist/components/DynamicDataList/helpers/useDataHandler.d.ts +1 -1
  33. package/dist/components/DynamicDataList/helpers/useDataHandler.d.ts.map +1 -1
  34. package/dist/components/DynamicDataList/helpers/useRowAnimation.d.ts.map +1 -1
  35. package/dist/components/DynamicDataList/helpers/useRowEditing.d.ts.map +1 -1
  36. package/dist/components/EmptyStation/EmptyStation.d.ts.map +1 -1
  37. package/dist/components/Explorer/BulkEdit/FormFieldsConfigConverter.d.ts.map +1 -1
  38. package/dist/components/Explorer/BulkEdit/GenerateMutation.d.ts.map +1 -1
  39. package/dist/components/Explorer/BulkEdit/helpers/FieldWrapper.d.ts.map +1 -1
  40. package/dist/components/Explorer/BulkEdit/useBulkEdit.d.ts.map +1 -1
  41. package/dist/components/Explorer/Explorer.d.ts +1 -1
  42. package/dist/components/Explorer/Explorer.d.ts.map +1 -1
  43. package/dist/components/Explorer/Explorer.model.d.ts +0 -1
  44. package/dist/components/Explorer/Explorer.model.d.ts.map +1 -1
  45. package/dist/components/Explorer/NavigationExplorer/NavigationExplorer.d.ts +1 -1
  46. package/dist/components/Explorer/NavigationExplorer/NavigationExplorer.d.ts.map +1 -1
  47. package/dist/components/Explorer/QuickEdit/useQuickEdit.d.ts.map +1 -1
  48. package/dist/components/Explorer/SelectionExplorer/SelectionExplorer.d.ts +1 -1
  49. package/dist/components/Explorer/SelectionExplorer/SelectionExplorer.d.ts.map +1 -1
  50. package/dist/components/Explorer/helpers/useActions.d.ts +0 -1
  51. package/dist/components/Explorer/helpers/useActions.d.ts.map +1 -1
  52. package/dist/components/Explorer/helpers/useDataProvider.d.ts +0 -1
  53. package/dist/components/Explorer/helpers/useDataProvider.d.ts.map +1 -1
  54. package/dist/components/Explorer/helpers/useFilters.d.ts +0 -1
  55. package/dist/components/Explorer/helpers/useFilters.d.ts.map +1 -1
  56. package/dist/components/FieldSelection/FieldSelection.d.ts +1 -0
  57. package/dist/components/FieldSelection/FieldSelection.d.ts.map +1 -1
  58. package/dist/components/Filters/Filter/Filter.d.ts +2 -2
  59. package/dist/components/Filters/Filter/Filter.d.ts.map +1 -1
  60. package/dist/components/Filters/Filters.d.ts +2 -2
  61. package/dist/components/Filters/Filters.d.ts.map +1 -1
  62. package/dist/components/Filters/Filters.model.d.ts +0 -1
  63. package/dist/components/Filters/Filters.model.d.ts.map +1 -1
  64. package/dist/components/Filters/Validators/DateRangeFilterValidator.d.ts.map +1 -1
  65. package/dist/components/Filters/Validators/NumberRangeFilterValidator.d.ts.map +1 -1
  66. package/dist/components/FormElements/DynamicDataListControl/DynamicDataListControl.d.ts +0 -1
  67. package/dist/components/FormElements/DynamicDataListControl/DynamicDataListControl.d.ts.map +1 -1
  68. package/dist/components/FormElements/DynamicDataListControl/DynamicDataListField.d.ts +2 -2
  69. package/dist/components/FormElements/DynamicDataListControl/DynamicDataListField.d.ts.map +1 -1
  70. package/dist/components/FormElements/FormGroup/FormGroup.d.ts +12 -0
  71. package/dist/components/FormElements/FormGroup/FormGroup.d.ts.map +1 -0
  72. package/dist/components/FormElements/FormGroupTitle/FormGroupTitle.d.ts +5 -0
  73. package/dist/components/FormElements/FormGroupTitle/FormGroupTitle.d.ts.map +1 -1
  74. package/dist/components/FormElements/FormikDebug/FormikDebug.d.ts +0 -1
  75. package/dist/components/FormElements/FormikDebug/FormikDebug.d.ts.map +1 -1
  76. package/dist/components/FormElements/ReadOnly/ReadOnlyField.d.ts +2 -2
  77. package/dist/components/FormElements/ReadOnly/ReadOnlyField.d.ts.map +1 -1
  78. package/dist/components/FormElements/ReadOnlyText/ReadOnlyTextField.d.ts +2 -2
  79. package/dist/components/FormElements/ReadOnlyText/ReadOnlyTextField.d.ts.map +1 -1
  80. package/dist/components/FormElements/Tags/Tags.d.ts +2 -2
  81. package/dist/components/FormElements/Tags/Tags.d.ts.map +1 -1
  82. package/dist/components/FormElements/Tags/TagsField.d.ts +2 -2
  83. package/dist/components/FormElements/Tags/TagsField.d.ts.map +1 -1
  84. package/dist/components/FormElements/formStoryHelper.d.ts.map +1 -1
  85. package/dist/components/FormElements/index.d.ts +1 -0
  86. package/dist/components/FormElements/index.d.ts.map +1 -1
  87. package/dist/components/FormElements/useFormikError.d.ts.map +1 -1
  88. package/dist/components/FormStation/Create/Create.d.ts +2 -2
  89. package/dist/components/FormStation/Create/Create.d.ts.map +1 -1
  90. package/dist/components/FormStation/Details/Details.d.ts +2 -2
  91. package/dist/components/FormStation/Details/Details.d.ts.map +1 -1
  92. package/dist/components/FormStation/FormStation.d.ts +2 -2
  93. package/dist/components/FormStation/FormStation.d.ts.map +1 -1
  94. package/dist/components/FormStation/FormStationActions/FormStationActions.d.ts +1 -1
  95. package/dist/components/FormStation/FormStationActions/FormStationActions.d.ts.map +1 -1
  96. package/dist/components/FormStation/FormStationHeader/FormStationHeader.d.ts.map +1 -1
  97. package/dist/components/FormStation/SaveOnDemand/SaveOnDemand.d.ts +0 -1
  98. package/dist/components/FormStation/SaveOnDemand/SaveOnDemand.d.ts.map +1 -1
  99. package/dist/components/FormStation/SaveOnNavigate/handleNavigationAttempt.d.ts.map +1 -1
  100. package/dist/components/FormStation/helpers/useTitle.d.ts.map +1 -1
  101. package/dist/components/InfoPanel/hooks/useCollapse.d.ts +0 -1
  102. package/dist/components/InfoPanel/hooks/useCollapse.d.ts.map +1 -1
  103. package/dist/components/InlineMenu/InlineMenu.d.ts.map +1 -1
  104. package/dist/components/List/List.d.ts +2 -2
  105. package/dist/components/List/List.d.ts.map +1 -1
  106. package/dist/components/List/List.model.d.ts +0 -1
  107. package/dist/components/List/List.model.d.ts.map +1 -1
  108. package/dist/components/List/List.stories.helper.d.ts.map +1 -1
  109. package/dist/components/List/ListHeader/ColumnLabel/ColumnLabel.d.ts +2 -2
  110. package/dist/components/List/ListHeader/ColumnLabel/ColumnLabel.d.ts.map +1 -1
  111. package/dist/components/List/ListHeader/ListHeader.d.ts +2 -2
  112. package/dist/components/List/ListHeader/ListHeader.d.ts.map +1 -1
  113. package/dist/components/List/ListRow/ListRow.d.ts +2 -4
  114. package/dist/components/List/ListRow/ListRow.d.ts.map +1 -1
  115. package/dist/components/List/ListRow/ListRowCell/ListRowCell.d.ts +0 -1
  116. package/dist/components/List/ListRow/ListRowCell/ListRowCell.d.ts.map +1 -1
  117. package/dist/components/List/ListRow/ListRowCell/renderData.d.ts.map +1 -1
  118. package/dist/components/List/ListRow/ListRowLoader.d.ts +2 -2
  119. package/dist/components/List/ListRow/ListRowLoader.d.ts.map +1 -1
  120. package/dist/components/List/ListRow/Renderers/BooleanDotRenderer/BooleanDotRenderer.d.ts +0 -1
  121. package/dist/components/List/ListRow/Renderers/BooleanDotRenderer/BooleanDotRenderer.d.ts.map +1 -1
  122. package/dist/components/List/ListRow/Renderers/DateRenderer/DateRenderer.d.ts.map +1 -1
  123. package/dist/components/List/ListRow/Renderers/ExternalLinkRenderer/ExternalLinkRenderer.d.ts.map +1 -1
  124. package/dist/components/List/ListRow/Renderers/StateRenderer/StateRenderer.d.ts +1 -1
  125. package/dist/components/List/ListRow/Renderers/StateRenderer/StateRenderer.d.ts.map +1 -1
  126. package/dist/components/List/ListRow/Renderers/TagsRenderer/TagsRenderer.d.ts +0 -1
  127. package/dist/components/List/ListRow/Renderers/TagsRenderer/TagsRenderer.d.ts.map +1 -1
  128. package/dist/components/List/ListRow/Renderers/TimestampRenderer/TimestampRenderer.d.ts.map +1 -1
  129. package/dist/components/List/ListRowRenderer/ListRowRenderer.d.ts.map +1 -1
  130. package/dist/components/List/helpers.d.ts.map +1 -1
  131. package/dist/components/List/useColumnsSize.d.ts +0 -2
  132. package/dist/components/List/useColumnsSize.d.ts.map +1 -1
  133. package/dist/components/Loaders/skeletons.d.ts +0 -1
  134. package/dist/components/Loaders/skeletons.d.ts.map +1 -1
  135. package/dist/components/Modal/useModal.d.ts.map +1 -1
  136. package/dist/components/PageHeader/PageHeaderActionsGroup/PageHeaderActionsGroupsContext.d.ts +0 -1
  137. package/dist/components/PageHeader/PageHeaderActionsGroup/PageHeaderActionsGroupsContext.d.ts.map +1 -1
  138. package/dist/components/PageHeader/helpers/useElementWidthObserver.d.ts +1 -2
  139. package/dist/components/PageHeader/helpers/useElementWidthObserver.d.ts.map +1 -1
  140. package/dist/components/Tabs/TabList/ScrollContainer/useScroll.d.ts.map +1 -1
  141. package/dist/components/Utils/Postgraphile/FilterTransformer.d.ts.map +1 -1
  142. package/dist/components/Utils/Postgraphile/SortTransformer.d.ts.map +1 -1
  143. package/dist/components/Utils/State/GlobalState.d.ts.map +1 -1
  144. package/dist/helpers/idleCallbackHelpers.d.ts +0 -1
  145. package/dist/helpers/idleCallbackHelpers.d.ts.map +1 -1
  146. package/dist/helpers/storybook.d.ts.map +1 -1
  147. package/dist/helpers/testing.d.ts +6 -21
  148. package/dist/helpers/testing.d.ts.map +1 -1
  149. package/dist/helpers/utils.d.ts +1 -2
  150. package/dist/helpers/utils.d.ts.map +1 -1
  151. package/dist/hooks/useDEBUGDetectChanges/useDEBUGDetectChanges.d.ts.map +1 -1
  152. package/dist/hooks/useDEBUGRenderCount/useDEBUGRenderCount.d.ts.map +1 -1
  153. package/dist/hooks/useDebounce/useDebounce.d.ts +1 -2
  154. package/dist/hooks/useDebounce/useDebounce.d.ts.map +1 -1
  155. package/dist/hooks/useExpand/useExpand.d.ts.map +1 -1
  156. package/dist/hooks/useReactRouterPause/utils.d.ts.map +1 -1
  157. package/dist/hooks/useResize/useResize.d.ts +0 -1
  158. package/dist/hooks/useResize/useResize.d.ts.map +1 -1
  159. package/dist/hooks/useTabTitle/useTabTitle.d.ts.map +1 -1
  160. package/dist/hooks/useValueOrOnDemand/useValueOrOnDemand.d.ts +1 -1
  161. package/dist/hooks/useValueOrOnDemand/useValueOrOnDemand.d.ts.map +1 -1
  162. package/dist/index.es.js +4 -4
  163. package/dist/index.es.js.map +1 -1
  164. package/dist/index.js +4 -4
  165. package/dist/index.js.map +1 -1
  166. package/dist/utils/ErrorMapper/ErrorMapper.d.ts.map +1 -1
  167. package/dist/utils/ErrorTypeToStationError.d.ts.map +1 -1
  168. package/dist/utils/ToolTipHelpers.d.ts.map +1 -1
  169. package/dist/validators/timestamp/timestamp.d.ts.map +1 -1
  170. package/package.json +11 -10
  171. package/src/components/Accordion/Accordion.spec.tsx +1 -1
  172. package/src/components/Accordion/AccordionItem/AccordionItem.spec.tsx +2 -2
  173. package/src/components/Actions/Action/Action.spec.tsx +189 -228
  174. package/src/components/Actions/Actions.spec.tsx +42 -32
  175. package/src/components/Buttons/Button/Button.spec.tsx +110 -115
  176. package/src/components/Buttons/Button/Button.tsx +4 -0
  177. package/src/components/Buttons/Button.model.ts +2 -0
  178. package/src/components/Buttons/CompositeButton/CompositeButton.spec.tsx +122 -121
  179. package/src/components/Buttons/TextButton/TextButton.spec.tsx +85 -90
  180. package/src/components/ConfirmDialog/ConfirmDialog.spec.tsx +75 -79
  181. package/src/components/DateTime/DatePicker/DatePicker.spec.tsx +8 -7
  182. package/src/components/DateTime/DateTimePicker.spec.tsx +43 -62
  183. package/src/components/DateTime/TimePicker/ScrollColumn/ScrollColumn.spec.tsx +19 -16
  184. package/src/components/DateTime/TimePicker/TimePicker.spec.tsx +44 -73
  185. package/src/components/DynamicDataList/DynamicDataList.spec.tsx +112 -107
  186. package/src/components/DynamicDataList/DynamicListDataEntry/DynamicListDataEntry.spec.tsx +91 -144
  187. package/src/components/DynamicDataList/DynamicListDataEntry/DynamicListDataEntry.tsx +38 -20
  188. package/src/components/DynamicDataList/DynamicListDataEntry/Renderers/createInputRenderer/createInputRenderer.spec.tsx +18 -15
  189. package/src/components/DynamicDataList/DynamicListDataEntry/Renderers/createInputRenderer/createInputRenderer.tsx +2 -0
  190. package/src/components/DynamicDataList/DynamicListDataEntry/Renderers/createSelectRenderer/createSelectRenderer.spec.tsx +53 -28
  191. package/src/components/DynamicDataList/DynamicListDataEntry/Renderers/createSelectRenderer/createSelectRenderer.tsx +2 -0
  192. package/src/components/DynamicDataList/DynamicListDataEntry/Renderers/renderers.model.ts +2 -0
  193. package/src/components/DynamicDataList/DynamicListHeader/DynamicListHeader.scss +19 -5
  194. package/src/components/DynamicDataList/DynamicListHeader/DynamicListHeader.spec.tsx +72 -76
  195. package/src/components/DynamicDataList/DynamicListRow/DynamicListRow.scss +9 -2
  196. package/src/components/DynamicDataList/DynamicListRow/DynamicListRow.spec.tsx +86 -113
  197. package/src/components/DynamicDataList/helpers/DynamicListReducer/DynamicListReducer.actions.spec.ts +1 -0
  198. package/src/components/DynamicDataList/helpers/DynamicListReducer/DynamicListReducer.init.spec.ts +1 -0
  199. package/src/components/DynamicDataList/helpers/DynamicListReducer/DynamicListReducer.spec.ts +6 -5
  200. package/src/components/EmptyStation/EmptyStation.spec.tsx +41 -37
  201. package/src/components/Explorer/BulkEdit/FormFieldsConfigConverter.spec.tsx +29 -28
  202. package/src/components/Explorer/BulkEdit/FormFieldsConfigConverter.tsx +1 -0
  203. package/src/components/Explorer/BulkEdit/GenerateMutation.spec.tsx +1 -0
  204. package/src/components/Explorer/BulkEdit/helpers/FieldWrapper.scss +1 -0
  205. package/src/components/Explorer/BulkEdit/helpers/FieldWrapper.tsx +1 -0
  206. package/src/components/Explorer/Explorer.spec.tsx +513 -825
  207. package/src/components/Explorer/NavigationExplorer/NavigationExplorer.spec.tsx +90 -131
  208. package/src/components/Explorer/QuickEdit/useQuickEdit.spec.tsx +36 -56
  209. package/src/components/Explorer/SelectionExplorer/SelectionExplorer.spec.tsx +59 -65
  210. package/src/components/Explorer/helpers/InMemoryDataProvider.spec.ts +1 -0
  211. package/src/components/Explorer/helpers/useFilters.spec.tsx +13 -11
  212. package/src/components/Explorer/helpers/useStationMessage.spec.tsx +4 -3
  213. package/src/components/Explorer/helpers/useSubtitle.spec.tsx +1 -0
  214. package/src/components/FieldSelection/FieldSelection.scss +1 -1
  215. package/src/components/FieldSelection/FieldSelection.spec.tsx +1 -1
  216. package/src/components/FieldSelection/FieldSelection.tsx +6 -2
  217. package/src/components/Filters/Filter/Filter.spec.tsx +78 -47
  218. package/src/components/Filters/Filters.spec.tsx +56 -58
  219. package/src/components/Filters/SelectionTypes/DateTimeFilter/DateTimeFilter.spec.tsx +45 -46
  220. package/src/components/Filters/SelectionTypes/FreeTextFilter/FreeTextFilter.spec.tsx +23 -23
  221. package/src/components/Filters/SelectionTypes/NumericTextFilter/NumericTextFilter.spec.tsx +37 -28
  222. package/src/components/Filters/SelectionTypes/OptionsFilter/OptionsFilter.spec.tsx +14 -12
  223. package/src/components/Filters/Validators/DateRangeFilterValidator.spec.ts +1 -0
  224. package/src/components/Filters/Validators/NumberRangeFilterValidator.spec.ts +1 -0
  225. package/src/components/FormElements/BooleanView/BooleanViewField.spec.tsx +34 -31
  226. package/src/components/FormElements/Checkbox/Checkbox.spec.tsx +129 -128
  227. package/src/components/FormElements/CustomTags/CustomTags.spec.tsx +312 -446
  228. package/src/components/FormElements/DateTimeField/DateTimeText.spec.tsx +61 -52
  229. package/src/components/FormElements/DynamicDataListControl/DynamicDataListControl.spec.tsx +19 -24
  230. package/src/components/FormElements/FileUploadControl/FileUploadControl.spec.tsx +67 -60
  231. package/src/components/FormElements/FormElementContainer/FormElementContainer.spec.tsx +13 -12
  232. package/src/components/FormElements/FormGroup/FormGroup.scss +62 -0
  233. package/src/components/FormElements/FormGroup/FormGroup.stories.tsx +25 -0
  234. package/src/components/FormElements/FormGroup/FormGroup.tsx +60 -0
  235. package/src/components/FormElements/FormGroupTitle/FormGroupTitle.tsx +5 -0
  236. package/src/components/FormElements/Link/LinkField.spec.tsx +24 -23
  237. package/src/components/FormElements/MaskedSingleLineText/MaskedSingleLineText.spec.tsx +4 -3
  238. package/src/components/FormElements/Radio/Radio.spec.tsx +170 -172
  239. package/src/components/FormElements/ReadOnly/ReadOnlyField.spec.tsx +23 -22
  240. package/src/components/FormElements/ReadOnlyText/ReadOnlyTextField.spec.tsx +23 -22
  241. package/src/components/FormElements/Select/Select.spec.tsx +30 -29
  242. package/src/components/FormElements/SingleLineText/SingleLineText.spec.tsx +46 -42
  243. package/src/components/FormElements/Tags/Tags.spec.tsx +59 -53
  244. package/src/components/FormElements/TextArea/TextArea.spec.tsx +44 -29
  245. package/src/components/FormElements/ToggleButton/ToggleButton.spec.tsx +188 -165
  246. package/src/components/FormElements/index.ts +1 -0
  247. package/src/components/FormStation/FormStation.spec.tsx +273 -198
  248. package/src/components/FormStation/FormStation.stories.tsx +15 -13
  249. package/src/components/FormStation/FormStationHeader/FormStationHeader.tsx +5 -3
  250. package/src/components/FormStation/SaveOnNavigate/SaveOnNavigate.spec.tsx +23 -20
  251. package/src/components/FormStation/SaveOnNavigate/handleNavigationAttempt.spec.ts +25 -24
  252. package/src/components/FormStation/helpers/useTitle.spec.ts +9 -7
  253. package/src/components/Hub/Hub.spec.tsx +13 -10
  254. package/src/components/Hub/Tile/Tile.spec.tsx +29 -25
  255. package/src/components/Icons/Icons.spec.tsx +25 -27
  256. package/src/components/Icons/Icons.tsx +1 -1
  257. package/src/components/InfoPanel/InfoImage/InfoImage.spec.tsx +4 -3
  258. package/src/components/InfoPanel/InfoPanel.scss +2 -0
  259. package/src/components/InfoPanel/InfoPanel.spec.tsx +4 -3
  260. package/src/components/InfoPanel/Paragraph/Paragraph.spec.tsx +4 -3
  261. package/src/components/InfoPanel/Section/Section.spec.tsx +39 -46
  262. package/src/components/InfoPanel/hooks/useCollapse.ts +9 -7
  263. package/src/components/InlineMenu/InlineMenu.spec.tsx +24 -23
  264. package/src/components/InlineMenu/InlineMenu.tsx +3 -0
  265. package/src/components/LandingPageHeader/LandingPageHeader.spec.tsx +9 -8
  266. package/src/components/LandingPageTiles/LandingPageTiles.spec.tsx +29 -28
  267. package/src/components/LandingPageTiles/TileLarge/TileLarge.spec.tsx +68 -61
  268. package/src/components/LandingPageTiles/TileSmall/TileSmall.spec.tsx +50 -32
  269. package/src/components/List/List.spec.tsx +337 -241
  270. package/src/components/List/ListCheckBox/ListCheckBox.spec.tsx +54 -48
  271. package/src/components/List/ListHeader/ColumnLabel/ColumnLabel.scss +4 -1
  272. package/src/components/List/ListHeader/ColumnLabel/ColumnLabel.spec.tsx +46 -43
  273. package/src/components/List/ListHeader/ListHeader.spec.tsx +82 -66
  274. package/src/components/List/ListRow/ListRow.spec.tsx +125 -130
  275. package/src/components/List/ListRow/ListRowCell/ListRowCell.spec.tsx +57 -100
  276. package/src/components/List/ListRow/ListRowLoader.spec.tsx +16 -12
  277. package/src/components/List/ListRow/Renderers/BooleanDotRenderer/BooleanDotRenderer.spec.tsx +12 -9
  278. package/src/components/List/ListRow/Renderers/ExternalLinkRenderer/ExternalLinkRenderer.spec.tsx +40 -35
  279. package/src/components/List/ListRow/Renderers/StateRenderer/StateRenderer.spec.tsx +14 -17
  280. package/src/components/List/ListRow/Renderers/TagsRenderer/TagsRenderer.spec.tsx +18 -17
  281. package/src/components/List/ListRow/Renderers/TagsRenderer/TagsRenderer.tsx +2 -2
  282. package/src/components/List/ListRowRenderer/ListRowRenderer.spec.tsx +82 -68
  283. package/src/components/Loaders/ImageLoader/ImageLoader.spec.tsx +88 -96
  284. package/src/components/Loaders/Loader/Loader.spec.tsx +51 -24
  285. package/src/components/Message/Message.spec.tsx +56 -44
  286. package/src/components/MessageBar/MessageBar.scss +3 -0
  287. package/src/components/MessageBar/MessageBar.spec.tsx +88 -85
  288. package/src/components/Modal/Modal.spec.tsx +92 -87
  289. package/src/components/NavigationAwareStation/NavigationAwareStation.spec.tsx +23 -22
  290. package/src/components/PageHeader/PageHeader.spec.tsx +22 -21
  291. package/src/components/PageHeader/PageHeaderAction/PageHeaderAction.spec.tsx +275 -193
  292. package/src/components/PageHeader/PageHeaderActionsGroup/PageHeaderActionsGroup.spec.tsx +39 -34
  293. package/src/components/ProgressBar/ProgressBar.spec.tsx +18 -15
  294. package/src/components/Utils/Postgraphile/CreateConnectionRenderer.spec.ts +1 -0
  295. package/src/components/Utils/Postgraphile/FilterTransformer.spec.ts +1 -0
  296. package/src/components/Utils/Postgraphile/RangeTransformer.spec.ts +1 -0
  297. package/src/components/Utils/Postgraphile/SortTransformer.spec.ts +1 -0
  298. package/src/components/Utils/Postgraphile/UpdateGQLFragmentGenerator.spec.ts +1 -0
  299. package/src/components/Utils/Postgraphile/generateArrayMutations.spec.ts +1 -0
  300. package/src/components/Utils/Postgraphile/getArrayDiff.spec.ts +1 -0
  301. package/src/components/Utils/Postgraphile/getFormDiff.spec.ts +1 -0
  302. package/src/components/Utils/State/GlobalState.spec.ts +4 -2
  303. package/src/components/Utils/Transformers/Boolean.spec.ts +1 -0
  304. package/src/components/Utils/Transformers/DateTime.spec.ts +2 -1
  305. package/src/components/Utils/Transformers/FileSize.spec.ts +1 -0
  306. package/src/components/Utils/Transformers/SortArray.spec.ts +1 -0
  307. package/src/components/Utils/Transformers/Timestamp.spec.ts +3 -2
  308. package/src/components/Utils/Transformers/TitleCase.spec.ts +1 -0
  309. package/src/components/VisualElements/ImgElement.spec.tsx +34 -35
  310. package/src/components/VisualElements/SvgElement.spec.tsx +72 -69
  311. package/src/helpers/testing.ts +9 -76
  312. package/src/hooks/useBusy/useBusy.spec.tsx +8 -9
  313. package/src/hooks/useClickOutside/useClickOutside.spec.tsx +19 -51
  314. package/src/hooks/useDebounce/useDebounce.spec.tsx +31 -26
  315. package/src/hooks/useExpand/useExpand.spec.tsx +30 -21
  316. package/src/hooks/useTabTitle/useTabTitle.spec.tsx +18 -18
  317. package/src/hooks/useValueOrOnDemand/useValueOrOnDemand.spec.tsx +31 -52
  318. package/src/styles/variables.scss +3 -1
  319. package/src/utils/ErrorMapper/ApolloClient/ApolloErrorMapper.spec.ts +1 -0
  320. package/src/utils/ErrorMapper/ErrorMapper.spec.ts +1 -0
  321. package/src/utils/ErrorTypeToStationError.spec.tsx +12 -11
  322. package/src/utils/ToolTipHelpers.spec.ts +1 -0
  323. package/src/validators/timestamp/timestamp.spec.ts +1 -0
  324. package/dist/helpers/hooksTestingHelpers.d.ts +0 -7
  325. package/dist/helpers/hooksTestingHelpers.d.ts.map +0 -1
  326. package/src/helpers/hooksTestingHelpers.tsx +0 -22
@@ -1,16 +1,20 @@
1
- import { mount, shallow } from 'enzyme';
1
+ import { fireEvent, render } from '@testing-library/react';
2
2
  import React from 'react';
3
- import { on } from '../../initialize';
3
+ import type { Mock } from 'vitest';
4
+ import { beforeEach, describe, expect, it, vi } from 'vitest';
5
+ import { useBusy } from '../../hooks/useBusy/useBusy';
4
6
  import { IconName } from '../Icons';
5
- import { Action } from './Action/Action';
6
7
  import { Actions } from './Actions';
7
8
  import { ActionData } from './Actions.models';
8
9
 
9
- jest.mock('../../initialize');
10
+ vi.mock('../../initialize');
11
+ vi.mock('../../hooks/useBusy/useBusy', () => ({
12
+ useBusy: vi.fn(() => ({ isBusy: false })),
13
+ }));
10
14
 
11
- const spy1 = jest.fn();
12
- const spy2 = jest.fn();
13
- const spy3 = jest.fn();
15
+ const spy1 = vi.fn();
16
+ const spy2 = vi.fn();
17
+ const spy3 = vi.fn();
14
18
  const mockActions: ActionData[] = [
15
19
  { label: 'action-label', onActionSelected: spy1 },
16
20
  { label: 'action-label', onActionSelected: spy2 },
@@ -18,52 +22,58 @@ const mockActions: ActionData[] = [
18
22
  ];
19
23
 
20
24
  describe('Actions', () => {
25
+ beforeEach(() => {
26
+ vi.clearAllMocks();
27
+ });
28
+
21
29
  it('renders the component without crashing', () => {
22
- const wrapper = shallow(<Actions actions={[]} />);
30
+ const { container } = render(<Actions actions={[]} />);
23
31
 
24
- expect(wrapper).toBeTruthy();
32
+ expect(container).toBeTruthy();
25
33
  });
26
34
 
27
35
  it('renders an Action for each action', () => {
28
- const wrapper = shallow(<Actions actions={mockActions} />);
36
+ const { container } = render(<Actions actions={mockActions} />);
29
37
 
30
- const actions = wrapper.find(Action);
38
+ const actions = container.querySelectorAll('[data-test-id="action"]');
31
39
 
32
40
  expect(actions).toHaveLength(mockActions.length);
33
41
  });
34
42
 
35
43
  it('raises the click event', () => {
36
- const wrapper = mount(<Actions actions={mockActions} />);
44
+ const { container } = render(<Actions actions={mockActions} />);
37
45
 
38
- const action = wrapper.find(Action).first();
46
+ const action = container.querySelector('[data-test-id="action"]');
39
47
 
40
- action.simulate('click');
48
+ if (action) {
49
+ fireEvent.click(action);
50
+ }
41
51
 
42
52
  expect(spy1).toHaveBeenCalledTimes(1);
43
53
  });
44
54
 
45
55
  it('renders Actions with the passed in width prop', () => {
46
56
  const mockWidth = '150px';
47
- const wrapper = shallow(<Actions actions={[]} width={mockWidth} />);
57
+ const { container } = render(<Actions actions={[]} width={mockWidth} />);
48
58
 
49
- const width = wrapper.find('.container');
59
+ const actionsContainer = container.querySelector('.actions-container');
50
60
 
51
- expect(width.prop('style')).toHaveProperty('width', mockWidth);
61
+ expect(actionsContainer).toHaveStyle({ width: mockWidth });
52
62
  });
53
63
 
54
64
  it('displays an empty Actions container if no actions are passed in', () => {
55
- const wrapper = shallow(<Actions actions={[]} />);
65
+ const { container } = render(<Actions actions={[]} />);
56
66
 
57
- const container = wrapper.find('.container');
58
- const actions = wrapper.find(Action);
67
+ const actionsContainer = container.querySelector('.actions-container');
68
+ const actions = container.querySelectorAll('[data-test-id="action"]');
59
69
 
60
- expect(container.exists()).toBe(true);
70
+ expect(actionsContainer).toBeInTheDocument();
61
71
  expect(actions).toHaveLength(0);
62
72
  });
63
73
 
64
74
  it('allows the icon to be changed', () => {
65
75
  const iconProp: IconName = IconName.Delete;
66
- const wrapper = shallow(
76
+ const { container } = render(
67
77
  <Actions
68
78
  actions={[
69
79
  {
@@ -75,24 +85,24 @@ describe('Actions', () => {
75
85
  />,
76
86
  );
77
87
 
78
- const action = wrapper.find(Action);
88
+ const action = container.querySelector('[data-test-id="action"]');
79
89
 
80
- expect(action.prop('action').icon).toBe(iconProp);
90
+ expect(action).toBeInTheDocument();
91
+ // Icon is rendered inside the action
92
+ const icon = action?.querySelector('svg');
93
+ expect(icon).toBeInTheDocument();
81
94
  });
82
95
 
83
96
  it('disables all actions when busy', () => {
84
- (on as jest.Mock).mockImplementationOnce((event, cb) => {
85
- cb(true);
86
- });
87
-
88
- const wrapper = shallow(<Actions actions={mockActions} />);
97
+ (useBusy as Mock).mockImplementation(() => ({ isBusy: true }));
89
98
 
90
- expect(on).toHaveBeenCalledWith('busy', expect.any(Function));
99
+ const { container } = render(<Actions actions={mockActions} />);
91
100
 
92
- const actions = wrapper.find(Action);
101
+ const actions = container.querySelectorAll('[data-test-id="action"]');
93
102
 
94
103
  actions.forEach((action) => {
95
- expect(action.prop('action').isDisabled).toBe(true);
104
+ // When disabled, the action gets the isDisabled class
105
+ expect(action.classList.contains('isDisabled')).toBe(true);
96
106
  });
97
107
  });
98
108
  });
@@ -1,7 +1,8 @@
1
- import { mount } from 'enzyme';
1
+ import { fireEvent, render } from '@testing-library/react';
2
2
  import React from 'react';
3
- import { Link, BrowserRouter as Router } from 'react-router-dom';
4
- import { IconName, Icons } from '../../Icons';
3
+ import { BrowserRouter as Router } from 'react-router-dom';
4
+ import { describe, expect, it, vi } from 'vitest';
5
+ import { IconName } from '../../Icons';
5
6
  import { ButtonContext } from '../Button.model';
6
7
  import { Button } from './Button';
7
8
 
@@ -20,35 +21,36 @@ const CustomIcon: React.FC = () => (
20
21
  describe('Button (with icon)', () => {
21
22
  describe('ContextButtonElement', () => {
22
23
  it('renders the component without crashing', () => {
23
- const wrapper = mount(<Button />);
24
+ const { container } = render(<Button />);
24
25
 
25
- expect(wrapper).toBeTruthy();
26
+ expect(container.querySelector('button')).toBeInTheDocument();
26
27
  });
27
28
 
28
29
  it('raises the onButtonClicked event', () => {
29
- const spy = jest.fn();
30
- const wrapper = mount(<Button onButtonClicked={spy} />);
30
+ const spy = vi.fn();
31
+ const { container } = render(<Button onButtonClicked={spy} />);
31
32
 
32
- wrapper.simulate('click');
33
+ const button = container.querySelector('button')!;
34
+ fireEvent.click(button);
33
35
 
34
36
  expect(spy).toHaveBeenCalledTimes(1);
35
37
  });
36
38
 
37
39
  it('creates a class based off of the className prop', () => {
38
40
  const mockClassName = 'test-class';
39
- const wrapper = mount(<Button className={mockClassName} />);
41
+ const { container } = render(<Button className={mockClassName} />);
40
42
 
41
- const button = wrapper.find('button');
43
+ const button = container.querySelector('button')!;
42
44
 
43
- expect(button.hasClass(mockClassName)).toBe(true);
45
+ expect(button.classList.contains(mockClassName)).toBe(true);
44
46
  });
45
47
 
46
48
  it(`button 'type' must be 'button' by default`, () => {
47
- const wrapper = mount(<Button />);
49
+ const { container } = render(<Button />);
48
50
 
49
- const buttonType = wrapper.find('button').prop('type');
51
+ const button = container.querySelector('button')!;
50
52
 
51
- expect(buttonType).toBe('button');
53
+ expect(button.type).toBe('button');
52
54
  });
53
55
 
54
56
  it('accepts type html attribute and width/height styles', () => {
@@ -56,160 +58,157 @@ describe('Button (with icon)', () => {
56
58
  const mockHeight = '75px';
57
59
  const mockWidth = '80px';
58
60
 
59
- const wrapper = mount(<Button />);
61
+ const { container, rerender } = render(<Button />);
60
62
 
61
- let buttonType = wrapper.find('button').prop('type');
62
- let buttonStyles = wrapper
63
- .find('button')
64
- .prop('style') as React.CSSProperties;
63
+ let button = container.querySelector('button')!;
65
64
 
66
- expect(buttonType).toBe('button');
67
- expect(buttonStyles.height).toBeUndefined();
68
- expect(buttonStyles.width).toBeUndefined();
65
+ expect(button.type).toBe('button');
66
+ expect(button.style.height).toBe('');
67
+ expect(button.style.width).toBe('');
69
68
 
70
- wrapper.setProps({
71
- type: mockType,
72
- height: mockHeight,
73
- width: mockWidth,
74
- });
75
- wrapper.update();
69
+ rerender(
70
+ <Button type={mockType} height={mockHeight} width={mockWidth} />,
71
+ );
76
72
 
77
- buttonType = wrapper.find('button').prop('type');
78
- buttonStyles = wrapper
79
- .find('button')
80
- .prop('style') as React.CSSProperties;
73
+ button = container.querySelector('button')!;
81
74
 
82
- expect(buttonType).toBe(mockType);
83
- expect(buttonStyles.height).toBe(mockHeight);
84
- expect(buttonStyles.width).toBe(mockWidth);
75
+ expect(button.type).toBe(mockType);
76
+ expect(button.style.height).toBe(mockHeight);
77
+ expect(button.style.width).toBe(mockWidth);
85
78
  });
86
79
 
87
80
  it('allows the button to be enabled by default', () => {
88
- const spy = jest.fn();
89
- const wrapper = mount(<Button onButtonClicked={spy} />);
81
+ const spy = vi.fn();
82
+ const { container } = render(<Button onButtonClicked={spy} />);
90
83
 
91
- const button = wrapper.find('button');
84
+ const button = container.querySelector('button')!;
92
85
 
93
- wrapper.simulate('click');
86
+ fireEvent.click(button);
94
87
 
95
- expect(button.prop('disabled')).toBe(false);
88
+ expect(button.disabled).toBe(false);
96
89
  expect(spy).toHaveBeenCalledTimes(1);
97
90
  });
98
91
 
99
92
  it('allows button to be disabled', () => {
100
- const spy = jest.fn();
101
- const wrapper = mount(<Button disabled={true} onButtonClicked={spy} />);
93
+ const spy = vi.fn();
94
+ const { container } = render(
95
+ <Button disabled={true} onButtonClicked={spy} />,
96
+ );
102
97
 
103
- const button = wrapper.find('button');
98
+ const button = container.querySelector('button')!;
104
99
 
105
- wrapper.simulate('click');
100
+ fireEvent.click(button);
106
101
 
107
- expect(button.prop('disabled')).toBe(true);
102
+ expect(button.disabled).toBe(true);
108
103
  expect(spy).not.toHaveBeenCalled();
109
104
  });
110
105
 
111
106
  it('default should have a active class', () => {
112
- const wrapper = mount(<Button />);
107
+ const { container } = render(<Button />);
113
108
 
114
- const button = wrapper.find('button');
109
+ const button = container.querySelector('button')!;
115
110
 
116
- expect(button.hasClass('active')).toBe(true);
111
+ expect(button.classList.contains('active')).toBe(true);
117
112
  });
118
113
 
119
114
  it('context button type should have a context class', () => {
120
- const wrapper = mount(<Button buttonContext={ButtonContext.Context} />);
115
+ const { container } = render(
116
+ <Button buttonContext={ButtonContext.Context} />,
117
+ );
121
118
 
122
- const button = wrapper.find('button');
119
+ const button = container.querySelector('button')!;
123
120
 
124
- expect(button.hasClass('context')).toBe(true);
121
+ expect(button.classList.contains('context')).toBe(true);
125
122
  });
126
123
 
127
124
  it('context button type should have a icon class', () => {
128
- const wrapper = mount(<Button buttonContext={ButtonContext.Icon} />);
125
+ const { container } = render(
126
+ <Button buttonContext={ButtonContext.Icon} />,
127
+ );
129
128
 
130
- const button = wrapper.find('button');
129
+ const button = container.querySelector('button')!;
131
130
 
132
- expect(button.hasClass('icon')).toBe(true);
131
+ expect(button.classList.contains('icon')).toBe(true);
133
132
  });
134
133
 
135
134
  it('active button type should have a active class', () => {
136
- const wrapper = mount(<Button buttonContext={ButtonContext.Active} />);
135
+ const { container } = render(
136
+ <Button buttonContext={ButtonContext.Active} />,
137
+ );
137
138
 
138
- const button = wrapper.find('button');
139
+ const button = container.querySelector('button')!;
139
140
 
140
- expect(button.hasClass('active')).toBe(true);
141
+ expect(button.classList.contains('active')).toBe(true);
141
142
  });
142
143
 
143
144
  it(`renders an icon as it's image from the Icons component`, () => {
144
- const wrapper = mount(<Button icon={IconName.ChevronRight} />);
145
+ const { container } = render(<Button icon={IconName.ChevronRight} />);
145
146
 
146
- const icon = wrapper.find(Icons);
147
+ const icon = container.querySelector('svg');
147
148
 
148
- expect(icon.exists()).toBe(true);
149
+ expect(icon).toBeInTheDocument();
149
150
  });
150
151
 
151
152
  it('renders `customIcon` when provided', () => {
152
- const wrapper = mount(<Button customIcon={<CustomIcon />} />);
153
- const customIcon = wrapper.find(CustomIcon);
153
+ const { container } = render(<Button customIcon={<CustomIcon />} />);
154
+ const customIcon = container.querySelector('svg');
154
155
 
155
- expect(customIcon.exists()).toBe(true);
156
+ expect(customIcon).toBeInTheDocument();
156
157
  });
157
158
 
158
159
  it('renders `customIcon` instead of `icon` when both are provided', () => {
159
- const wrapper = mount(
160
+ const { container } = render(
160
161
  <Button icon={IconName.ChevronRight} customIcon={<CustomIcon />} />,
161
162
  );
162
163
 
163
- const customIcon = wrapper.find(CustomIcon);
164
- const icon = wrapper.find(Icons);
164
+ const svgs = container.querySelectorAll('svg');
165
165
 
166
- expect(customIcon.exists()).toBe(true);
167
- expect(icon.exists()).toBe(false);
166
+ expect(svgs).toHaveLength(1);
168
167
  });
169
168
  });
170
169
 
171
170
  describe('NavigationButtonElement', () => {
172
171
  it('renders the component without crashing', () => {
173
- const wrapper = mount(
172
+ const { container } = render(
174
173
  <Router>
175
174
  <Button {...navigationButtonProps} />
176
175
  </Router>,
177
176
  );
178
177
 
179
- expect(wrapper).toBeTruthy();
178
+ expect(container.querySelector('a')).toBeInTheDocument();
180
179
  });
181
180
 
182
181
  it('creates a class based on the className prop', () => {
183
182
  const mockClassName = 'test-class';
184
- const wrapper = mount(
183
+ const { container } = render(
185
184
  <Router>
186
- <Button {...navigationButtonProps} className={mockClassName} />,
185
+ <Button {...navigationButtonProps} className={mockClassName} />
187
186
  </Router>,
188
187
  );
189
188
 
190
- const link = wrapper.find('Link');
189
+ const link = container.querySelector('a')!;
191
190
 
192
- expect(link.hasClass(mockClassName)).toBe(true);
191
+ expect(link.classList.contains(mockClassName)).toBe(true);
193
192
  });
194
193
 
195
194
  it('renders the correct path in the Link component', () => {
196
195
  const mockPath = '/test';
197
- const wrapper = mount(
196
+ const { container } = render(
198
197
  <Router>
199
198
  <Button path={mockPath} />
200
199
  </Router>,
201
200
  );
202
201
 
203
- const link = wrapper.find('Link');
202
+ const link = container.querySelector('a')!;
204
203
 
205
- expect(link.prop('to')).toBe(mockPath);
204
+ expect(link.getAttribute('href')).toBe(mockPath);
206
205
  });
207
206
 
208
207
  it('accepts width/height styles', () => {
209
208
  const mockHeight = '75px';
210
209
  const mockWidth = '80px';
211
210
 
212
- const wrapper = mount(
211
+ const { container } = render(
213
212
  <Router>
214
213
  <Button
215
214
  {...navigationButtonProps}
@@ -219,125 +218,123 @@ describe('Button (with icon)', () => {
219
218
  </Router>,
220
219
  );
221
220
 
222
- const linkStyles = wrapper
223
- .find('Link')
224
- .prop('style') as React.CSSProperties;
221
+ const link = container.querySelector('a')!;
225
222
 
226
- expect(linkStyles.height).toBe(mockHeight);
227
- expect(linkStyles.width).toBe(mockWidth);
223
+ expect(link.style.height).toBe(mockHeight);
224
+ expect(link.style.width).toBe(mockWidth);
228
225
  });
229
226
 
230
227
  it('allows the button to be enabled by default', () => {
231
- const wrapper = mount(
228
+ const { container } = render(
232
229
  <Router>
233
230
  <Button {...navigationButtonProps} />
234
231
  </Router>,
235
232
  );
236
233
 
237
- const link = wrapper.find('Link');
234
+ const link = container.querySelector('a')!;
238
235
 
239
- expect(link.hasClass('disabled')).toBe(false);
236
+ expect(link.classList.contains('disabled')).toBe(false);
240
237
  });
241
238
 
242
239
  it('allows button to be disabled', () => {
243
- const wrapper = mount(
240
+ const { container } = render(
244
241
  <Router>
245
242
  <Button {...navigationButtonProps} disabled={true} />
246
243
  </Router>,
247
244
  );
248
245
 
249
- const link = wrapper.find('Link');
246
+ const link = container.querySelector('a')!;
250
247
 
251
- expect(link.hasClass('disabled')).toBe(true);
248
+ expect(link.classList.contains('disabled')).toBe(true);
252
249
  });
253
250
 
254
251
  it('renders the correct data-test-id attribute', () => {
255
252
  const mockTestId = 'test-button';
256
- const wrapper = mount(
253
+ const { container } = render(
257
254
  <Router>
258
255
  <Button {...navigationButtonProps} dataTestId={mockTestId} />
259
256
  </Router>,
260
257
  );
261
258
 
262
- const link = wrapper.find('Link');
259
+ const link = container.querySelector('a')!;
263
260
 
264
- expect(link.prop('data-test-id')).toBe(mockTestId);
261
+ expect(link.getAttribute('data-test-id')).toBe(mockTestId);
265
262
  });
266
263
 
267
264
  it('renders the Icons component with the correct default icon', () => {
268
- const wrapper = mount(
265
+ const { container } = render(
269
266
  <Router>
270
267
  <Button {...navigationButtonProps} />
271
268
  </Router>,
272
269
  );
273
270
 
274
- const icons = wrapper.find(Icons);
271
+ const svg = container.querySelector('svg');
275
272
 
276
- expect(icons.prop('icon')).toBe(IconName.ChevronRight);
273
+ expect(svg).toBeInTheDocument();
277
274
  });
278
275
 
279
276
  it('renders the Icons component with the correct default icon when `openInNewTab` is set to `true`', () => {
280
- const wrapper = mount(
277
+ const { container } = render(
281
278
  <Router>
282
279
  <Button {...navigationButtonProps} openInNewTab={true} />
283
280
  </Router>,
284
281
  );
285
282
 
286
- const icons = wrapper.find(Icons);
283
+ const svg = container.querySelector('svg');
287
284
 
288
- expect(icons.prop('icon')).toBe(IconName.External);
285
+ expect(svg).toBeInTheDocument();
289
286
  });
290
287
 
291
288
  it('opens link in new tab when `openInNewTab` is set to `true`', () => {
292
- const wrapper = mount(
289
+ const { container } = render(
293
290
  <Router>
294
291
  <Button {...navigationButtonProps} openInNewTab={true} />
295
292
  </Router>,
296
293
  );
297
294
 
298
- const link = wrapper.find(Link);
295
+ const link = container.querySelector('a')!;
299
296
 
300
- expect(link.prop('target')).toBe('_blank');
297
+ expect(link.getAttribute('target')).toBe('_blank');
301
298
  });
302
299
 
303
300
  it('does not open link in new tab by default', () => {
304
- const wrapper = mount(
301
+ const { container } = render(
305
302
  <Router>
306
303
  <Button {...navigationButtonProps} />
307
304
  </Router>,
308
305
  );
309
306
 
310
- const link = wrapper.find(Link);
307
+ const link = container.querySelector('a')!;
311
308
 
312
- expect(link.prop('target')).toBeUndefined();
309
+ expect(link.getAttribute('target')).toBeNull();
313
310
  });
314
311
 
315
312
  it('renders the Icons component with the correct icon', () => {
316
313
  const mockIcon = IconName.Copy;
317
- const wrapper = mount(
314
+ const { container } = render(
318
315
  <Router>
319
316
  <Button {...navigationButtonProps} icon={mockIcon} />
320
317
  </Router>,
321
318
  );
322
319
 
323
- const icons = wrapper.find(Icons);
320
+ const svg = container.querySelector('svg');
324
321
 
325
- expect(icons.prop('icon')).toBe(mockIcon);
322
+ expect(svg).toBeInTheDocument();
326
323
  });
327
324
 
328
325
  it('renders `customIcon` when provided', () => {
329
- const wrapper = mount(
326
+ const { container } = render(
330
327
  <Router>
331
328
  <Button {...navigationButtonProps} customIcon={<CustomIcon />} />
332
329
  </Router>,
333
330
  );
334
- const customIcon = wrapper.find(CustomIcon);
331
+ const customIcon = container.querySelector('svg');
335
332
 
336
- expect(customIcon.exists()).toBe(true);
333
+ expect(customIcon).toBeInTheDocument();
337
334
  });
338
335
 
339
336
  it('renders `customIcon` instead of `icon` when both are provided', () => {
340
- const wrapper = mount(
337
+ const { container } = render(
341
338
  <Router>
342
339
  <Button
343
340
  {...navigationButtonProps}
@@ -347,11 +344,9 @@ describe('Button (with icon)', () => {
347
344
  </Router>,
348
345
  );
349
346
 
350
- const customIcon = wrapper.find(CustomIcon);
351
- const icon = wrapper.find(Icons);
347
+ const svgs = container.querySelectorAll('svg');
352
348
 
353
- expect(customIcon.exists()).toBe(true);
354
- expect(icon.exists()).toBe(false);
349
+ expect(svgs).toHaveLength(1);
355
350
  });
356
351
  });
357
352
  });
@@ -69,6 +69,7 @@ const ContextButtonElement = React.forwardRef<
69
69
  className = '',
70
70
  customIcon,
71
71
  dataTestId,
72
+ title,
72
73
  onButtonClicked = noop,
73
74
  onBlur,
74
75
  }: ContextButtonProps,
@@ -93,6 +94,7 @@ const ContextButtonElement = React.forwardRef<
93
94
  disabled={disabled}
94
95
  onBlur={onBlur}
95
96
  data-test-id={dataTestId ?? 'button'}
97
+ title={title}
96
98
  >
97
99
  {customIcon ? customIcon : <Icons icon={icon} />}
98
100
  </button>
@@ -113,6 +115,7 @@ const NavigationButtonElement = React.forwardRef<
113
115
  dataTestId = undefined,
114
116
  disabled = false,
115
117
  openInNewTab = false,
118
+ title,
116
119
  }: NavigationButtonProps,
117
120
  ref: ForwardedRef<HTMLAnchorElement>,
118
121
  ) {
@@ -132,6 +135,7 @@ const NavigationButtonElement = React.forwardRef<
132
135
  style={{ height, width }}
133
136
  data-test-id={dataTestId ?? 'button'}
134
137
  target={openInNewTab ? '_blank' : undefined}
138
+ title={title}
135
139
  >
136
140
  {customIcon ? customIcon : <Icons icon={icon ? icon : defaultIcon} />}
137
141
  </Link>
@@ -104,4 +104,6 @@ interface CommonButtonOptions {
104
104
  className?: string;
105
105
  /** Optional data-test-id */
106
106
  dataTestId?: string;
107
+ /** Optional title attribute for the button */
108
+ title?: string;
107
109
  }