@cccsaurora/howler-ui 3.1.0-dev.1655 → 3.1.0-dev.1657

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 (354) hide show
  1. package/api/action/execute.test.d.ts +1 -0
  2. package/api/action/execute.test.js +38 -0
  3. package/api/action/index.test.d.ts +1 -0
  4. package/api/action/index.test.js +59 -0
  5. package/api/action/operations.test.d.ts +1 -0
  6. package/api/action/operations.test.js +23 -0
  7. package/api/analytic/comments/index.test.d.ts +1 -0
  8. package/api/analytic/comments/index.test.js +43 -0
  9. package/api/analytic/comments/react.test.d.ts +1 -0
  10. package/api/analytic/comments/react.test.js +27 -0
  11. package/api/analytic/favourite.test.d.ts +1 -0
  12. package/api/analytic/favourite.test.js +20 -0
  13. package/api/analytic/index.test.d.ts +1 -0
  14. package/api/analytic/index.test.js +54 -0
  15. package/api/analytic/notebooks/index.test.d.ts +1 -0
  16. package/api/analytic/notebooks/index.test.js +31 -0
  17. package/api/analytic/owner.test.d.ts +1 -0
  18. package/api/analytic/owner.test.js +25 -0
  19. package/api/auth/apikey.test.d.ts +1 -0
  20. package/api/auth/apikey.test.js +34 -0
  21. package/api/auth/index.test.d.ts +1 -0
  22. package/api/auth/index.test.js +21 -0
  23. package/api/auth/login.test.d.ts +1 -0
  24. package/api/auth/login.test.js +53 -0
  25. package/api/configs/index.test.d.ts +1 -0
  26. package/api/configs/index.test.js +22 -0
  27. package/api/dossier/index.test.d.ts +1 -0
  28. package/api/dossier/index.test.js +57 -0
  29. package/api/help.test.d.ts +1 -0
  30. package/api/help.test.js +25 -0
  31. package/api/hit/assign.test.d.ts +1 -0
  32. package/api/hit/assign.test.js +22 -0
  33. package/api/hit/comments/index.test.d.ts +1 -0
  34. package/api/hit/comments/index.test.js +47 -0
  35. package/api/hit/comments/react.test.d.ts +1 -0
  36. package/api/hit/comments/react.test.js +27 -0
  37. package/api/hit/index.test.d.ts +1 -0
  38. package/api/hit/index.test.js +49 -0
  39. package/api/hit/labels.test.d.ts +1 -0
  40. package/api/hit/labels.test.js +29 -0
  41. package/api/hit/overwrite.test.d.ts +1 -0
  42. package/api/hit/overwrite.test.js +23 -0
  43. package/api/hit/transition.test.d.ts +1 -0
  44. package/api/hit/transition.test.js +24 -0
  45. package/api/index.test.d.ts +1 -0
  46. package/api/index.test.js +137 -0
  47. package/api/notebook/environments.test.d.ts +1 -0
  48. package/api/notebook/environments.test.js +22 -0
  49. package/api/notebook/index.test.d.ts +1 -0
  50. package/api/notebook/index.test.js +28 -0
  51. package/api/overview/index.test.d.ts +1 -0
  52. package/api/overview/index.test.js +42 -0
  53. package/api/search/fields/index.test.d.ts +1 -0
  54. package/api/search/fields/index.test.js +31 -0
  55. package/api/search/grouped/index.test.d.ts +1 -0
  56. package/api/search/grouped/index.test.js +18 -0
  57. package/api/search/grouped/user.test.d.ts +1 -0
  58. package/api/search/grouped/user.test.js +33 -0
  59. package/api/search/index.test.d.ts +1 -0
  60. package/api/search/index.test.js +41 -0
  61. package/api/search/user.test.d.ts +1 -0
  62. package/api/search/user.test.js +41 -0
  63. package/api/socket/index.test.d.ts +1 -0
  64. package/api/socket/index.test.js +15 -0
  65. package/api/template/index.test.d.ts +1 -0
  66. package/api/template/index.test.js +43 -0
  67. package/api/user/avatar/index.test.d.ts +1 -0
  68. package/api/user/avatar/index.test.js +22 -0
  69. package/api/user/groups.test.d.ts +1 -0
  70. package/api/user/groups.test.js +22 -0
  71. package/api/user/index.test.d.ts +1 -0
  72. package/api/user/index.test.js +37 -0
  73. package/api/user/whoami.test.d.ts +1 -0
  74. package/api/user/whoami.test.js +26 -0
  75. package/api/utils/createPermissionsApi.test.d.ts +1 -0
  76. package/api/utils/createPermissionsApi.test.js +30 -0
  77. package/api/v2/case/index.test.d.ts +1 -0
  78. package/api/v2/case/index.test.js +57 -0
  79. package/api/v2/case/items.test.d.ts +1 -0
  80. package/api/v2/case/items.test.js +37 -0
  81. package/api/v2/case/rules.test.d.ts +1 -0
  82. package/api/v2/case/rules.test.js +33 -0
  83. package/api/v2/fuzzy.test.d.ts +1 -0
  84. package/api/v2/fuzzy.test.js +30 -0
  85. package/api/v2/index.test.d.ts +1 -0
  86. package/api/v2/index.test.js +13 -0
  87. package/api/v2/search/index.test.d.ts +1 -0
  88. package/api/v2/search/index.test.js +42 -0
  89. package/api/view/index.test.d.ts +1 -0
  90. package/api/view/index.test.js +54 -0
  91. package/branding/AppBrand.test.d.ts +1 -0
  92. package/branding/AppBrand.test.js +29 -0
  93. package/components/app/drawers/ApiKeyDrawer.test.d.ts +1 -0
  94. package/components/app/drawers/ApiKeyDrawer.test.js +119 -0
  95. package/components/app/drawers/AssignUserDrawer.test.d.ts +1 -0
  96. package/components/app/drawers/AssignUserDrawer.test.js +75 -0
  97. package/components/app/hooks/useTitle.test.d.ts +1 -0
  98. package/components/app/hooks/useTitle.test.js +103 -0
  99. package/components/app/providers/AnalyticProvider.test.d.ts +1 -0
  100. package/components/app/providers/AnalyticProvider.test.js +58 -0
  101. package/components/app/providers/AppBarProvider.test.d.ts +1 -0
  102. package/components/app/providers/AppBarProvider.test.js +23 -0
  103. package/components/app/providers/AppDrawerProvider.test.d.ts +1 -0
  104. package/components/app/providers/AppDrawerProvider.test.js +42 -0
  105. package/components/app/providers/AvatarProvider.test.d.ts +1 -0
  106. package/components/app/providers/AvatarProvider.test.js +50 -0
  107. package/components/app/providers/CustomPluginProvider.test.d.ts +1 -0
  108. package/components/app/providers/CustomPluginProvider.test.js +29 -0
  109. package/components/app/providers/FavouritesProvider.test.d.ts +1 -0
  110. package/components/app/providers/FavouritesProvider.test.js +115 -0
  111. package/components/app/providers/FieldProvider.test.d.ts +1 -0
  112. package/components/app/providers/FieldProvider.test.js +28 -0
  113. package/components/app/providers/LocalStorageProvider.test.d.ts +1 -0
  114. package/components/app/providers/LocalStorageProvider.test.js +42 -0
  115. package/components/app/providers/ModalProvider.test.d.ts +1 -0
  116. package/components/app/providers/ModalProvider.test.js +35 -0
  117. package/components/app/providers/OverviewProvider.test.d.ts +1 -0
  118. package/components/app/providers/OverviewProvider.test.js +62 -0
  119. package/components/app/providers/RecordProvider.test.d.ts +1 -0
  120. package/components/app/providers/RecordProvider.test.js +66 -0
  121. package/components/app/providers/contextUtils.test.d.ts +1 -0
  122. package/components/app/providers/contextUtils.test.js +8 -0
  123. package/components/elements/Comment.test.d.ts +1 -0
  124. package/components/elements/Comment.test.js +109 -0
  125. package/components/elements/EditRow.test.d.ts +1 -0
  126. package/components/elements/EditRow.test.js +88 -0
  127. package/components/elements/MarkdownEditor.test.d.ts +1 -0
  128. package/components/elements/MarkdownEditor.test.js +75 -0
  129. package/components/elements/ObjectDetails.test.d.ts +1 -0
  130. package/components/elements/ObjectDetails.test.js +70 -0
  131. package/components/elements/PluginChip.d.ts +3 -2
  132. package/components/elements/PluginChip.js +2 -2
  133. package/components/elements/PluginChip.test.d.ts +1 -0
  134. package/components/elements/PluginChip.test.js +30 -0
  135. package/components/elements/ThemedEditor.test.d.ts +1 -0
  136. package/components/elements/ThemedEditor.test.js +66 -0
  137. package/components/elements/addons/layout/FlexPort.test.d.ts +1 -0
  138. package/components/elements/addons/layout/FlexPort.test.js +34 -0
  139. package/components/elements/addons/lists/TuiListBase.test.d.ts +1 -0
  140. package/components/elements/addons/lists/TuiListBase.test.js +44 -0
  141. package/components/elements/addons/lists/TuiListProvider.test.d.ts +1 -0
  142. package/components/elements/addons/lists/TuiListProvider.test.js +50 -0
  143. package/components/elements/addons/search/phrase/Phrase.test.d.ts +1 -0
  144. package/components/elements/addons/search/phrase/Phrase.test.js +77 -0
  145. package/components/elements/addons/search/phrase/PhraseLexer.test.d.ts +1 -0
  146. package/components/elements/addons/search/phrase/PhraseLexer.test.js +92 -0
  147. package/components/elements/addons/search/phrase/index.test.d.ts +1 -0
  148. package/components/elements/addons/search/phrase/index.test.js +20 -0
  149. package/components/elements/case/CaseCard.test.d.ts +1 -0
  150. package/components/elements/case/CaseCard.test.js +107 -0
  151. package/components/elements/display/ClassificationChip.test.d.ts +1 -0
  152. package/components/elements/display/ClassificationChip.test.js +60 -0
  153. package/components/elements/display/HandlebarsMarkdown.test.d.ts +1 -0
  154. package/components/elements/display/HandlebarsMarkdown.test.js +41 -0
  155. package/components/elements/display/HowlerAvatar.test.d.ts +1 -0
  156. package/components/elements/display/HowlerAvatar.test.js +54 -0
  157. package/components/elements/display/ItemManager.test.d.ts +1 -0
  158. package/components/elements/display/ItemManager.test.js +68 -0
  159. package/components/elements/display/UserPageWrapper.test.d.ts +1 -0
  160. package/components/elements/display/UserPageWrapper.test.js +22 -0
  161. package/components/elements/display/handlebars/helpers.test.d.ts +1 -0
  162. package/components/elements/display/handlebars/helpers.test.js +104 -0
  163. package/components/elements/display/icons/SocketBadge.test.d.ts +1 -0
  164. package/components/elements/display/icons/SocketBadge.test.js +49 -0
  165. package/components/elements/display/markdownPlugins/tabs.test.d.ts +1 -0
  166. package/components/elements/display/markdownPlugins/tabs.test.js +50 -0
  167. package/components/elements/hit/HitActions.js +1 -1
  168. package/components/elements/hit/HitActions.test.d.ts +1 -0
  169. package/components/elements/hit/HitActions.test.js +166 -0
  170. package/components/elements/hit/HitLabels.test.js +34 -3
  171. package/components/elements/hit/HitNotebooks.test.d.ts +1 -0
  172. package/components/elements/hit/HitNotebooks.test.js +138 -0
  173. package/components/elements/hit/HitSummary.test.d.ts +1 -0
  174. package/components/elements/hit/HitSummary.test.js +188 -0
  175. package/components/elements/hit/actions/ButtonActions.test.d.ts +1 -0
  176. package/components/elements/hit/actions/ButtonActions.test.js +51 -0
  177. package/components/elements/hit/actions/DropdownActions.test.d.ts +1 -0
  178. package/components/elements/hit/actions/DropdownActions.test.js +60 -0
  179. package/components/elements/hit/grid/AddColumnModal.test.d.ts +1 -0
  180. package/components/elements/hit/grid/AddColumnModal.test.js +88 -0
  181. package/components/elements/hit/grid/RecordTable.test.d.ts +1 -0
  182. package/components/elements/hit/grid/RecordTable.test.js +99 -0
  183. package/components/elements/record/RecordComments.test.d.ts +1 -0
  184. package/components/elements/record/RecordComments.test.js +151 -0
  185. package/components/elements/record/RecordContextMenu.js +3 -3
  186. package/components/elements/record/RecordRelated.test.d.ts +1 -0
  187. package/components/elements/record/RecordRelated.test.js +77 -0
  188. package/components/elements/record/RecordWorklog.test.d.ts +1 -0
  189. package/components/elements/record/RecordWorklog.test.js +77 -0
  190. package/components/hooks/useHitActions.test.d.ts +1 -0
  191. package/components/hooks/useHitActions.test.js +189 -0
  192. package/components/hooks/useMyApi.test.d.ts +1 -0
  193. package/components/hooks/useMyApi.test.js +31 -0
  194. package/components/hooks/useMyChart.test.d.ts +1 -0
  195. package/components/hooks/useMyChart.test.js +62 -0
  196. package/components/hooks/useMySearch.test.d.ts +1 -0
  197. package/components/hooks/useMySearch.test.js +96 -0
  198. package/components/hooks/useMySnackbar.test.d.ts +1 -0
  199. package/components/hooks/useMySnackbar.test.js +36 -0
  200. package/components/hooks/useMyUserFunctions.test.d.ts +1 -0
  201. package/components/hooks/useMyUserFunctions.test.js +142 -0
  202. package/components/hooks/useRecordSelection.test.d.ts +1 -0
  203. package/components/hooks/useRecordSelection.test.js +102 -0
  204. package/components/logins/Login.test.d.ts +1 -0
  205. package/components/logins/Login.test.js +67 -0
  206. package/components/logins/hooks/useLogin.test.d.ts +1 -0
  207. package/components/logins/hooks/useLogin.test.js +142 -0
  208. package/components/routes/action/shared/OperationEntry.test.d.ts +1 -0
  209. package/components/routes/action/shared/OperationEntry.test.js +80 -0
  210. package/components/routes/action/shared/OperationStep.test.d.ts +1 -0
  211. package/components/routes/action/shared/OperationStep.test.js +84 -0
  212. package/components/routes/action/useMyActionFunctions.test.d.ts +1 -0
  213. package/components/routes/action/useMyActionFunctions.test.js +217 -0
  214. package/components/routes/action/view/ActionDetails.test.d.ts +1 -0
  215. package/components/routes/action/view/ActionDetails.test.js +170 -0
  216. package/components/routes/action/view/ActionSearch.test.d.ts +1 -0
  217. package/components/routes/action/view/ActionSearch.test.js +185 -0
  218. package/components/routes/action/view/Integrations.test.d.ts +1 -0
  219. package/components/routes/action/view/Integrations.test.js +62 -0
  220. package/components/routes/admin/users/UserEditor.test.d.ts +1 -0
  221. package/components/routes/admin/users/UserEditor.test.js +74 -0
  222. package/components/routes/admin/users/UserSearch.test.d.ts +1 -0
  223. package/components/routes/admin/users/UserSearch.test.js +146 -0
  224. package/components/routes/advanced/QueryBuilder.test.d.ts +1 -0
  225. package/components/routes/advanced/QueryBuilder.test.js +185 -0
  226. package/components/routes/advanced/QueryEditor.test.d.ts +1 -0
  227. package/components/routes/advanced/QueryEditor.test.js +130 -0
  228. package/components/routes/advanced/completionProviders.test.d.ts +1 -0
  229. package/components/routes/advanced/completionProviders.test.js +144 -0
  230. package/components/routes/analytics/AnalyticComments.test.d.ts +1 -0
  231. package/components/routes/analytics/AnalyticComments.test.js +156 -0
  232. package/components/routes/analytics/AnalyticDetails.test.d.ts +1 -0
  233. package/components/routes/analytics/AnalyticDetails.test.js +161 -0
  234. package/components/routes/analytics/AnalyticNotebooks.test.d.ts +1 -0
  235. package/components/routes/analytics/AnalyticNotebooks.test.js +112 -0
  236. package/components/routes/analytics/AnalyticOverview.test.d.ts +1 -0
  237. package/components/routes/analytics/AnalyticOverview.test.js +97 -0
  238. package/components/routes/analytics/AnalyticOverviews.test.d.ts +1 -0
  239. package/components/routes/analytics/AnalyticOverviews.test.js +70 -0
  240. package/components/routes/analytics/AnalyticSearch.test.d.ts +1 -0
  241. package/components/routes/analytics/AnalyticSearch.test.js +167 -0
  242. package/components/routes/analytics/AnalyticTemplates.test.d.ts +1 -0
  243. package/components/routes/analytics/AnalyticTemplates.test.js +63 -0
  244. package/components/routes/analytics/TriageSettings.test.d.ts +1 -0
  245. package/components/routes/analytics/TriageSettings.test.js +89 -0
  246. package/components/routes/analytics/widgets/Assessment.test.d.ts +1 -0
  247. package/components/routes/analytics/widgets/Assessment.test.js +45 -0
  248. package/components/routes/analytics/widgets/Created.test.d.ts +1 -0
  249. package/components/routes/analytics/widgets/Created.test.js +41 -0
  250. package/components/routes/analytics/widgets/DetectionStatus.test.d.ts +1 -0
  251. package/components/routes/analytics/widgets/DetectionStatus.test.js +21 -0
  252. package/components/routes/analytics/widgets/Stacked.test.d.ts +1 -0
  253. package/components/routes/analytics/widgets/Stacked.test.js +51 -0
  254. package/components/routes/cases/Cases.test.d.ts +1 -0
  255. package/components/routes/cases/Cases.test.js +132 -0
  256. package/components/routes/dossiers/Dossiers.test.d.ts +1 -0
  257. package/components/routes/dossiers/Dossiers.test.js +150 -0
  258. package/components/routes/help/ActionDocumentation.test.d.ts +1 -0
  259. package/components/routes/help/ActionDocumentation.test.js +58 -0
  260. package/components/routes/help/ActionIntroductionDocumentation.test.d.ts +1 -0
  261. package/components/routes/help/ActionIntroductionDocumentation.test.js +68 -0
  262. package/components/routes/help/ApiDocumentation.test.d.ts +1 -0
  263. package/components/routes/help/ApiDocumentation.test.js +79 -0
  264. package/components/routes/help/AuthDocumentation.test.d.ts +1 -0
  265. package/components/routes/help/AuthDocumentation.test.js +34 -0
  266. package/components/routes/help/ClientDocumentation.test.d.ts +1 -0
  267. package/components/routes/help/ClientDocumentation.test.js +34 -0
  268. package/components/routes/help/Help.test.d.ts +1 -0
  269. package/components/routes/help/Help.test.js +57 -0
  270. package/components/routes/help/HitBannerDocumentation.test.d.ts +1 -0
  271. package/components/routes/help/HitBannerDocumentation.test.js +25 -0
  272. package/components/routes/help/HitDocumentation.test.d.ts +1 -0
  273. package/components/routes/help/HitDocumentation.test.js +53 -0
  274. package/components/routes/help/HitLabelsDocumentation.test.d.ts +1 -0
  275. package/components/routes/help/HitLabelsDocumentation.test.js +17 -0
  276. package/components/routes/help/HitLinksDocumentation.test.d.ts +1 -0
  277. package/components/routes/help/HitLinksDocumentation.test.js +27 -0
  278. package/components/routes/help/HitSchemaDocumentation.test.d.ts +1 -0
  279. package/components/routes/help/HitSchemaDocumentation.test.js +67 -0
  280. package/components/routes/help/NotebookDocumentation.test.d.ts +1 -0
  281. package/components/routes/help/NotebookDocumentation.test.js +34 -0
  282. package/components/routes/help/OverviewDocumentation.test.d.ts +1 -0
  283. package/components/routes/help/OverviewDocumentation.test.js +26 -0
  284. package/components/routes/help/RetentionDocumentation.test.d.ts +1 -0
  285. package/components/routes/help/RetentionDocumentation.test.js +61 -0
  286. package/components/routes/help/SearchDocumentation.test.d.ts +1 -0
  287. package/components/routes/help/SearchDocumentation.test.js +65 -0
  288. package/components/routes/help/TemplateDocumentation.test.d.ts +1 -0
  289. package/components/routes/help/TemplateDocumentation.test.js +58 -0
  290. package/components/routes/help/ViewDocumentation.test.d.ts +1 -0
  291. package/components/routes/help/ViewDocumentation.test.js +34 -0
  292. package/components/routes/help/components/HelpTabs.test.d.ts +1 -0
  293. package/components/routes/help/components/HelpTabs.test.js +26 -0
  294. package/components/routes/hits/search/InformationPane.test.d.ts +1 -0
  295. package/components/routes/hits/search/InformationPane.test.js +251 -0
  296. package/components/routes/hits/search/RecordBrowser.test.js +179 -51
  297. package/components/routes/hits/search/RecordQuery.test.d.ts +1 -0
  298. package/components/routes/hits/search/RecordQuery.test.js +117 -0
  299. package/components/routes/hits/search/SearchPane.test.d.ts +1 -0
  300. package/components/routes/hits/search/SearchPane.test.js +178 -0
  301. package/components/routes/hits/search/grid/RecordGrid.test.d.ts +1 -0
  302. package/components/routes/hits/search/grid/RecordGrid.test.js +107 -0
  303. package/components/routes/hits/search/shared/CustomSort.test.d.ts +1 -0
  304. package/components/routes/hits/search/shared/CustomSort.test.js +77 -0
  305. package/components/routes/hits/search/shared/HitFilter.test.d.ts +1 -0
  306. package/components/routes/hits/search/shared/HitFilter.test.js +83 -0
  307. package/components/routes/hits/search/shared/HitSort.test.d.ts +1 -0
  308. package/components/routes/hits/search/shared/HitSort.test.js +61 -0
  309. package/components/routes/hits/search/shared/LayoutSettings.test.d.ts +1 -0
  310. package/components/routes/hits/search/shared/LayoutSettings.test.js +84 -0
  311. package/components/routes/hits/search/shared/SearchSpan.test.d.ts +1 -0
  312. package/components/routes/hits/search/shared/SearchSpan.test.js +84 -0
  313. package/components/routes/home/AnalyticCard.test.d.ts +1 -0
  314. package/components/routes/home/AnalyticCard.test.js +87 -0
  315. package/components/routes/home/index.test.d.ts +1 -0
  316. package/components/routes/home/index.test.js +190 -0
  317. package/components/routes/overviews/OverviewViewer.test.d.ts +1 -0
  318. package/components/routes/overviews/OverviewViewer.test.js +151 -0
  319. package/components/routes/overviews/Overviews.test.d.ts +1 -0
  320. package/components/routes/overviews/Overviews.test.js +154 -0
  321. package/components/routes/settings/AdminSection.test.d.ts +1 -0
  322. package/components/routes/settings/AdminSection.test.js +26 -0
  323. package/components/routes/settings/LocalSection.test.d.ts +1 -0
  324. package/components/routes/settings/LocalSection.test.js +75 -0
  325. package/components/routes/settings/ProfileSection.test.d.ts +1 -0
  326. package/components/routes/settings/ProfileSection.test.js +95 -0
  327. package/components/routes/settings/SecuritySection.test.d.ts +1 -0
  328. package/components/routes/settings/SecuritySection.test.js +90 -0
  329. package/components/routes/settings/Settings.test.d.ts +1 -0
  330. package/components/routes/settings/Settings.test.js +60 -0
  331. package/components/routes/templates/TemplateEditor.test.d.ts +1 -0
  332. package/components/routes/templates/TemplateEditor.test.js +94 -0
  333. package/components/routes/templates/TemplateViewer.test.d.ts +1 -0
  334. package/components/routes/templates/TemplateViewer.test.js +145 -0
  335. package/components/routes/templates/Templates.test.d.ts +1 -0
  336. package/components/routes/templates/Templates.test.js +165 -0
  337. package/components/routes/views/ViewComposer.test.d.ts +1 -0
  338. package/components/routes/views/ViewComposer.test.js +320 -0
  339. package/components/routes/views/Views.test.d.ts +1 -0
  340. package/components/routes/views/Views.test.js +247 -0
  341. package/package.json +1 -1
  342. package/plugins/HowlerPlugin.test.d.ts +1 -0
  343. package/plugins/HowlerPlugin.test.js +103 -0
  344. package/plugins/clue/components/ClueChip.js +2 -2
  345. package/plugins/clue/helpers.test.d.ts +1 -0
  346. package/plugins/clue/helpers.test.js +100 -0
  347. package/plugins/store.test.d.ts +1 -0
  348. package/plugins/store.test.js +53 -0
  349. package/utils/classificationParser.test.d.ts +1 -0
  350. package/utils/classificationParser.test.js +199 -0
  351. package/utils/constants.test.d.ts +1 -0
  352. package/utils/constants.test.js +62 -0
  353. package/utils/typeUtils.test.d.ts +1 -0
  354. package/utils/typeUtils.test.js +22 -0
