@hortiview/shared-components 2.18.0 → 2.19.0

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 (229) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/{AlertBanner-aW6joVUm.js → AlertBanner-BFzaGOer.js} +3 -3
  3. package/dist/{GenericCard-IWX-Bmb_.js → GenericCard-grpa3KJR.js} +3 -3
  4. package/dist/ListAreaService-Y8wR14Xq.js +126 -0
  5. package/dist/{_Map-D8db_GOu.js → _Map-BYxTn6ob.js} +1 -1
  6. package/dist/{_commonjsHelpers-B4e78b8K.js → _commonjsHelpers-ByX85dGu.js} +18 -13
  7. package/dist/animationframe-CqXArbwZ.js +32 -0
  8. package/dist/assets/ListAreaService.css +1 -1
  9. package/dist/assets/LoadingSpinner.css +1 -1
  10. package/dist/component-By6nyiBU.js +70 -0
  11. package/dist/{component-DEJuY56h.js → component-DYpB_4EP.js} +1 -111
  12. package/dist/components/AlertBanner/AlertBanner.js +4 -4
  13. package/dist/components/AlertBanner/LinkBanner.js +3 -3
  14. package/dist/components/AllowedButton/AllowedButton.d.ts +1 -1
  15. package/dist/components/AllowedButton/AllowedButton.js +1 -1
  16. package/dist/components/AllowedIconButton/AllowedIconButton.d.ts +1 -1
  17. package/dist/components/AllowedIconButton/AllowedIconButton.js +1 -1
  18. package/dist/components/BaseView/BaseView.js +14 -14
  19. package/dist/components/BasicHeading/BasicHeading.js +5 -5
  20. package/dist/components/BlockView/BlockView.js +2 -2
  21. package/dist/components/ButtonCard/ButtonCard.js +6 -6
  22. package/dist/components/ChipCard/ChipCard.js +13 -255
  23. package/dist/components/ConfirmationModal/ConfirmationModal.js +8 -8
  24. package/dist/components/ContextMenu/ContextMenu.js +12 -12
  25. package/dist/components/DeleteModal/DeleteModal.js +25 -25
  26. package/dist/components/DetailContentWrapper/DetailContentWrapper.js +1 -1
  27. package/dist/components/Disclaimer/Disclaimer.js +3 -3
  28. package/dist/components/EmptyView/EmptyView.d.ts +10 -1
  29. package/dist/components/EmptyView/EmptyView.js +50 -34
  30. package/dist/components/Filter/Filter.js +15 -15
  31. package/dist/components/FormComponents/FormCheckBox/FormCheckBox.js +1 -1
  32. package/dist/components/FormComponents/FormDatePicker/FormDatePicker.js +7 -22
  33. package/dist/components/FormComponents/FormNumber/CustomTextField.js +3 -3
  34. package/dist/components/FormComponents/FormNumber/FormNumber.js +1 -1
  35. package/dist/components/FormComponents/FormRadio/FormRadio.js +1 -1
  36. package/dist/components/FormComponents/FormSelect/FormSelect.js +4 -4
  37. package/dist/components/FormComponents/FormSelect/SelectTooltipText.js +2 -2
  38. package/dist/components/FormComponents/FormSlider/FormSlider.js +10 -98
  39. package/dist/components/FormComponents/FormText/FormText.js +2 -2
  40. package/dist/components/FormComponents/FormToggle/FormToggle.js +4 -4
  41. package/dist/components/FormattedNumberDisplay/FormattedNumberDisplay.js +1 -1
  42. package/dist/components/GenericTable/GenericTable.js +36 -172
  43. package/dist/components/GenericTable/GenericTableService.d.ts +4 -1
  44. package/dist/components/GenericTable/GenericTableService.js +24 -24
  45. package/dist/components/GenericTable/Mobile/GenericCard.js +4 -4
  46. package/dist/components/GenericTable/Mobile/GenericCardList.js +4 -4
  47. package/dist/components/HashTabView/HashTabView.js +10 -428
  48. package/dist/components/HeaderFilter/HeaderFilter.js +1 -1
  49. package/dist/components/Iconify/Iconify.js +2 -2
  50. package/dist/components/InfoCard/InfoCard.js +4 -4
  51. package/dist/components/InfoGroup/InfoGroup.js +4 -4
  52. package/dist/components/ListArea/ListArea.d.ts +5 -1
  53. package/dist/components/ListArea/ListArea.js +39 -36
  54. package/dist/components/ListArea/ListAreaService.js +6 -6
  55. package/dist/components/LoadingSpinner/Big/BigLoadingSpinner.js +13 -5
  56. package/dist/components/LoadingSpinner/Default/LoadingSpinner.js +44 -108
  57. package/dist/components/Modal/Modal.js +12 -122
  58. package/dist/components/ModulePadding/ModulePadding.js +11 -11
  59. package/dist/components/OfflineView/OfflineView.js +45 -7
  60. package/dist/components/OnboardingBanner/OnboardingBanner.js +8 -8
  61. package/dist/components/OverflowTooltip/OverflowTooltip.js +2 -2
  62. package/dist/components/SearchBar/SearchBar.js +2 -2
  63. package/dist/components/Select/Select.js +2 -2
  64. package/dist/components/Stepper/Stepper.js +1 -1
  65. package/dist/components/Stepper/components/StepperButton.js +1 -1
  66. package/dist/components/Stepper/components/StepperHeader.js +3 -3
  67. package/dist/components/Stepper/components/StepperItem.js +2 -2
  68. package/dist/{correct-is-regexp-logic-Y0ToWEjF.js → correct-is-regexp-logic-BJ-OWRrn.js} +1 -1
  69. package/dist/{defineProperty-BTsGZ3c1.js → defineProperty-B7N9EBBI.js} +3 -3
  70. package/dist/{es.string.iterator-UszlTFwY.js → es.string.iterator-DBx2A42F.js} +2 -2
  71. package/dist/{find-CHg-_ooq.js → find-eU9ab_u7.js} +4 -4
  72. package/dist/{get-DxjPG00Z.js → get-BLvvbtML.js} +3 -3
  73. package/dist/get-CBFiuc3f.js +7 -0
  74. package/dist/hooks/useBreakpoints.js +37 -3
  75. package/dist/hooks/useHelperText.js +1 -1
  76. package/dist/{identity-BVIVr9qu.js → identity-B0bbReND.js} +4 -4
  77. package/dist/{index-BcGujPyk.js → index-Df2FYN-K.js} +5 -26
  78. package/dist/{index.es-B8p8KCdj.js → index.es-B19PQgzU.js} +4 -4
  79. package/dist/{index.es-BYcQTTL8.js → index.es-B9BUXRQn.js} +9 -339
  80. package/dist/{index.es-BPv5dCFQ.js → index.es-BOG3_7IM.js} +12 -12
  81. package/dist/{index.es-DGoBge9W.js → index.es-BOvO8moE.js} +4 -4
  82. package/dist/{index.es-BoUnovl_.js → index.es-BcnmoCEg.js} +8 -74
  83. package/dist/{index.es-C32E1Lcb.js → index.es-BwafUoK3.js} +82 -147
  84. package/dist/{index.es-B1h6DPYp.js → index.es-C27R5Xae.js} +2 -2
  85. package/dist/{index.es-nwjKmW7-.js → index.es-C2IOpX7R.js} +34 -111
  86. package/dist/{index.es-Da7ok-B-.js → index.es-C6I3L4U4.js} +2 -2
  87. package/dist/{index.es-BHvm4m-B.js → index.es-Cg57snrN.js} +19 -261
  88. package/dist/{index.es-DUTChZks.js → index.es-Ci3O23C_.js} +6 -72
  89. package/dist/{index.es-t87yNd9Y.js → index.es-CkB4776y.js} +6 -72
  90. package/dist/{index.es-CeQB6igi.js → index.es-Cr1PSTyq.js} +3 -3
  91. package/dist/{index.es--C-VLspF.js → index.es-D1iB_QlE.js} +8 -140
  92. package/dist/{index.es-Dgxrk6xW.js → index.es-DEBGoIKX.js} +2 -2
  93. package/dist/{index.es-CWyjqoEE.js → index.es-DHnCVuQ8.js} +7 -73
  94. package/dist/{index.es-Bo-d_yTV.js → index.es-DHoIQ8lu.js} +2 -2
  95. package/dist/{index.es-SjZ_-d7U.js → index.es-DUrjyxNI.js} +5 -5
  96. package/dist/{index.es-Cfv794DG.js → index.es-DdeCB7LW.js} +1 -1
  97. package/dist/{index.es-BanVdXEd.js → index.es-DgncYOqO.js} +2 -2
  98. package/dist/{index.es-DOnQ26kT.js → index.es-DhlgTSuU.js} +3 -3
  99. package/dist/{index.es-oxil0uFe.js → index.es-Z0aF-7Cn.js} +3 -6
  100. package/dist/{index.es-DmRhbgqK.js → index.es-l_3PNohs.js} +2 -68
  101. package/dist/{isArray-B457bpaW.js → isArray-Ce1Q96lU.js} +1 -1
  102. package/dist/isArray-olhCpv2e.js +7 -0
  103. package/dist/{isEmpty-BnfHn4bl.js → isEmpty-l2xQKl4x.js} +3 -3
  104. package/dist/{isString-DVA49FEo.js → isString-BNdV0Jpg.js} +3 -3
  105. package/dist/{isTypedArray-DziahYkI.js → isTypedArray-D39qzPYE.js} +2 -2
  106. package/dist/{keyboard-DiKJoabs.js → keyboard-DbG3oyPU.js} +3 -25
  107. package/dist/main.js +15 -15
  108. package/dist/{map-BprzXv4m.js → map-ZSVweMI1.js} +5 -5
  109. package/dist/{omit-CYY_mIYv.js → omit-BWQrFyQ-.js} +7 -7
  110. package/dist/{orderBy-DLBJlgdL.js → orderBy-Ce85KqD6.js} +7 -7
  111. package/dist/{parse-int-D-3oah_F.js → parse-int-CGpIXMGa.js} +2 -2
  112. package/dist/{react-number-format.es-DzkMiF8j.js → react-number-format.es-pczkQ4lQ.js} +0 -1
  113. package/dist/{react-tooltip.min-CVsI--2Y.js → react-tooltip.min-Dkz5ltCC.js} +1 -12
  114. package/dist/{react.esm-Bm0cAgpZ.js → react.esm-DF7i80eN.js} +2471 -2582
  115. package/dist/services/UtilService.js +9 -9
  116. package/dist/{slicedToArray-ByMQIs5x.js → slicedToArray-DC6VAZtW.js} +4 -4
  117. package/dist/test-utils.js +1 -1
  118. package/dist/{toString-B7FIT8FE.js → toString-D5bEU-DN.js} +1 -1
  119. package/dist/types/GenericTable.d.ts +3 -3
  120. package/dist/{uniqueId-BNVTeImh.js → uniqueId-CJo-XRQb.js} +2 -2
  121. package/dist/{util-DA21pZXj.js → util-CBo-ipCE.js} +0 -22
  122. package/package.json +2 -2
  123. package/dist/BigLoadingSpinner-DGj9_Z5J.js +0 -16
  124. package/dist/ListAreaService-Fsm3-gDM.js +0 -125
  125. package/dist/OfflineView-CIwV08EQ.js +0 -48
  126. package/dist/animationframe-BVKDmEXe.js +0 -54
  127. package/dist/component-Bz_dtX1r.js +0 -114
  128. package/dist/components/AlertBanner/AlertBanner.test.d.ts +0 -1
  129. package/dist/components/AlertBanner/AlertBanner.test.js +0 -34
  130. package/dist/components/AlertBanner/LinkBanner.test.d.ts +0 -1
  131. package/dist/components/AlertBanner/LinkBanner.test.js +0 -17
  132. package/dist/components/Allowed/Allowed.test.d.ts +0 -1
  133. package/dist/components/Allowed/Allowed.test.js +0 -49
  134. package/dist/components/AllowedButton/AllowedButton.test.d.ts +0 -1
  135. package/dist/components/AllowedButton/AllowedButton.test.js +0 -126
  136. package/dist/components/AllowedIconButton/AllowedIconButton.test.d.ts +0 -1
  137. package/dist/components/AllowedIconButton/AllowedIconButton.test.js +0 -121
  138. package/dist/components/BaseView/BaseView.test.d.ts +0 -1
  139. package/dist/components/BaseView/BaseView.test.js +0 -180
  140. package/dist/components/BasicHeading/BasicHeading.test.d.ts +0 -1
  141. package/dist/components/BasicHeading/BasicHeading.test.js +0 -36
  142. package/dist/components/BlockView/BlockView.test.d.ts +0 -1
  143. package/dist/components/BlockView/BlockView.test.js +0 -47
  144. package/dist/components/ButtonCard/ButtonCard.test.d.ts +0 -1
  145. package/dist/components/ButtonCard/ButtonCard.test.js +0 -92
  146. package/dist/components/ChipCard/ChipCard.test.d.ts +0 -1
  147. package/dist/components/ChipCard/ChipCard.test.js +0 -25
  148. package/dist/components/ConfirmationModal/ConfirmationModal.test.d.ts +0 -1
  149. package/dist/components/ConfirmationModal/ConfirmationModal.test.js +0 -221
  150. package/dist/components/ContextMenu/ContextMenu.test.d.ts +0 -1
  151. package/dist/components/ContextMenu/ContextMenu.test.js +0 -96
  152. package/dist/components/DeleteModal/DeleteModal.test.d.ts +0 -1
  153. package/dist/components/DeleteModal/DeleteModal.test.js +0 -132
  154. package/dist/components/Disclaimer/Disclaimer.test.d.ts +0 -1
  155. package/dist/components/Disclaimer/Disclaimer.test.js +0 -13
  156. package/dist/components/EmptyView/EmptyView.test.d.ts +0 -1
  157. package/dist/components/EmptyView/EmptyView.test.js +0 -50
  158. package/dist/components/Filter/Filter.test.d.ts +0 -1
  159. package/dist/components/Filter/Filter.test.js +0 -166
  160. package/dist/components/FormComponents/FormCheckBox/FormCheckBox.test.d.ts +0 -1
  161. package/dist/components/FormComponents/FormCheckBox/FormCheckBox.test.js +0 -56
  162. package/dist/components/FormComponents/FormDatePicker/FormDatePicker.test.d.ts +0 -1
  163. package/dist/components/FormComponents/FormDatePicker/FormDatePicker.test.js +0 -56
  164. package/dist/components/FormComponents/FormNumber/FormNumber.test.d.ts +0 -1
  165. package/dist/components/FormComponents/FormNumber/FormNumber.test.js +0 -51
  166. package/dist/components/FormComponents/FormRadio/FormRadio.test.d.ts +0 -1
  167. package/dist/components/FormComponents/FormRadio/FormRadio.test.js +0 -73
  168. package/dist/components/FormComponents/FormSelect/FormSelect.test.d.ts +0 -1
  169. package/dist/components/FormComponents/FormSelect/FormSelect.test.js +0 -226
  170. package/dist/components/FormComponents/FormSlider/FormSlider.test.d.ts +0 -1
  171. package/dist/components/FormComponents/FormSlider/FormSlider.test.js +0 -49
  172. package/dist/components/FormComponents/FormText/FormText.test.d.ts +0 -1
  173. package/dist/components/FormComponents/FormText/FormText.test.js +0 -113
  174. package/dist/components/FormComponents/FormToggle/FormToggle.test.d.ts +0 -1
  175. package/dist/components/FormComponents/FormToggle/FormToggle.test.js +0 -54
  176. package/dist/components/GenericTable/GenericTable.test.d.ts +0 -1
  177. package/dist/components/GenericTable/GenericTable.test.js +0 -115
  178. package/dist/components/GenericTable/Mobile/GenericCard.test.d.ts +0 -1
  179. package/dist/components/GenericTable/Mobile/GenericCard.test.js +0 -76
  180. package/dist/components/GenericTable/Mobile/GenericCardList.test.d.ts +0 -1
  181. package/dist/components/GenericTable/Mobile/GenericCardList.test.js +0 -75
  182. package/dist/components/HashTabView/HashTabView.test.d.ts +0 -1
  183. package/dist/components/HashTabView/HashTabView.test.js +0 -31
  184. package/dist/components/HeaderFilter/HeaderFilter.test.d.ts +0 -1
  185. package/dist/components/HeaderFilter/HeaderFilter.test.js +0 -46
  186. package/dist/components/Iconify/Iconify.test.d.ts +0 -1
  187. package/dist/components/Iconify/Iconify.test.js +0 -28
  188. package/dist/components/InfoCard/InfoCard.test.d.ts +0 -1
  189. package/dist/components/InfoCard/InfoCard.test.js +0 -48
  190. package/dist/components/InfoGroup/InfoGroup.test.d.ts +0 -1
  191. package/dist/components/InfoGroup/InfoGroup.test.js +0 -40
  192. package/dist/components/ListArea/ListArea.test.d.ts +0 -1
  193. package/dist/components/ListArea/ListArea.test.js +0 -110
  194. package/dist/components/LoadingSpinner/Big/BigLoadingSpinner.test.d.ts +0 -1
  195. package/dist/components/LoadingSpinner/Big/BigLoadingSpinner.test.js +0 -15
  196. package/dist/components/LoadingSpinner/Default/LoadingSpinner.test.d.ts +0 -1
  197. package/dist/components/LoadingSpinner/Default/LoadingSpinner.test.js +0 -20
  198. package/dist/components/ModulePadding/ModulePadding.test.d.ts +0 -1
  199. package/dist/components/ModulePadding/ModulePadding.test.js +0 -22
  200. package/dist/components/OfflineView/OfflineView.test.d.ts +0 -1
  201. package/dist/components/OfflineView/OfflineView.test.js +0 -24
  202. package/dist/components/OnboardingBanner/OnboardingBanner.test.d.ts +0 -1
  203. package/dist/components/OnboardingBanner/OnboardingBanner.test.js +0 -72
  204. package/dist/components/OverflowTooltip/OverflowTooltip.test.d.ts +0 -1
  205. package/dist/components/OverflowTooltip/OverflowTooltip.test.js +0 -37
  206. package/dist/components/PermissionChecks/PermissionService.test.d.ts +0 -1
  207. package/dist/components/PermissionChecks/PermissionService.test.js +0 -91
  208. package/dist/components/SafeForm/SafeForm.test.d.ts +0 -1
  209. package/dist/components/SafeForm/SafeForm.test.js +0 -91
  210. package/dist/components/Scrollbar/scrollbar.test.d.ts +0 -1
  211. package/dist/components/Scrollbar/scrollbar.test.js +0 -15
  212. package/dist/components/SearchBar/SearchBar.test.d.ts +0 -1
  213. package/dist/components/SearchBar/SearchBar.test.js +0 -23
  214. package/dist/components/Select/Select.test.d.ts +0 -1
  215. package/dist/components/Select/Select.test.js +0 -28
  216. package/dist/components/Stepper/Stepper.test.d.ts +0 -1
  217. package/dist/components/Stepper/Stepper.test.js +0 -342
  218. package/dist/components/VerticalDivider/VerticalDivider.test.d.ts +0 -1
  219. package/dist/components/VerticalDivider/VerticalDivider.test.js +0 -15
  220. package/dist/get-D8IXqiys.js +0 -7
  221. package/dist/hooks/useBreakpoints.test.d.ts +0 -1
  222. package/dist/hooks/useBreakpoints.test.js +0 -11
  223. package/dist/index-BLPBqbdx.js +0 -11025
  224. package/dist/isArray-BjSPDQ4v.js +0 -7
  225. package/dist/magic-string.es-uPKorP4O.js +0 -663
  226. package/dist/services/services.test.d.ts +0 -1
  227. package/dist/services/services.test.js +0 -106
  228. package/dist/useBreakpoints-MzTZ0tCT.js +0 -45
  229. package/dist/vi.bdSIJ99Y-B308Q-4w.js +0 -11963