@@ -0,0 +1,170 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /// <reference types="vitest" />
3
+ import { fireEvent, render, screen, waitFor } from '@testing-library/react';
4
+ import { beforeEach, describe, expect, it, vi } from 'vitest';
5
+ const mockDispatchApi = vi.hoisted(() => vi.fn());
6
+ const mockShowSuccessMessage = vi.hoisted(() => vi.fn());
7
+ const mockExecuteAction = vi.hoisted(() => vi.fn());
8
+ const mockDeleteAction = vi.hoisted(() => vi.fn());
9
+ const mockOnSearch = vi.hoisted(() => vi.fn());
10
+ const mockSetLoading = vi.hoisted(() => vi.fn());
11
+ const mockPluginExecute = vi.hoisted(() => vi.fn(() => _jsx("div", { children: "plugin-operation" }, "plugin-operation")));
12
+ const modalContextToken = vi.hoisted(() => ({ name: 'modal-context' }));
13
+ vi.mock('@mui/icons-material', () => ({
14
+ Delete: () => _jsx("div", { children: "delete-icon" }),
15
+ Edit: () => _jsx("div", { children: "edit-icon" }),
16
+ PlayCircleOutline: () => _jsx("div", { children: "play-icon" }),
17
+ Search: () => _jsx("div", { children: "search-icon" })
18
+ }));
19
+ vi.mock('@mui/material', () => ({
20
+ Button: ({ children, onClick, component: Component, to }) => Component ? _jsx("a", { href: to, children: children }) : _jsx("button", { onClick: onClick, children: children }),
21
+ Checkbox: ({ name, onChange, checked }) => (_jsx("input", { type: "checkbox", "aria-label": name, checked: checked, onChange: e => onChange({ target: { name, checked: e.target.checked } }) })),
22
+ FormControlLabel: ({ control, label }) => (_jsxs("label", { children: [control, label] })),
23
+ FormGroup: ({ children }) => _jsx("div", { children: children }),
24
+ IconButton: ({ children, onClick }) => _jsx("button", { onClick: onClick, children: children }),
25
+ LinearProgress: ({ value }) => _jsx("div", { children: `progress:${value ?? 'indeterminate'}` }),
26
+ Stack: ({ children }) => _jsx("div", { children: children }),
27
+ Typography: ({ children }) => _jsx("div", { children: children })
28
+ }));
29
+ vi.mock('@tui/core', () => ({
30
+ PageCenter: ({ children }) => _jsx("div", { children: children }),
31
+ useAppUser: () => ({ user: { username: 'alice', roles: ['automation_advanced'] } })
32
+ }));
33
+ vi.mock('api', () => ({
34
+ default: {
35
+ action: {
36
+ patch: (id, body) => ({ op: 'patch', id, body }),
37
+ operations: { get: () => ({ op: 'get-operations' }) },
38
+ get: (id) => ({ op: 'get-action', id })
39
+ }
40
+ }
41
+ }));
42
+ vi.mock('components/app/providers/ModalProvider', () => ({
43
+ ModalContext: modalContextToken
44
+ }));
45
+ vi.mock('components/elements/addons/layout/FlexOne', () => ({
46
+ default: () => _jsx("div", { children: "flex" })
47
+ }));
48
+ vi.mock('components/elements/addons/search/phrase/Phrase', () => ({
49
+ default: ({ value, startAdornment }) => (_jsxs("div", { children: [startAdornment, _jsx("div", { children: `phrase:${value}` })] }))
50
+ }));
51
+ vi.mock('components/elements/display/HowlerAvatar', () => ({
52
+ default: ({ userId }) => _jsx("div", { children: `avatar:${userId}` })
53
+ }));
54
+ vi.mock('components/elements/membership/MembershipManagement', () => ({
55
+ MembershipManagement: () => _jsx("div", { children: "membership-management" })
56
+ }));
57
+ vi.mock('components/hooks/useMyApi', () => ({
58
+ default: () => ({ dispatchApi: mockDispatchApi })
59
+ }));
60
+ vi.mock('components/hooks/useMySnackbar', () => ({
61
+ default: () => ({ showSuccessMessage: mockShowSuccessMessage })
62
+ }));
63
+ vi.mock('components/routes/action/shared/OperationEntry', () => ({
64
+ default: ({ operation, values }) => _jsx("div", { children: `operation:${operation.id}:${values.kind}` })
65
+ }));
66
+ vi.mock('plugins/store', () => ({
67
+ default: { operations: ['plugin-op'] }
68
+ }));
69
+ vi.mock('react', async (importOriginal) => {
70
+ const actual = await importOriginal();
71
+ return {
72
+ ...actual,
73
+ useContext: (context) => {
74
+ if (context?.name === 'modal-context') {
75
+ return { withConfirmDeleteModal: async (cb) => cb() };
76
+ }
77
+ return actual.useContext(context);
78
+ }
79
+ };
80
+ });
81
+ vi.mock('react-i18next', () => ({
82
+ useTranslation: () => ({ t: (key) => key })
83
+ }));
84
+ vi.mock('react-pluggable', () => ({
85
+ usePluginStore: () => ({ executeFunction: mockPluginExecute })
86
+ }));
87
+ vi.mock('react-router', () => ({
88
+ Link: ({ children, to }) => _jsx("a", { href: to, children: children }),
89
+ useParams: () => ({ id: 'action-1' })
90
+ }));
91
+ vi.mock('../../../elements/display/QueryResultText', () => ({
92
+ default: ({ count, query }) => _jsx("div", { children: `query-result:${count}:${query}` })
93
+ }));
94
+ vi.mock('../shared/ActionReportDisplay', () => ({
95
+ default: ({ report }) => _jsx("div", { children: `report:${report.status}` })
96
+ }));
97
+ vi.mock('../useMyActionFunctions', () => ({
98
+ default: () => ({
99
+ response: { total: 7 },
100
+ onSearch: mockOnSearch,
101
+ loading: true,
102
+ setLoading: mockSetLoading,
103
+ executeAction: mockExecuteAction,
104
+ deleteAction: mockDeleteAction,
105
+ progress: [2, 4],
106
+ report: { status: 'done' }
107
+ })
108
+ }));
109
+ import ActionDetails from './ActionDetails';
110
+ describe('ActionDetails', () => {
111
+ beforeEach(() => {
112
+ mockDispatchApi.mockReset();
113
+ mockShowSuccessMessage.mockReset();
114
+ mockExecuteAction.mockReset();
115
+ mockDeleteAction.mockReset();
116
+ mockOnSearch.mockReset();
117
+ mockSetLoading.mockReset();
118
+ mockPluginExecute.mockClear();
119
+ mockDispatchApi.mockImplementation(async (request) => {
120
+ if (request.op === 'get-operations') {
121
+ return [
122
+ { id: 'direct-op', triggers: ['manual', 'alert'] },
123
+ { id: 'plugin-op', triggers: ['alert'] }
124
+ ];
125
+ }
126
+ if (request.op === 'get-action') {
127
+ return {
128
+ action_id: 'action-1',
129
+ owner: 'alice',
130
+ name: 'My action',
131
+ query: 'status:open',
132
+ admins: ['alice'],
133
+ members: ['alice'],
134
+ triggers: ['manual'],
135
+ operations: [
136
+ { operation_id: 'direct-op', data_json: { kind: 'direct' } },
137
+ { operation_id: 'plugin-op', data_json: { kind: 'plugin' } }
138
+ ]
139
+ };
140
+ }
141
+ return request;
142
+ });
143
+ });
144
+ it('loads action details, searches, patches triggers, executes, deletes, and renders operations', async () => {
145
+ render(_jsx(ActionDetails, {}));
146
+ await waitFor(() => expect(mockDispatchApi).toHaveBeenCalledTimes(2));
147
+ await waitFor(() => expect(mockOnSearch).toHaveBeenCalledWith('status:open'));
148
+ expect(screen.getByText('My action')).toBeInTheDocument();
149
+ expect(screen.getByText('avatar:alice')).toBeInTheDocument();
150
+ expect(screen.getByText('query-result:7:status:open')).toBeInTheDocument();
151
+ expect(screen.getByText('report:done')).toBeInTheDocument();
152
+ expect(screen.getByText('progress:50')).toBeInTheDocument();
153
+ expect(screen.getByText('operation:direct-op:direct')).toBeInTheDocument();
154
+ expect(screen.getByText('plugin-operation')).toBeInTheDocument();
155
+ fireEvent.click(screen.getByText('search-icon').parentElement);
156
+ expect(mockOnSearch).toHaveBeenCalledWith('status:open');
157
+ fireEvent.click(screen.getByLabelText('alert'));
158
+ await waitFor(() => expect(mockDispatchApi).toHaveBeenCalledWith({
159
+ op: 'patch',
160
+ id: 'action-1',
161
+ body: { triggers: ['manual', 'alert'] }
162
+ }));
163
+ fireEvent.click(screen.getByText('route.actions.execute'));
164
+ expect(mockExecuteAction).toHaveBeenCalledWith('action-1');
165
+ fireEvent.click(screen.getByText('button.delete'));
166
+ await waitFor(() => expect(mockDeleteAction).toHaveBeenCalledWith('action-1'));
167
+ expect(mockShowSuccessMessage).toHaveBeenCalledWith('route.actions.manager.delete.success');
168
+ expect(screen.getByRole('link', { name: 'route.actions.edit' })).toHaveAttribute('href', '/action/action-1/edit');
169
+ });
170
+ });
@@ -0,0 +1,185 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /// <reference types="vitest" />
3
+ import { fireEvent, render, screen, waitFor } from '@testing-library/react';
4
+ import { beforeEach, describe, expect, it, vi } from 'vitest';
5
+ const mockShowSuccessMessage = vi.hoisted(() => vi.fn());
6
+ const mockNavigate = vi.hoisted(() => vi.fn());
7
+ const mockSetSearchParams = vi.hoisted(() => vi.fn());
8
+ const mockLoad = vi.hoisted(() => vi.fn());
9
+ const mockRequest = vi.hoisted(() => vi.fn());
10
+ const mockRemove = vi.hoisted(() => vi.fn());
11
+ const mockGetSearchRequestData = vi.hoisted(() => vi.fn((data) => ({ offset: data.offset })));
12
+ const mockDeleteAction = vi.hoisted(() => vi.fn());
13
+ const modalContextToken = vi.hoisted(() => ({ name: 'modal-context' }));
14
+ const listMethodContextToken = vi.hoisted(() => ({ name: 'list-method-context' }));
15
+ let searchParamsValue = new URLSearchParams();
16
+ let responseValue = {
17
+ total: 1,
18
+ items: [
19
+ {
20
+ action_id: 'action-1',
21
+ name: 'Action One',
22
+ owner: 'demo',
23
+ triggers: ['manual'],
24
+ operations: [{ operation_id: 'archive' }],
25
+ query: 'status:open'
26
+ }
27
+ ]
28
+ };
29
+ let appUserValue = {
30
+ user: { username: 'demo', roles: ['automation_basic'] }
31
+ };
32
+ vi.mock('@mui/icons-material', async (importOriginal) => {
33
+ const actual = await importOriginal();
34
+ return {
35
+ ...actual,
36
+ Delete: () => _jsx("div", { children: "delete-icon" }),
37
+ Engineering: () => _jsx("div", { children: "engineering-icon" }),
38
+ Terminal: () => _jsx("div", { children: "terminal-icon" })
39
+ };
40
+ });
41
+ vi.mock('@mui/material', () => ({
42
+ Autocomplete: ({ onChange }) => _jsx("button", { onClick: () => onChange?.(null, ['manual']), children: "set-trigger" }),
43
+ Card: ({ children, onClick }) => _jsx("div", { onClick: onClick, children: children }),
44
+ CardContent: ({ children }) => _jsx("div", { children: children }),
45
+ CardHeader: ({ title, subheader }) => (_jsxs("div", { children: [title, subheader] })),
46
+ Chip: ({ label }) => _jsx("div", { children: label }),
47
+ Grid: ({ children }) => _jsx("div", { children: children }),
48
+ IconButton: ({ children, onClick }) => _jsx("button", { onClick: onClick, children: children }),
49
+ Stack: ({ children }) => _jsx("div", { children: children }),
50
+ TextField: () => _jsx("div", { children: "text-field" }),
51
+ Tooltip: ({ children }) => _jsx("div", { children: children }),
52
+ Typography: ({ children }) => _jsx("div", { children: children })
53
+ }));
54
+ vi.mock('@tui/core', () => ({
55
+ useAppUser: () => appUserValue
56
+ }));
57
+ vi.mock('api', () => ({
58
+ default: {
59
+ search: {
60
+ action: {
61
+ post: 'action-search'
62
+ }
63
+ }
64
+ }
65
+ }));
66
+ vi.mock('components/app/providers/ModalProvider', () => ({
67
+ ModalContext: modalContextToken
68
+ }));
69
+ vi.mock('components/app/providers/SearchResponseProvider', () => ({
70
+ __esModule: true,
71
+ default: ({ children }) => _jsx("div", { children: children }),
72
+ createSearchResponseContext: () => ({}),
73
+ useSearchResponseContext: () => ({
74
+ response: responseValue,
75
+ request: mockRequest,
76
+ remove: mockRemove,
77
+ getSearchRequestData: mockGetSearchRequestData
78
+ })
79
+ }));
80
+ vi.mock('components/elements/addons/layout/FlexOne', () => ({
81
+ default: () => _jsx("div", { children: "flex" })
82
+ }));
83
+ vi.mock('components/elements/addons/lists', () => ({
84
+ TuiListProvider: ({ children }) => _jsx("div", { children: children })
85
+ }));
86
+ vi.mock('components/elements/addons/lists/TuiListProvider', () => ({
87
+ TuiListMethodContext: listMethodContextToken
88
+ }));
89
+ vi.mock('components/elements/display/ItemManager', () => ({
90
+ default: (props) => (_jsxs("div", { children: [_jsx("button", { onClick: () => props.onSearch(), children: "search" }), _jsx("button", { onClick: () => props.onPageChange(25), children: "page" }), _jsx("button", { onClick: () => props.onCreate?.(), children: "create" }), _jsx("div", { children: props.searchFilters }), props.response?.items?.map((item) => (_jsx("div", { children: props.renderer({ item: { item } }, () => 'card') }, item.action_id)))] }))
91
+ }));
92
+ vi.mock('components/elements/membership/Members', () => ({
93
+ default: ({ item }) => _jsx("div", { children: `members:${item.action_id}` })
94
+ }));
95
+ vi.mock('components/hooks/useMyLocalStorage', () => ({
96
+ useMyLocalStorageItem: () => [25]
97
+ }));
98
+ vi.mock('components/hooks/useMySnackbar', () => ({
99
+ default: () => ({ showSuccessMessage: mockShowSuccessMessage })
100
+ }));
101
+ vi.mock('react-i18next', () => ({
102
+ Trans: ({ values }) => _jsx("div", { children: values?.triggers }),
103
+ useTranslation: () => ({ t: (key) => key })
104
+ }));
105
+ vi.mock('react-router', () => ({
106
+ useNavigate: () => mockNavigate,
107
+ useSearchParams: () => [searchParamsValue, mockSetSearchParams]
108
+ }));
109
+ vi.mock('../useMyActionFunctions', () => ({
110
+ default: () => ({ deleteAction: mockDeleteAction })
111
+ }));
112
+ vi.mock('react', async (importOriginal) => {
113
+ const actual = await importOriginal();
114
+ return {
115
+ ...actual,
116
+ useContext: (context) => {
117
+ if (context === modalContextToken) {
118
+ return { withConfirmDeleteModal: async (fn) => fn() };
119
+ }
120
+ if (context === listMethodContextToken) {
121
+ return { load: mockLoad };
122
+ }
123
+ return actual.useContext(context);
124
+ }
125
+ };
126
+ });
127
+ import ActionSearch from './ActionSearch';
128
+ describe('ActionSearch', () => {
129
+ beforeEach(() => {
130
+ searchParamsValue = new URLSearchParams();
131
+ responseValue = {
132
+ total: 1,
133
+ items: [
134
+ {
135
+ action_id: 'action-1',
136
+ name: 'Action One',
137
+ owner: 'demo',
138
+ triggers: ['manual'],
139
+ operations: [{ operation_id: 'archive' }],
140
+ query: 'status:open'
141
+ }
142
+ ]
143
+ };
144
+ appUserValue = { user: { username: 'demo', roles: ['automation_basic'] } };
145
+ mockShowSuccessMessage.mockReset();
146
+ mockNavigate.mockReset();
147
+ mockSetSearchParams.mockReset();
148
+ mockLoad.mockReset();
149
+ mockRequest.mockReset();
150
+ mockRemove.mockReset();
151
+ mockGetSearchRequestData.mockClear();
152
+ mockDeleteAction.mockReset();
153
+ });
154
+ it('searches, filters, paginates, and navigates to create/detail pages', async () => {
155
+ render(_jsx(ActionSearch, {}));
156
+ await waitFor(() => expect(mockRequest).toHaveBeenCalledWith('action-search', {
157
+ query: 'name:(**) OR query:(**)',
158
+ rows: 25,
159
+ offset: 0
160
+ }));
161
+ expect(mockLoad).toHaveBeenCalledWith([expect.objectContaining({ id: 'action-1' })]);
162
+ expect(screen.getByText('status:open')).toBeInTheDocument();
163
+ expect(screen.getByText('members:action-1')).toBeInTheDocument();
164
+ expect(screen.getByText('operations.archive')).toBeInTheDocument();
165
+ fireEvent.click(screen.getByText('set-trigger'));
166
+ await waitFor(() => expect(mockRequest).toHaveBeenLastCalledWith('action-search', {
167
+ query: '(name:(**) OR query:(**)) AND (triggers:(manual))',
168
+ rows: 25,
169
+ offset: 0
170
+ }));
171
+ fireEvent.click(screen.getByText('page'));
172
+ expect(mockSetSearchParams).toHaveBeenCalled();
173
+ fireEvent.click(screen.getByText('create'));
174
+ expect(mockNavigate).toHaveBeenCalledWith('/action/execute');
175
+ fireEvent.click(screen.getByText('Action One'));
176
+ expect(mockNavigate).toHaveBeenCalledWith('/action/action-1');
177
+ });
178
+ it('deletes actions and shows a success message', async () => {
179
+ render(_jsx(ActionSearch, {}));
180
+ fireEvent.click(screen.getByText('delete-icon'));
181
+ await waitFor(() => expect(mockDeleteAction).toHaveBeenCalledWith('action-1'));
182
+ expect(mockRemove).toHaveBeenCalledWith('action-1');
183
+ expect(mockShowSuccessMessage).toHaveBeenCalledWith('route.actions.manager.delete.success');
184
+ });
185
+ });
@@ -0,0 +1,62 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /// <reference types="vitest" />
3
+ import { fireEvent, render, screen } from '@testing-library/react';
4
+ import { beforeEach, describe, expect, it, vi } from 'vitest';
5
+ const mockExecuteFunction = vi.hoisted(() => vi.fn());
6
+ const mockSetSearchParams = vi.hoisted(() => vi.fn());
7
+ let searchParamsValue = new URLSearchParams();
8
+ let pluginList = ['demo'];
9
+ vi.mock('@mui/material', () => ({
10
+ Stack: ({ children }) => _jsx("div", { children: children }),
11
+ Tab: ({ label, value }) => _jsx("button", { "data-value": value, children: label }),
12
+ Tabs: ({ children, onChange }) => (_jsxs("div", { children: [_jsx("button", { onClick: () => onChange(null, 'second'), children: "switch-tab" }), children] }))
13
+ }));
14
+ vi.mock('@tui/core', () => ({
15
+ PageCenter: ({ children }) => _jsx("div", { children: children })
16
+ }));
17
+ vi.mock('components/elements/display/Markdown', () => ({
18
+ default: ({ md }) => _jsx("div", { children: md })
19
+ }));
20
+ vi.mock('plugins/store', () => ({
21
+ default: {
22
+ get plugins() {
23
+ return pluginList;
24
+ }
25
+ }
26
+ }));
27
+ vi.mock('react-i18next', () => ({
28
+ useTranslation: () => ({ t: (key) => key, i18n: { language: 'en' } })
29
+ }));
30
+ vi.mock('react-pluggable', () => ({
31
+ usePluginStore: () => ({ executeFunction: mockExecuteFunction })
32
+ }));
33
+ vi.mock('react-router', () => ({
34
+ useSearchParams: () => [searchParamsValue, mockSetSearchParams]
35
+ }));
36
+ vi.mock('./markdown/integrations.en.md', () => ({ default: 'integrations-en' }));
37
+ vi.mock('./markdown/integrations.fr.md', () => ({ default: 'integrations-fr' }));
38
+ import Integrations from './Integrations';
39
+ describe('Integrations', () => {
40
+ beforeEach(() => {
41
+ searchParamsValue = new URLSearchParams();
42
+ pluginList = ['demo'];
43
+ mockExecuteFunction.mockReset();
44
+ mockSetSearchParams.mockReset();
45
+ });
46
+ it('renders plugin integrations and syncs the selected tab into search params', () => {
47
+ mockExecuteFunction.mockReturnValue([
48
+ ['first', () => _jsx("div", { children: "first-view" })],
49
+ ['second', () => _jsx("div", { children: "second-view" })]
50
+ ]);
51
+ render(_jsx(Integrations, {}));
52
+ expect(screen.getByText('route.integrations.first')).toBeInTheDocument();
53
+ expect(screen.getByText('first-view')).toBeInTheDocument();
54
+ fireEvent.click(screen.getByText('switch-tab'));
55
+ expect(mockSetSearchParams).toHaveBeenCalled();
56
+ });
57
+ it('falls back to markdown when no plugin integrations exist', () => {
58
+ pluginList = [];
59
+ render(_jsx(Integrations, {}));
60
+ expect(screen.getByText('integrations-en')).toBeInTheDocument();
61
+ });
62
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,74 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /// <reference types="vitest" />
3
+ import { render, screen, waitFor } from '@testing-library/react';
4
+ import { beforeEach, describe, expect, it, vi } from 'vitest';
5
+ const mockDispatchApi = vi.hoisted(() => vi.fn());
6
+ const mockUseUserFunctions = vi.hoisted(() => ({
7
+ editName: vi.fn(async (user, name) => ({ ...user, name })),
8
+ editPassword: vi.fn(),
9
+ editQuota: vi.fn(async (user, quota) => ({ ...user, api_quota: quota ? parseInt(quota) : 25 })),
10
+ addRole: vi.fn(async (user, role) => ({ ...user, roles: [...(user.roles ?? []), role] })),
11
+ removeRole: vi.fn(async (user, role) => ({
12
+ ...user,
13
+ roles: (user.roles ?? []).filter((r) => r !== role)
14
+ })),
15
+ addApiKey: vi.fn(),
16
+ removeApiKey: vi.fn(async (user, key) => ({
17
+ ...user,
18
+ apikeys: (user.apikeys ?? []).filter((v) => v !== key)
19
+ })),
20
+ viewGroups: vi.fn()
21
+ }));
22
+ let currentUser = { username: 'admin', is_admin: true };
23
+ let paramsValue = { id: 'alice' };
24
+ vi.mock('@tui/core', () => ({
25
+ useAppUser: () => ({ user: currentUser })
26
+ }));
27
+ vi.mock('api', () => ({
28
+ default: {
29
+ user: {
30
+ get: (id) => ({ id })
31
+ }
32
+ }
33
+ }));
34
+ vi.mock('components/elements/display/UserPageWrapper', () => ({
35
+ default: ({ children }) => _jsx("div", { children: children })
36
+ }));
37
+ vi.mock('components/hooks/useMyApi', () => ({
38
+ default: () => ({ dispatchApi: mockDispatchApi })
39
+ }));
40
+ vi.mock('components/hooks/useMyUserFunctions', () => ({
41
+ default: () => mockUseUserFunctions
42
+ }));
43
+ vi.mock('components/routes/settings/ProfileSection', () => ({
44
+ default: (props) => (_jsxs("div", { children: [_jsx("span", { children: `profile:${props.user.username}` }), _jsxs("span", { children: [String(!!props.editName), "-", String(!!props.addRole), "-", String(!!props.removeRole), "-", String(!!props.viewGroups)] })] }))
45
+ }));
46
+ vi.mock('components/routes/settings/SecuritySection', () => ({
47
+ default: (props) => (_jsxs("div", { children: [_jsx("span", { children: `security:${props.user.username}` }), _jsxs("span", { children: [String(!!props.editPassword), "-", String(!!props.addApiKey), "-", String(!!props.removeApiKey), "-", String(!!props.editQuota)] })] }))
48
+ }));
49
+ vi.mock('react-router', () => ({
50
+ useParams: () => paramsValue
51
+ }));
52
+ import UserEditor from './UserEditor';
53
+ describe('UserEditor', () => {
54
+ beforeEach(() => {
55
+ currentUser = { username: 'admin', is_admin: true };
56
+ paramsValue = { id: 'alice' };
57
+ mockDispatchApi.mockReset();
58
+ });
59
+ it('loads the requested user and exposes admin controls', async () => {
60
+ mockDispatchApi.mockResolvedValue({ username: 'alice', roles: ['member'], apikeys: [] });
61
+ render(_jsx(UserEditor, {}));
62
+ await waitFor(() => expect(screen.getByText('profile:alice')).toBeInTheDocument());
63
+ expect(screen.getByText('true-true-true-false')).toBeInTheDocument();
64
+ expect(screen.getByText('false-false-true-true')).toBeInTheDocument();
65
+ });
66
+ it('exposes self-service actions for the same user', async () => {
67
+ currentUser = { username: 'alice', is_admin: false };
68
+ mockDispatchApi.mockResolvedValue({ username: 'alice', roles: ['member'], apikeys: [] });
69
+ render(_jsx(UserEditor, {}));
70
+ await waitFor(() => expect(screen.getByText('profile:alice')).toBeInTheDocument());
71
+ expect(screen.getByText('true-false-false-true')).toBeInTheDocument();
72
+ expect(screen.getByText('true-true-true-false')).toBeInTheDocument();
73
+ });
74
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,146 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /// <reference types="vitest" />
3
+ import { fireEvent, render, screen, waitFor } from '@testing-library/react';
4
+ import { beforeEach, describe, expect, it, vi } from 'vitest';
5
+ const listMethodContextToken = vi.hoisted(() => ({ name: 'list-method-context' }));
6
+ const mockDispatchApi = vi.hoisted(() => vi.fn());
7
+ const mockNavigate = vi.hoisted(() => vi.fn());
8
+ const mockSetSearchParams = vi.hoisted(() => vi.fn());
9
+ const mockLoad = vi.hoisted(() => vi.fn());
10
+ let searchParamsValue = new URLSearchParams();
11
+ let tableSelect;
12
+ vi.mock('@mui/icons-material', async (importOriginal) => {
13
+ const actual = await importOriginal();
14
+ return {
15
+ ...actual,
16
+ Close: () => _jsx("div", { children: "close-icon" }),
17
+ Search: () => _jsx("div", { children: "search-icon" })
18
+ };
19
+ });
20
+ vi.mock('@mui/material', () => ({
21
+ Box: ({ children }) => _jsx("div", { children: children }),
22
+ Chip: ({ label }) => _jsx("div", { children: label }),
23
+ Grid: ({ children }) => _jsx("div", { children: children }),
24
+ IconButton: ({ children, onClick }) => _jsx("button", { onClick: onClick, children: children }),
25
+ LinearProgress: () => _jsx("div", { children: "loading" }),
26
+ Stack: ({ children }) => _jsx("div", { children: children }),
27
+ TextField: ({ value, onChange, onKeyDown, InputProps }) => (_jsxs("div", { children: [InputProps?.startAdornment, _jsx("input", { "aria-label": "phrase", value: value, onChange: onChange, onKeyDown: onKeyDown }), InputProps?.endAdornment] })),
28
+ Typography: ({ children }) => _jsx("div", { children: children })
29
+ }));
30
+ vi.mock('@tui/core', () => ({
31
+ PageCenter: ({ children }) => _jsx("div", { children: children }),
32
+ parseEvent: (event) => ({ isEnter: event.key === 'Enter' })
33
+ }));
34
+ vi.mock('api', () => ({
35
+ default: {
36
+ search: {
37
+ user: {
38
+ post: (body) => body
39
+ }
40
+ }
41
+ }
42
+ }));
43
+ vi.mock('components/elements/addons/layout/vsbox/VSBox', () => ({
44
+ default: ({ children }) => _jsx("div", { children: children })
45
+ }));
46
+ vi.mock('components/elements/addons/layout/vsbox/VSBoxContent', () => ({
47
+ default: ({ children }) => _jsx("div", { children: children })
48
+ }));
49
+ vi.mock('components/elements/addons/layout/vsbox/VSBoxHeader', () => ({
50
+ default: ({ children }) => _jsx("div", { children: children })
51
+ }));
52
+ vi.mock('components/elements/addons/lists', () => ({
53
+ TuiListProvider: ({ children }) => _jsx("div", { children: children })
54
+ }));
55
+ vi.mock('components/elements/addons/lists/table/TuiTable', () => ({
56
+ default: ({ columns, onRowSelect, children }) => {
57
+ tableSelect = onRowSelect;
58
+ return (_jsxs("div", { children: [_jsx("div", { children: children(['group-a', 'group-b'], undefined, { column: 'groups' }) }), _jsx("div", { children: columns.map((column) => column.column).join(',') })] }));
59
+ }
60
+ }));
61
+ vi.mock('components/elements/addons/lists/TuiListProvider', () => ({
62
+ TuiListMethodContext: listMethodContextToken
63
+ }));
64
+ vi.mock('components/elements/addons/search/SearchPagination', () => ({
65
+ default: ({ onChange }) => _jsx("button", { onClick: () => onChange(30), children: "page" })
66
+ }));
67
+ vi.mock('components/elements/addons/search/SearchTotal', () => ({
68
+ default: ({ total }) => _jsx("div", { children: `total:${total}` })
69
+ }));
70
+ vi.mock('components/hooks/useMyApi', () => ({
71
+ default: () => ({ dispatchApi: mockDispatchApi })
72
+ }));
73
+ vi.mock('components/hooks/useMyLocalStorage', () => ({
74
+ useMyLocalStorageItem: () => [25]
75
+ }));
76
+ vi.mock('react-i18next', () => ({
77
+ useTranslation: () => ({ t: (key) => key })
78
+ }));
79
+ vi.mock('react-router', () => ({
80
+ Link: ({ children }) => _jsx("div", { children: children }),
81
+ useNavigate: () => mockNavigate,
82
+ useSearchParams: () => [searchParamsValue, mockSetSearchParams]
83
+ }));
84
+ vi.mock('utils/stringUtils', async (importOriginal) => {
85
+ const actual = await importOriginal();
86
+ return {
87
+ ...actual,
88
+ sanitizeLuceneQuery: (value) => value.replaceAll(':', '\\:')
89
+ };
90
+ });
91
+ vi.mock('react', async (importOriginal) => {
92
+ const actual = await importOriginal();
93
+ return {
94
+ ...actual,
95
+ useContext: (context) => {
96
+ if (context === listMethodContextToken) {
97
+ return { load: mockLoad };
98
+ }
99
+ return actual.useContext(context);
100
+ }
101
+ };
102
+ });
103
+ import UserSearchProvider from './UserSearch';
104
+ describe('UserSearch', () => {
105
+ beforeEach(() => {
106
+ searchParamsValue = new URLSearchParams();
107
+ tableSelect = undefined;
108
+ mockDispatchApi.mockReset().mockResolvedValue({
109
+ total: 1,
110
+ offset: 0,
111
+ rows: 25,
112
+ items: [{ username: 'alice', name: 'Alice', email: 'a@example.com', groups: ['group-a', 'group-b'] }]
113
+ });
114
+ mockNavigate.mockReset();
115
+ mockSetSearchParams.mockReset();
116
+ mockLoad.mockReset();
117
+ });
118
+ it('searches users, sanitizes input, paginates, clears, and navigates selected rows', async () => {
119
+ render(_jsx(UserSearchProvider, {}));
120
+ await waitFor(() => expect(mockDispatchApi).toHaveBeenCalled());
121
+ expect(mockLoad).toHaveBeenCalledWith([
122
+ {
123
+ id: 'alice',
124
+ item: { username: 'alice', name: 'Alice', email: 'a@example.com', groups: ['group-a', 'group-b'] }
125
+ }
126
+ ]);
127
+ fireEvent.change(screen.getByLabelText('phrase'), { target: { value: 'alice:demo' } });
128
+ fireEvent.keyDown(screen.getByLabelText('phrase'), { key: 'Enter' });
129
+ await waitFor(() => expect(mockDispatchApi.mock.calls.at(-1)?.[0]).toMatchObject({
130
+ query: 'name:*alice\\:demo* OR uname:*alice\\:demo* OR email:*alice\\:demo*',
131
+ rows: 25,
132
+ offset: 0
133
+ }));
134
+ fireEvent.click(screen.getByText('page'));
135
+ expect(mockSetSearchParams).toHaveBeenCalled();
136
+ fireEvent.click(screen.getByText('close-icon').closest('button'));
137
+ await waitFor(() => expect(mockDispatchApi.mock.calls.at(-1)?.[0]).toMatchObject({
138
+ query: 'name:*alice\\:demo* OR uname:*alice\\:demo* OR email:*alice\\:demo*'
139
+ }));
140
+ expect(screen.getByLabelText('phrase')).toHaveValue('');
141
+ tableSelect({ item: { username: 'alice' } });
142
+ expect(mockNavigate).toHaveBeenCalledWith('alice');
143
+ expect(screen.getByText('group-a')).toBeInTheDocument();
144
+ expect(screen.getByText('total:1')).toBeInTheDocument();
145
+ });
146
+ });
@@ -0,0 +1 @@
1
+ export {};