@@ -1,48 +0,0 @@
1
- import { jsx as a } from "react/jsx-runtime";
2
- import { a as r, s as t } from "../../react.esm-Bm0cAgpZ.js";
3
- import { InfoCard as n } from "./InfoCard.js";
4
- import { d as l, t as i, g as o } from "../../vi.bdSIJ99Y-B308Q-4w.js";
5
- l("HealthCheckFailed Component", () => {
6
- const c = "Test Title", s = "Test Subtitle";
7
- i("displays the correct title and subtitle", () => {
8
- r(/* @__PURE__ */ a(n, { title: c, subtitle: s, type: "database" })), o(t.getByText(c)).toBeInTheDocument(), o(t.getByText(s)).toBeInTheDocument();
9
- }), i('displays the correct icon for type "database"', () => {
10
- r(/* @__PURE__ */ a(n, { title: c, subtitle: s, type: "database" }));
11
- const e = t.getByText("sync");
12
- o(e).toBeInTheDocument(), o(t.getByTestId("database-health-check-failed-card")).toBeInTheDocument();
13
- }), i('displays the correct icon for type "iot"', () => {
14
- r(/* @__PURE__ */ a(n, { title: c, subtitle: s, type: "iot" }));
15
- const e = t.getByText("settings_input_antenna");
16
- o(e).toBeInTheDocument(), o(t.getByTestId("iot-health-check-failed-card")).toBeInTheDocument();
17
- }), i('displays the correct icon for type "platform"', () => {
18
- r(/* @__PURE__ */ a(n, { title: c, subtitle: s, type: "platform" }));
19
- const e = t.getByText("engineering");
20
- o(e).toBeInTheDocument(), o(t.getByTestId("platform-health-check-failed-card")).toBeInTheDocument();
21
- }), i('displays the correct icon for type "other"', () => {
22
- r(/* @__PURE__ */ a(n, { title: c, subtitle: s, type: "other" }));
23
- const e = t.getByText("error");
24
- o(e).toBeInTheDocument(), o(t.getByTestId("other-health-check-failed-card")).toBeInTheDocument();
25
- }), i('displays the correct icon for type "celebration"', () => {
26
- r(/* @__PURE__ */ a(n, { title: c, subtitle: s, type: "celebration" }));
27
- const e = t.getByText("celebration");
28
- o(e).toBeInTheDocument(), o(t.getByTestId("celebration-health-check-failed-card")).toBeInTheDocument();
29
- }), i("applies colorOverride class for primary", () => {
30
- r(/* @__PURE__ */ a(n, { title: c, subtitle: s, type: "database", colorOverride: "primary" }));
31
- const e = t.getByText("sync").closest("span")?.querySelector("svg, span, i");
32
- o(e?.className).toMatch(/primary/);
33
- }), i("applies colorOverride class for secondary", () => {
34
- r(
35
- /* @__PURE__ */ a(n, { title: c, subtitle: s, type: "database", colorOverride: "secondary" })
36
- );
37
- const e = t.getByText("sync").closest("span")?.querySelector("svg, span, i");
38
- o(e?.className).toMatch(/secondary/);
39
- }), i("applies colorOverride class for success", () => {
40
- r(/* @__PURE__ */ a(n, { title: c, subtitle: s, type: "database", colorOverride: "success" }));
41
- const e = t.getByText("sync").closest("span")?.querySelector("svg, span, i");
42
- o(e?.className).toMatch(/success/);
43
- }), i("applies colorOverride class for danger", () => {
44
- r(/* @__PURE__ */ a(n, { title: c, subtitle: s, type: "database", colorOverride: "danger" }));
45
- const e = t.getByText("sync").closest("span")?.querySelector("svg, span, i");
46
- o(e?.className).toMatch(/danger/);
47
- });
48
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,40 +0,0 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import { a as l, s as t } from "../../react.esm-Bm0cAgpZ.js";
3
- import { InfoGroup as r } from "./InfoGroup.js";
4
- import { d as s, t as i, g as e } from "../../vi.bdSIJ99Y-B308Q-4w.js";
5
- s("InfoGroup Test", () => {
6
- i("render Single InfoGroup", () => {
7
- l(/* @__PURE__ */ o(r, { fields: m }));
8
- const a = t.getAllByTestId("infoGroupItem");
9
- e(a.length).toBe(3);
10
- const n = t.getAllByTestId("infoGroupValue");
11
- e(a.length).toBe(3), e(t.getByText("organization.create.registration-number")).toBeInTheDocument(), e(n[0]).toHaveTextContent("123"), e(t.getByText("myOrganizations.label-primary-contact")).toBeInTheDocument(), e(n[1]).toHaveTextContent("User A"), e(t.getByText("myOrganizations.label-contact")).toBeInTheDocument(), e(n[2]).toHaveTextContent("User B");
12
- }), i("render Multi InfoGroup", () => {
13
- l(/* @__PURE__ */ o(r, { fields: [
14
- [
15
- { label: "organization.create.registration-number", value: "123" },
16
- { label: "myOrganizations.label-primary-contact", value: "User A" }
17
- ],
18
- [
19
- { label: "myOrganizations.label-contact", value: "User B" },
20
- {
21
- label: "organization.something-else",
22
- value: "some"
23
- }
24
- ]
25
- ] }));
26
- const n = t.getAllByTestId("infoGroupValue");
27
- e(n.length).toBe(4), e(t.getByText("organization.create.registration-number")).toBeInTheDocument(), e(n[0]).toHaveTextContent("123"), e(t.getByText("myOrganizations.label-primary-contact")).toBeInTheDocument(), e(n[1]).toHaveTextContent("User A"), e(t.getByTestId("infoGroup")).toBeInTheDocument(), e(t.getByTestId("singleRow")).toBeInTheDocument(), e(t.getAllByTestId("infoGroupItem").length).toBe(4), e(t.getByText("myOrganizations.label-contact")).toBeInTheDocument(), e(n[2]).toHaveTextContent("User B"), e(t.getByText("organization.something-else")).toBeInTheDocument(), e(n[3]).toHaveTextContent("some");
28
- }), i("render Single InfoGroup with component", () => {
29
- l(/* @__PURE__ */ o(r, { fields: [
30
- { label: "labelSouldntBeRendered", component: /* @__PURE__ */ o("div", { children: "Component" }) },
31
- { label: "myOrganizations.label-primary-contact", value: "User A" },
32
- { label: "componentWithLabel", componentVariant: "embedded", component: /* @__PURE__ */ o("div", { children: "Badge" }) }
33
- ] })), e(t.queryByText("labelSouldntBeRendered")).toBeNull(), e(t.getByText("Component")).toBeInTheDocument(), e(t.getByText("myOrganizations.label-primary-contact")).toBeInTheDocument(), e(t.getByText("User A")).toBeInTheDocument(), e(t.getByText("componentWithLabel")).toBeInTheDocument(), e(t.getByText("Badge")).toBeInTheDocument();
34
- });
35
- });
36
- const m = [
37
- { label: "organization.create.registration-number", value: "123" },
38
- { label: "myOrganizations.label-primary-contact", value: "User A" },
39
- { label: "myOrganizations.label-contact", value: "User B" }
40
- ];
@@ -1 +0,0 @@
1
- export {};
@@ -1,110 +0,0 @@
1
- import { jsx as r, Fragment as i } from "react/jsx-runtime";
2
- import { P as m } from "../../index.es-BanVdXEd.js";
3
- import { c as u } from "../../index.es-SjZ_-d7U.js";
4
- import { a as s, s as a, f as c } from "../../react.esm-Bm0cAgpZ.js";
5
- import { ListArea as l } from "./ListArea.js";
6
- import { g as h } from "../../ListAreaService-Fsm3-gDM.js";
7
- import { d, t as n, g as t } from "../../vi.bdSIJ99Y-B308Q-4w.js";
8
- d("ListArea Test", () => {
9
- const o = [
10
- {
11
- id: "1",
12
- title: "user.personal_information",
13
- icon: "account_circle",
14
- route: "/personal-profile/personal-information",
15
- component: /* @__PURE__ */ r(i, { children: "Personal information selected" })
16
- },
17
- {
18
- id: "2",
19
- title: "user.data_privacy",
20
- icon: "privacy_tip",
21
- route: "/personal-profile/data-privacy",
22
- component: /* @__PURE__ */ r(i, { children: "Data Privacy selected" })
23
- },
24
- {
25
- id: "3",
26
- title: "user.security",
27
- icon: "security",
28
- route: "/personal-profile/security",
29
- component: /* @__PURE__ */ r(i, { children: "Security selected" })
30
- }
31
- ];
32
- n("render ListArea options properly", () => {
33
- s(
34
- /* @__PURE__ */ r(
35
- l,
36
- {
37
- elements: o,
38
- pathname: "/personal-profile/data-privacy",
39
- routerLinkElement: void 0
40
- }
41
- )
42
- );
43
- const e = a.getAllByRole("option");
44
- t(e.length).toBe(3), t(e[0]).toHaveTextContent(/privacy_tip/), t(e[0]).toHaveTextContent(/user.data_privacy/), t(e[0]).toHaveTextContent(/arrow_right/), t(e[1]).toHaveTextContent(/account_circle/), t(e[1]).toHaveTextContent(/user.personal_information/), t(e[1]).toHaveTextContent(/arrow_right/), t(e[2]).toHaveTextContent(/security/), t(e[2]).toHaveTextContent(/user.security/), t(e[2]).toHaveTextContent(/arrow_right/);
45
- }), n("render ListArea with search bar", () => {
46
- s(
47
- /* @__PURE__ */ r(
48
- l,
49
- {
50
- elements: o,
51
- hasSearch: !0,
52
- searchPlaceholder: "search",
53
- pathname: "/personal-profile/data-privacy",
54
- routerLinkElement: void 0
55
- }
56
- )
57
- );
58
- const e = a.getByTestId("search-bar-input");
59
- t(e).toBeInTheDocument(), c.focus(e), t(e).toHaveAttribute("placeholder", "search");
60
- }), n("filter ListArea options on setting search value", () => {
61
- s(
62
- /* @__PURE__ */ r(
63
- l,
64
- {
65
- elements: o,
66
- hasSearch: !0,
67
- pathname: "/personal-profile/data-privacy",
68
- routerLinkElement: void 0
69
- }
70
- )
71
- );
72
- const e = a.getByTestId("search-bar-input");
73
- c.focus(e), c.change(e, { target: { value: "personal" } });
74
- const p = a.getAllByRole("option");
75
- t(p.length).toBe(1), t(p[0]).toHaveTextContent(/user.personal_information/);
76
- });
77
- });
78
- d("ListAreaService Test", () => {
79
- const o = [
80
- {
81
- id: "1",
82
- groupName: "farm-1",
83
- title: "GH1",
84
- icon: "grass",
85
- route: "/farm-1/gh1"
86
- },
87
- {
88
- id: "2",
89
- groupName: "farm-1",
90
- title: "GH2",
91
- icon: "grass",
92
- route: "/farm-1/gh2"
93
- },
94
- {
95
- id: "3",
96
- groupName: "farm-2",
97
- title: "GH3",
98
- icon: "grass",
99
- route: "/farm-2/gh3"
100
- }
101
- ];
102
- n("should return grouped items", () => {
103
- const e = h(o, "", "", void 0);
104
- t(e.length).toBe(2), t(e[0].groupName).toStrictEqual(
105
- /* @__PURE__ */ r(m, { children: /* @__PURE__ */ r(u, { children: "farm-1" }) })
106
- ), t(e[0].items.length).toBe(2), t(e[1].groupName).toStrictEqual(
107
- /* @__PURE__ */ r(m, { children: /* @__PURE__ */ r(u, { children: "farm-2" }) })
108
- ), t(e[1].items.length).toBe(1);
109
- });
110
- });
@@ -1,15 +0,0 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import { s as r, B as n } from "../../../BigLoadingSpinner-DGj9_Z5J.js";
3
- import { a as i, s as e } from "../../../react.esm-Bm0cAgpZ.js";
4
- import { d as g, t as a, g as t } from "../../../vi.bdSIJ99Y-B308Q-4w.js";
5
- g("BigLoadingSpinner Test", () => {
6
- a("render BigLoadingSpinner with custom loading text", () => {
7
- i(/* @__PURE__ */ o(n, { text: "Please wait..." })), t(e.getByText("Please wait...")).toBeInTheDocument(), t(e.getByRole("progressbar")).toBeInTheDocument();
8
- }), a("renders BigLoadingSpinner with default loading text", () => {
9
- i(/* @__PURE__ */ o(n, { text: "loadingtext" })), t(e.getByText("loadingtext")).toBeInTheDocument();
10
- }), a('Icon component contains className attribute "logo"', () => {
11
- i(/* @__PURE__ */ o(n, {}));
12
- const s = e.getByTestId("logo-icon");
13
- t(s).toHaveClass(r.logo);
14
- });
15
- });
@@ -1,20 +0,0 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import { a, s as e } from "../../../react.esm-Bm0cAgpZ.js";
3
- import { act as s } from "react";
4
- import { LoadingSpinner as i } from "./LoadingSpinner.js";
5
- import { d as m, b as d, t as o, g as t, v as r } from "../../../vi.bdSIJ99Y-B308Q-4w.js";
6
- m("LoadingSpinner Test", () => {
7
- d(() => {
8
- r.useFakeTimers();
9
- }), o("render LoadingSpinner without additional params", () => {
10
- a(/* @__PURE__ */ n(i, {})), t(e.getByRole("progressbar")).toBeInTheDocument();
11
- }), o("render LoadingSpinner with spinner only", () => {
12
- a(/* @__PURE__ */ n(i, { spinnerOnly: !0 })), t(e.getByRole("progressbar")).toBeInTheDocument(), t(e.queryByText("Loading")).not.toBeInTheDocument();
13
- }), o("render LoadingSpinner with custom loading text", () => {
14
- a(/* @__PURE__ */ n(i, { text: "Please wait..." })), t(e.getByText("Please wait...")).toBeInTheDocument();
15
- }), o("render loadingspinner with text changed to impatience message after 10 seconds", async () => {
16
- a(/* @__PURE__ */ n(i, { text: "Please wait...", impatienceTimeout: 1 })), t(e.getByText("Please wait...")).toBeInTheDocument(), s(() => {
17
- r.advanceTimersByTime(2e3);
18
- }), t(e.getByText("This is taking longer than expected. Please be patient.")).toBeInTheDocument();
19
- });
20
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,22 +0,0 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- import { a as o, s as e } from "../../react.esm-Bm0cAgpZ.js";
3
- import { a } from "../../useBreakpoints-MzTZ0tCT.js";
4
- import { ModulePadding as d } from "./ModulePadding.js";
5
- import { d as r, t as i, a as n, g as s } from "../../vi.bdSIJ99Y-B308Q-4w.js";
6
- r("ModulePadding Test", () => {
7
- i("should render with padding of 16px for desktop", () => {
8
- n.spyOn(a, "useBreakpoints").mockReturnValue({
9
- isMobile: !1,
10
- isTablet: !1,
11
- isDesktop: !0,
12
- isDesktopNavbar: !0
13
- }), o(/* @__PURE__ */ t(d, { children: "Content" })), s(e.getByText("Content")).toBeInTheDocument(), s(e.getByTestId("module-padding")).toHaveClass("lmnt-padding--standard");
14
- }), i("should render with padding of 8px for mobile", () => {
15
- n.spyOn(a, "useBreakpoints").mockReturnValue({
16
- isMobile: !0,
17
- isTablet: !1,
18
- isDesktop: !1,
19
- isDesktopNavbar: !1
20
- }), o(/* @__PURE__ */ t(d, { children: "Content" })), s(e.getByTestId("module-padding")).toHaveClass("lmnt-padding--dense");
21
- });
22
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,24 +0,0 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import { a as n, s as t, f as u } from "../../react.esm-Bm0cAgpZ.js";
3
- import { s as r, O as i } from "../../OfflineView-CIwV08EQ.js";
4
- import { d as B, t as l, g as e, a as c } from "../../vi.bdSIJ99Y-B308Q-4w.js";
5
- B("OfflineView", () => {
6
- l("should render OfflineView with title and subtitle", () => {
7
- n(/* @__PURE__ */ o(i, { title: "test-title", subtitle: "test-subtitle" })), e(t.getByTestId("offline-view-container")).toBeInTheDocument(), e(t.getByText("test-title")).toBeInTheDocument(), e(t.getByText("test-subtitle")).toBeInTheDocument(), e(t.queryByText("cloud_off")).toBeInTheDocument();
8
- }), l("should render without subtitle", () => {
9
- n(/* @__PURE__ */ o(i, { title: "test-title" })), e(t.getByTestId("offline-view-container")).toBeInTheDocument(), e(t.getByText("test-title")).toBeInTheDocument(), e(t.queryByText("test-subtitle")).not.toBeInTheDocument();
10
- }), l("should render custom icon", () => {
11
- n(/* @__PURE__ */ o(i, { title: "test-title", icon: "add" })), e(t.getByTestId("offline-view-container")).toBeInTheDocument(), e(t.getByText("test-title")).toBeInTheDocument(), e(t.getByText("add")).toBeInTheDocument();
12
- }), l("should render the small offline view", () => {
13
- n(/* @__PURE__ */ o(i, { title: "test-title", size: "small" })), e(t.getByText("test-title")).toHaveClass("mdc-typography--subtitle1");
14
- }), l("should render the filled offline view", () => {
15
- n(/* @__PURE__ */ o(i, { title: "test-title", variant: "filled", "data-testid": "test" })), e(t.getByTestId("test")).toHaveClass(r.bgGrey);
16
- }), l("should render OfflineView with button", () => {
17
- n(/* @__PURE__ */ o(i, { title: "test-title", buttonLabel: "Button" })), e(t.getByText("Button")).toBeInTheDocument(), e(t.getByRole("button")).toBeInTheDocument();
18
- }), l("calls onClick when button is clicked", () => {
19
- const s = c.fn();
20
- n(/* @__PURE__ */ o(i, { title: "test-title", buttonLabel: "Button", onClick: s })), u.click(t.getByText("Button")), e(s).toHaveBeenCalled();
21
- }), l("should render OfflineView without button", () => {
22
- n(/* @__PURE__ */ o(i, { title: "test-title" })), e(t.queryByText("Button")).not.toBeInTheDocument(), e(t.queryByRole("button")).not.toBeInTheDocument();
23
- });
24
- });
@@ -1,72 +0,0 @@
1
- import { jsx as n, Fragment as d } from "react/jsx-runtime";
2
- import { a as o, s as e } from "../../react.esm-Bm0cAgpZ.js";
3
- import { OnboardingBanner as i } from "./OnboardingBanner.js";
4
- import { d as a, t as s, a as r, g as t } from "../../vi.bdSIJ99Y-B308Q-4w.js";
5
- a("Onboarding Banner Test", () => {
6
- s("render OnboardingBanner with headline & description text", () => {
7
- o(
8
- /* @__PURE__ */ n(
9
- i,
10
- {
11
- headline: "test",
12
- description: "test description",
13
- isVisible: !0,
14
- onClose: r.fn()
15
- }
16
- )
17
- ), t(e.getByText("test")).toBeInTheDocument(), t(e.getByText("test description")).toBeInTheDocument();
18
- }), s("render OnboardingBanner with media content", () => {
19
- o(
20
- /* @__PURE__ */ n(
21
- i,
22
- {
23
- headline: "test",
24
- description: "test description",
25
- mediaContent: /* @__PURE__ */ n(d, { children: "Element" }),
26
- isVisible: !0,
27
- onClose: r.fn()
28
- }
29
- )
30
- ), t(e.getByText("Element")).toBeInTheDocument();
31
- }), s("render OnboardingBanner with buttons", () => {
32
- o(
33
- /* @__PURE__ */ n(
34
- i,
35
- {
36
- headline: "test",
37
- description: "test description",
38
- isVisible: !0,
39
- onClose: r.fn(),
40
- buttons: [{ label: "button-1", id: "1" }, { label: "button-2", id: "2" }]
41
- }
42
- )
43
- ), t(e.getByText("button-1")).toBeInTheDocument(), t(e.getByText("button-2")).toBeInTheDocument(), t(e.queryByText("button-3")).not.toBeInTheDocument();
44
- }), s("calls onClose when close button is clicked", () => {
45
- const l = r.fn();
46
- o(
47
- /* @__PURE__ */ n(
48
- i,
49
- {
50
- headline: "test",
51
- description: "test description",
52
- isVisible: !0,
53
- onClose: l,
54
- buttons: [{ label: "button-1", id: "1" }, { label: "button-2", id: "2" }]
55
- }
56
- )
57
- ), e.getByTestId("onboarding-banner-close-button").click(), t(l).toHaveBeenCalledTimes(1);
58
- }), s("renders nothing when isVisibility is false", () => {
59
- o(
60
- /* @__PURE__ */ n(
61
- i,
62
- {
63
- headline: "test",
64
- description: "test description",
65
- isVisible: !1,
66
- onClose: r.fn(),
67
- buttons: [{ label: "button-1", id: "1" }, { label: "button-2", id: "2" }]
68
- }
69
- )
70
- ), t(e.queryByText("test")).not.toBeInTheDocument();
71
- });
72
- });
@@ -1,37 +0,0 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- import { b as n } from "../../index.es-SjZ_-d7U.js";
3
- import { a as i, s as e, w as s } from "../../react.esm-Bm0cAgpZ.js";
4
- import { u as a } from "../../index-BLPBqbdx.js";
5
- import { OverflowTooltip as c } from "./OverflowTooltip.js";
6
- import { d as u, t as p, g as r } from "../../vi.bdSIJ99Y-B308Q-4w.js";
7
- u("OverflowTooltip Test", () => {
8
- p("should render OverflowTooltip on hover", async () => {
9
- Object.defineProperty(HTMLElement.prototype, "clientWidth", {
10
- configurable: !0,
11
- value: 100
12
- }), Object.defineProperty(HTMLElement.prototype, "scrollWidth", {
13
- configurable: !0,
14
- value: 200
15
- });
16
- const l = a.setup(), o = "Block name that should be truncated with an ellipsis because it is very very loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong";
17
- i(
18
- /* @__PURE__ */ t(c, { id: o, text: o, children: /* @__PURE__ */ t(n, { children: o }) })
19
- ), r(e.getByText(o)).toBeInTheDocument(), l.hover(e.getByText(o)), await s(() => {
20
- r(e.getByRole("tooltip")).toBeInTheDocument();
21
- });
22
- }), p("should not render OverflowTooltip on hover", async () => {
23
- Object.defineProperty(HTMLElement.prototype, "clientWidth", {
24
- configurable: !0,
25
- value: 200
26
- }), Object.defineProperty(HTMLElement.prototype, "scrollWidth", {
27
- configurable: !0,
28
- value: 200
29
- });
30
- const l = a.setup(), o = "Block name that should be truncated with an ellipsis because it is very very loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong";
31
- i(
32
- /* @__PURE__ */ t(c, { id: o, text: o, children: /* @__PURE__ */ t(n, { children: o }) })
33
- ), r(e.getByText(o)).toBeInTheDocument(), l.hover(e.getByText(o)), await s(() => {
34
- r(e.queryByRole("tooltip")).not.toBeInTheDocument();
35
- });
36
- });
37
- });
@@ -1,91 +0,0 @@
1
- import { r as d } from "../../react.esm-Bm0cAgpZ.js";
2
- import { createPermissionWrapper as m } from "../../test-utils.js";
3
- import { HVMainPermissions as i } from "../../types/Permission.js";
4
- import { useIsAllowed as l, getPermissionsFromModulePermissionToken as a } from "./PermissionService.js";
5
- import { d as u, t, g as o } from "../../vi.bdSIJ99Y-B308Q-4w.js";
6
- u("Test PermissionService", () => {
7
- u("Test isAllowed", () => {
8
- const n = [
9
- i.FarmOrganizationsRead,
10
- i.FarmOrganizationsUpdate
11
- ], e = "123";
12
- t("should return true if the user has all (AND) needed permissions", () => {
13
- const {
14
- result: { current: s }
15
- } = d(() => l(), {
16
- wrapper: m({
17
- userPermissions: {
18
- [e]: [
19
- i.FarmOrganizationsRead,
20
- i.FarmOrganizationsUpdate
21
- ]
22
- }
23
- })
24
- }), r = s({
25
- neededPermissions: n,
26
- entityIds: e,
27
- areAllPermissionsNeeded: !0
28
- });
29
- o(r).toBe(!0);
30
- }), t("should return true if the user has one of the (OR) needed permissions", () => {
31
- const {
32
- result: { current: s }
33
- } = d(() => l(), {
34
- wrapper: m({
35
- userPermissions: {
36
- [e]: [i.BlocksCreate, i.FarmOrganizationsRead]
37
- }
38
- })
39
- }), r = s({ neededPermissions: n, entityIds: e });
40
- o(r).toBe(!0);
41
- }), t("should return true if neededPermissions array is empty", () => {
42
- const {
43
- result: { current: s }
44
- } = d(() => l(), {
45
- wrapper: m({
46
- userPermissions: {
47
- [e]: []
48
- }
49
- })
50
- }), r = s({
51
- neededPermissions: [],
52
- entityIds: e,
53
- areAllPermissionsNeeded: !0
54
- });
55
- o(r).toBe(!0);
56
- }), t("should return false if given entity id not matching with any userPermissions entry", () => {
57
- const {
58
- result: { current: s }
59
- } = d(() => l(), {
60
- wrapper: m({
61
- userPermissions: {
62
- 456: [i.BlocksCreate]
63
- }
64
- })
65
- }), r = s({ neededPermissions: n, entityIds: e });
66
- o(r).toBe(!1);
67
- });
68
- }), u("Test getPermissionsFromModulePermissionToken", () => {
69
- const n = `
70
- eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJNb2R1bGVSb2xlc0FuZFBlcm1pc3Npb25zIjp7IkZhcm1Pcmdhbml6YXRpb25JZCI6IjJmZDJjMGIwLTUwNjEtNGQ0NS1hYzI1LWQxY2E0YWNkNzMzOCIsIlVzZXJJZCI6Ijc5M2IxZmFlLTg0ODItNGVkMy1hYjczLTQ1NzFhMDViYjEyYiIsIk1vZHVsZUlkIjoiMTIzNDUtNjc4OTAtYWJjZGUtZWZnaGkiLCJSb2xlTmFtZXMiOlsiRmFybSBNYW5hZ2VyIiwiRmFybSBXb3JrZXIiXSwiRXhlY3V0ZUVuZHBvaW50UGVybWlzc2lvbk5hbWVzIjpbImJsb2Nrcy1yZWFkIiwiYmxvY2tzLXVwZGF0ZSIsImZhcm1zLXJlYWQiXX19.test-signature
71
- `;
72
- t("should return the correct permissions from module permission token", () => {
73
- const e = a({
74
- permissionToken: n
75
- });
76
- o(e).toEqual({
77
- "2fd2c0b0-5061-4d45-ac25-d1ca4acd7338": ["blocks-read", "blocks-update", "farms-read"]
78
- });
79
- }), t("should return undefined when permission token is empty", () => {
80
- const e = a({
81
- permissionToken: ""
82
- });
83
- o(e).toBeUndefined();
84
- }), t("should return undefined when permission token is not provided", () => {
85
- const e = a({
86
- permissionToken: void 0
87
- });
88
- o(e).toBeUndefined();
89
- });
90
- });
91
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,91 +0,0 @@
1
- import { jsxs as a, jsx as t } from "react/jsx-runtime";
2
- import { a as u, s as i, f as r } from "../../react.esm-Bm0cAgpZ.js";
3
- import { u as y } from "../../index-BLPBqbdx.js";
4
- import { SafeForm as p } from "./SafeForm.js";
5
- import { d as b, t as c, g as s, v as l } from "../../vi.bdSIJ99Y-B308Q-4w.js";
6
- b("SafeForm", () => {
7
- c("renders form with children", () => {
8
- u(
9
- /* @__PURE__ */ a(p, { children: [
10
- /* @__PURE__ */ t("input", { "data-testid": "test-input", type: "text" }),
11
- /* @__PURE__ */ t("button", { "data-testid": "submit-button", type: "submit", children: "Submit" })
12
- ] })
13
- ), s(i.getByTestId("test-input")).toBeInTheDocument(), s(i.getByTestId("submit-button")).toBeInTheDocument();
14
- }), c("prevents Enter key default behavior on text inputs", async () => {
15
- const e = y.setup();
16
- u(
17
- /* @__PURE__ */ a(p, { children: [
18
- /* @__PURE__ */ t("input", { "data-testid": "text-input", type: "text" }),
19
- /* @__PURE__ */ t("button", { "data-testid": "submit-button", type: "submit", children: "Submit" })
20
- ] })
21
- );
22
- const n = i.getByTestId("text-input");
23
- await e.click(n);
24
- const o = r.keyDown(n, { key: "Enter" });
25
- s(o).toBe(!1);
26
- }), c("allows Enter key press on submit button (does not prevent default)", async () => {
27
- u(
28
- /* @__PURE__ */ a(p, { children: [
29
- /* @__PURE__ */ t("input", { type: "text" }),
30
- /* @__PURE__ */ t("button", { "data-testid": "submit-button", type: "submit", children: "Submit" })
31
- ] })
32
- );
33
- const e = i.getByTestId("submit-button");
34
- e.focus();
35
- const n = r.keyDown(e, { key: "Enter" });
36
- s(n).toBe(!0);
37
- }), c("allows Enter key press on regular button (does not prevent default)", async () => {
38
- const e = l.fn();
39
- u(
40
- /* @__PURE__ */ a(p, { children: [
41
- /* @__PURE__ */ t("input", { type: "text" }),
42
- /* @__PURE__ */ t("button", { "data-testid": "cancel-button", type: "button", onClick: e, children: "Cancel" })
43
- ] })
44
- );
45
- const n = i.getByTestId("cancel-button");
46
- n.focus();
47
- const o = r.keyDown(n, { key: "Enter" });
48
- s(o).toBe(!0);
49
- }), c("allows Enter key press on textarea (does not prevent default)", async () => {
50
- u(
51
- /* @__PURE__ */ a(p, { children: [
52
- /* @__PURE__ */ t("input", { type: "text" }),
53
- /* @__PURE__ */ t("textarea", { "data-testid": "textarea" }),
54
- /* @__PURE__ */ t("button", { type: "submit", children: "Submit" })
55
- ] })
56
- );
57
- const e = i.getByTestId("textarea");
58
- e.focus();
59
- const n = r.keyDown(e, { key: "Enter" });
60
- s(n).toBe(!0);
61
- }), c("does not interfere with other key presses", async () => {
62
- const e = y.setup();
63
- u(
64
- /* @__PURE__ */ a(p, { children: [
65
- /* @__PURE__ */ t("input", { "data-testid": "text-input", type: "text" }),
66
- /* @__PURE__ */ t("button", { type: "submit", children: "Submit" })
67
- ] })
68
- );
69
- const n = i.getByTestId("text-input");
70
- await e.click(n), await e.keyboard("a"), await e.keyboard("{Tab}"), await e.keyboard("{Escape}"), s(n).toHaveValue("a");
71
- const o = r.keyDown(n, { key: "Tab" }), d = r.keyDown(n, { key: "Escape" });
72
- s(o).toBe(!0), s(d).toBe(!0);
73
- }), c("prevents Enter key on various input types", async () => {
74
- u(
75
- /* @__PURE__ */ a(p, { children: [
76
- /* @__PURE__ */ t("input", { "data-testid": "input1", type: "text" }),
77
- /* @__PURE__ */ t("input", { "data-testid": "input2", type: "email" }),
78
- /* @__PURE__ */ t("input", { "data-testid": "input3", type: "password" }),
79
- /* @__PURE__ */ t("input", { "data-testid": "input4", type: "number" }),
80
- /* @__PURE__ */ t("button", { type: "submit", children: "Submit" })
81
- ] })
82
- );
83
- const e = ["input1", "input2", "input3", "input4"];
84
- for (const n of e) {
85
- const o = i.getByTestId(n);
86
- o.focus();
87
- const d = r.keyDown(o, { key: "Enter" });
88
- s(d).toBe(!1);
89
- }
90
- });
91
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,15 +0,0 @@
1
- import { jsx as s } from "react/jsx-runtime";
2
- import { a, s as e } from "../../react.esm-Bm0cAgpZ.js";
3
- import { ScrollbarY as d, ScrollbarX as l } from "./Scrollbar.js";
4
- import { d as c, t, g as o } from "../../vi.bdSIJ99Y-B308Q-4w.js";
5
- c("Scrollbar", () => {
6
- t("should render Y correctly", () => {
7
- a(/* @__PURE__ */ s("div", { "data-testid": "div", className: d }));
8
- const r = e.getByTestId("div");
9
- o(r).toHaveClass(/scrollbarY/);
10
- }), t("should render X correctly", () => {
11
- a(/* @__PURE__ */ s("div", { "data-testid": "div", className: l }));
12
- const r = e.getByTestId("div");
13
- o(r).toHaveClass(/scrollbarX/);
14
- });
15
- });
@@ -1 +0,0 @@
1
- export {};