@northern.tech/testing 0.8.3 → 0.8.4

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 (89) hide show
  1. package/dist/mockData.cjs +1288 -953
  2. package/dist/mockData.cjs.map +1 -1
  3. package/dist/mockData.d.cts +595 -569
  4. package/dist/mockData.d.ts +595 -569
  5. package/dist/mockData.js +1278 -45
  6. package/dist/mockData.js.map +1 -1
  7. package/dist/requestHandlers/deploymentHandlers.cjs +180 -1031
  8. package/dist/requestHandlers/deploymentHandlers.cjs.map +1 -1
  9. package/dist/requestHandlers/deploymentHandlers.d.cts +5 -3
  10. package/dist/requestHandlers/deploymentHandlers.d.ts +5 -3
  11. package/dist/requestHandlers/deploymentHandlers.js +189 -6
  12. package/dist/requestHandlers/deploymentHandlers.js.map +1 -1
  13. package/dist/requestHandlers/deviceHandlers.cjs +426 -1090
  14. package/dist/requestHandlers/deviceHandlers.cjs.map +1 -1
  15. package/dist/requestHandlers/deviceHandlers.d.cts +17 -15
  16. package/dist/requestHandlers/deviceHandlers.d.ts +17 -15
  17. package/dist/requestHandlers/deviceHandlers.js +426 -10
  18. package/dist/requestHandlers/deviceHandlers.js.map +1 -1
  19. package/dist/requestHandlers/monitorHandlers.cjs +20 -831
  20. package/dist/requestHandlers/monitorHandlers.cjs.map +1 -1
  21. package/dist/requestHandlers/monitorHandlers.d.cts +5 -3
  22. package/dist/requestHandlers/monitorHandlers.d.ts +5 -3
  23. package/dist/requestHandlers/monitorHandlers.js +20 -7
  24. package/dist/requestHandlers/monitorHandlers.js.map +1 -1
  25. package/dist/requestHandlers/organizationHandlers.cjs +296 -1113
  26. package/dist/requestHandlers/organizationHandlers.cjs.map +1 -1
  27. package/dist/requestHandlers/organizationHandlers.d.cts +5 -3
  28. package/dist/requestHandlers/organizationHandlers.d.ts +5 -3
  29. package/dist/requestHandlers/organizationHandlers.js +308 -6
  30. package/dist/requestHandlers/organizationHandlers.js.map +1 -1
  31. package/dist/requestHandlers/releaseHandlers.cjs +156 -960
  32. package/dist/requestHandlers/releaseHandlers.cjs.map +1 -1
  33. package/dist/requestHandlers/releaseHandlers.d.cts +5 -3
  34. package/dist/requestHandlers/releaseHandlers.d.ts +5 -3
  35. package/dist/requestHandlers/releaseHandlers.js +157 -6
  36. package/dist/requestHandlers/releaseHandlers.js.map +1 -1
  37. package/dist/requestHandlers/requestHandlers.cjs +26 -2000
  38. package/dist/requestHandlers/requestHandlers.cjs.map +1 -1
  39. package/dist/requestHandlers/requestHandlers.d.cts +5 -4
  40. package/dist/requestHandlers/requestHandlers.d.ts +5 -3
  41. package/dist/requestHandlers/requestHandlers.js +24 -32
  42. package/dist/requestHandlers/requestHandlers.js.map +1 -1
  43. package/dist/requestHandlers/userHandlers.cjs +138 -990
  44. package/dist/requestHandlers/userHandlers.cjs.map +1 -1
  45. package/dist/requestHandlers/userHandlers.d.cts +5 -3
  46. package/dist/requestHandlers/userHandlers.d.ts +5 -3
  47. package/dist/requestHandlers/userHandlers.js +138 -7
  48. package/dist/requestHandlers/userHandlers.js.map +1 -1
  49. package/dist/setupTests.cjs +163 -985
  50. package/dist/setupTests.cjs.map +1 -1
  51. package/dist/setupTests.d.cts +68 -66
  52. package/dist/setupTests.d.ts +68 -66
  53. package/dist/setupTests.js +114 -117
  54. package/dist/setupTests.js.map +1 -1
  55. package/dist/theme/light.cjs +7 -39
  56. package/dist/theme/light.cjs.map +1 -1
  57. package/dist/theme/light.d.cts +5 -10
  58. package/dist/theme/light.d.ts +5 -10
  59. package/dist/theme/light.js +7 -6
  60. package/dist/theme/light.js.map +1 -1
  61. package/dist/theme/mui.d.cjs +0 -0
  62. package/dist/theme/mui.d.cts +11 -0
  63. package/dist/theme/mui.d.ts +11 -0
  64. package/dist/utils.cjs +18 -68
  65. package/dist/utils.cjs.map +1 -1
  66. package/dist/utils.d.cts +6 -67
  67. package/dist/utils.d.ts +6 -67
  68. package/dist/utils.js +16 -10
  69. package/dist/utils.js.map +1 -1
  70. package/package.json +6 -6
  71. package/dist/chunk-3CVNBMEF.js +0 -161
  72. package/dist/chunk-3CVNBMEF.js.map +0 -1
  73. package/dist/chunk-7GNK7IRV.js +0 -29
  74. package/dist/chunk-7GNK7IRV.js.map +0 -1
  75. package/dist/chunk-AP4MOFMD.js +0 -239
  76. package/dist/chunk-AP4MOFMD.js.map +0 -1
  77. package/dist/chunk-DOHA53UH.js +0 -301
  78. package/dist/chunk-DOHA53UH.js.map +0 -1
  79. package/dist/chunk-H4J7L3HX.js +0 -188
  80. package/dist/chunk-H4J7L3HX.js.map +0 -1
  81. package/dist/chunk-HRGVXWMH.js +0 -17
  82. package/dist/chunk-HRGVXWMH.js.map +0 -1
  83. package/dist/chunk-KCLTR6QS.js +0 -34
  84. package/dist/chunk-KCLTR6QS.js.map +0 -1
  85. package/dist/chunk-M2TKDOPD.js +0 -266
  86. package/dist/chunk-M2TKDOPD.js.map +0 -1
  87. package/dist/chunk-O42KIJXJ.js +0 -933
  88. package/dist/chunk-O42KIJXJ.js.map +0 -1
  89. /package/dist/{baseTestConfig.json → public/baseTestConfig.json} +0 -0
package/dist/utils.d.cts CHANGED
@@ -1,69 +1,8 @@
1
- import * as _testing_library_dom from '@testing-library/dom';
2
- import * as pretty_format from 'pretty-format';
3
- import * as react_dom_client from 'react-dom/client';
4
- import * as _mui_material_styles from '@mui/material/styles';
5
- import React from 'react';
1
+ import * as _$_mui_material0 from "@mui/material";
6
2
 
3
+ //#region src/utils.d.ts
7
4
  declare const selectMaterialUiSelectOption: (element: any, optionText: any, user: any) => Promise<void>;
8
- declare const theme: _mui_material_styles.Theme;
9
- declare const renderWithRouter: (ui: React.ReactElement, { route, preloadedState }?: {
10
- route?: string | undefined;
11
- }) => {
12
- container: HTMLElement;
13
- baseElement: HTMLElement;
14
- debug: (baseElement?: react_dom_client.Container | (Element | Document) | Array<react_dom_client.Container | (Element | Document)> | undefined, maxLength?: number | undefined, options?: pretty_format.OptionsReceived | undefined) => void;
15
- rerender: (ui: React.ReactNode) => void;
16
- unmount: () => void;
17
- asFragment: () => DocumentFragment;
18
- getByLabelText: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.SelectorMatcherOptions | undefined) => HTMLElement;
19
- getAllByLabelText: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.SelectorMatcherOptions | undefined) => HTMLElement[];
20
- queryByLabelText: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.SelectorMatcherOptions | undefined) => HTMLElement | null;
21
- queryAllByLabelText: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.SelectorMatcherOptions | undefined) => HTMLElement[];
22
- findByLabelText: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.SelectorMatcherOptions | undefined, waitForElementOptions?: _testing_library_dom.waitForOptions | undefined) => Promise<HTMLElement>;
23
- findAllByLabelText: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.SelectorMatcherOptions | undefined, waitForElementOptions?: _testing_library_dom.waitForOptions | undefined) => Promise<HTMLElement[]>;
24
- getByPlaceholderText: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.MatcherOptions | undefined) => HTMLElement;
25
- getAllByPlaceholderText: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.MatcherOptions | undefined) => HTMLElement[];
26
- queryByPlaceholderText: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.MatcherOptions | undefined) => HTMLElement | null;
27
- queryAllByPlaceholderText: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.MatcherOptions | undefined) => HTMLElement[];
28
- findByPlaceholderText: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.MatcherOptions | undefined, waitForElementOptions?: _testing_library_dom.waitForOptions | undefined) => Promise<HTMLElement>;
29
- findAllByPlaceholderText: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.MatcherOptions | undefined, waitForElementOptions?: _testing_library_dom.waitForOptions | undefined) => Promise<HTMLElement[]>;
30
- getByText: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.SelectorMatcherOptions | undefined) => HTMLElement;
31
- getAllByText: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.SelectorMatcherOptions | undefined) => HTMLElement[];
32
- queryByText: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.SelectorMatcherOptions | undefined) => HTMLElement | null;
33
- queryAllByText: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.SelectorMatcherOptions | undefined) => HTMLElement[];
34
- findByText: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.SelectorMatcherOptions | undefined, waitForElementOptions?: _testing_library_dom.waitForOptions | undefined) => Promise<HTMLElement>;
35
- findAllByText: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.SelectorMatcherOptions | undefined, waitForElementOptions?: _testing_library_dom.waitForOptions | undefined) => Promise<HTMLElement[]>;
36
- getByAltText: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.MatcherOptions | undefined) => HTMLElement;
37
- getAllByAltText: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.MatcherOptions | undefined) => HTMLElement[];
38
- queryByAltText: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.MatcherOptions | undefined) => HTMLElement | null;
39
- queryAllByAltText: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.MatcherOptions | undefined) => HTMLElement[];
40
- findByAltText: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.MatcherOptions | undefined, waitForElementOptions?: _testing_library_dom.waitForOptions | undefined) => Promise<HTMLElement>;
41
- findAllByAltText: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.MatcherOptions | undefined, waitForElementOptions?: _testing_library_dom.waitForOptions | undefined) => Promise<HTMLElement[]>;
42
- getByTitle: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.MatcherOptions | undefined) => HTMLElement;
43
- getAllByTitle: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.MatcherOptions | undefined) => HTMLElement[];
44
- queryByTitle: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.MatcherOptions | undefined) => HTMLElement | null;
45
- queryAllByTitle: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.MatcherOptions | undefined) => HTMLElement[];
46
- findByTitle: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.MatcherOptions | undefined, waitForElementOptions?: _testing_library_dom.waitForOptions | undefined) => Promise<HTMLElement>;
47
- findAllByTitle: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.MatcherOptions | undefined, waitForElementOptions?: _testing_library_dom.waitForOptions | undefined) => Promise<HTMLElement[]>;
48
- getByDisplayValue: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.MatcherOptions | undefined) => HTMLElement;
49
- getAllByDisplayValue: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.MatcherOptions | undefined) => HTMLElement[];
50
- queryByDisplayValue: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.MatcherOptions | undefined) => HTMLElement | null;
51
- queryAllByDisplayValue: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.MatcherOptions | undefined) => HTMLElement[];
52
- findByDisplayValue: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.MatcherOptions | undefined, waitForElementOptions?: _testing_library_dom.waitForOptions | undefined) => Promise<HTMLElement>;
53
- findAllByDisplayValue: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.MatcherOptions | undefined, waitForElementOptions?: _testing_library_dom.waitForOptions | undefined) => Promise<HTMLElement[]>;
54
- getByRole: (role: _testing_library_dom.ByRoleMatcher, options?: _testing_library_dom.ByRoleOptions | undefined) => HTMLElement;
55
- getAllByRole: (role: _testing_library_dom.ByRoleMatcher, options?: _testing_library_dom.ByRoleOptions | undefined) => HTMLElement[];
56
- queryByRole: (role: _testing_library_dom.ByRoleMatcher, options?: _testing_library_dom.ByRoleOptions | undefined) => HTMLElement | null;
57
- queryAllByRole: (role: _testing_library_dom.ByRoleMatcher, options?: _testing_library_dom.ByRoleOptions | undefined) => HTMLElement[];
58
- findByRole: (role: _testing_library_dom.ByRoleMatcher, options?: _testing_library_dom.ByRoleOptions | undefined, waitForElementOptions?: _testing_library_dom.waitForOptions | undefined) => Promise<HTMLElement>;
59
- findAllByRole: (role: _testing_library_dom.ByRoleMatcher, options?: _testing_library_dom.ByRoleOptions | undefined, waitForElementOptions?: _testing_library_dom.waitForOptions | undefined) => Promise<HTMLElement[]>;
60
- getByTestId: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.MatcherOptions | undefined) => HTMLElement;
61
- getAllByTestId: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.MatcherOptions | undefined) => HTMLElement[];
62
- queryByTestId: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.MatcherOptions | undefined) => HTMLElement | null;
63
- queryAllByTestId: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.MatcherOptions | undefined) => HTMLElement[];
64
- findByTestId: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.MatcherOptions | undefined, waitForElementOptions?: _testing_library_dom.waitForOptions | undefined) => Promise<HTMLElement>;
65
- findAllByTestId: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.MatcherOptions | undefined, waitForElementOptions?: _testing_library_dom.waitForOptions | undefined) => Promise<HTMLElement[]>;
66
- store: any;
67
- };
68
-
69
- export { renderWithRouter, selectMaterialUiSelectOption, theme };
5
+ declare const theme: _$_mui_material0.Theme;
6
+ //#endregion
7
+ export { selectMaterialUiSelectOption, theme };
8
+ //# sourceMappingURL=utils.d.cts.map
package/dist/utils.d.ts CHANGED
@@ -1,69 +1,8 @@
1
- import * as _testing_library_dom from '@testing-library/dom';
2
- import * as pretty_format from 'pretty-format';
3
- import * as react_dom_client from 'react-dom/client';
4
- import * as _mui_material_styles from '@mui/material/styles';
5
- import React from 'react';
1
+ import * as _$_mui_material0 from "@mui/material";
6
2
 
3
+ //#region src/utils.d.ts
7
4
  declare const selectMaterialUiSelectOption: (element: any, optionText: any, user: any) => Promise<void>;
8
- declare const theme: _mui_material_styles.Theme;
9
- declare const renderWithRouter: (ui: React.ReactElement, { route, preloadedState }?: {
10
- route?: string | undefined;
11
- }) => {
12
- container: HTMLElement;
13
- baseElement: HTMLElement;
14
- debug: (baseElement?: react_dom_client.Container | (Element | Document) | Array<react_dom_client.Container | (Element | Document)> | undefined, maxLength?: number | undefined, options?: pretty_format.OptionsReceived | undefined) => void;
15
- rerender: (ui: React.ReactNode) => void;
16
- unmount: () => void;
17
- asFragment: () => DocumentFragment;
18
- getByLabelText: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.SelectorMatcherOptions | undefined) => HTMLElement;
19
- getAllByLabelText: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.SelectorMatcherOptions | undefined) => HTMLElement[];
20
- queryByLabelText: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.SelectorMatcherOptions | undefined) => HTMLElement | null;
21
- queryAllByLabelText: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.SelectorMatcherOptions | undefined) => HTMLElement[];
22
- findByLabelText: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.SelectorMatcherOptions | undefined, waitForElementOptions?: _testing_library_dom.waitForOptions | undefined) => Promise<HTMLElement>;
23
- findAllByLabelText: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.SelectorMatcherOptions | undefined, waitForElementOptions?: _testing_library_dom.waitForOptions | undefined) => Promise<HTMLElement[]>;
24
- getByPlaceholderText: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.MatcherOptions | undefined) => HTMLElement;
25
- getAllByPlaceholderText: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.MatcherOptions | undefined) => HTMLElement[];
26
- queryByPlaceholderText: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.MatcherOptions | undefined) => HTMLElement | null;
27
- queryAllByPlaceholderText: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.MatcherOptions | undefined) => HTMLElement[];
28
- findByPlaceholderText: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.MatcherOptions | undefined, waitForElementOptions?: _testing_library_dom.waitForOptions | undefined) => Promise<HTMLElement>;
29
- findAllByPlaceholderText: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.MatcherOptions | undefined, waitForElementOptions?: _testing_library_dom.waitForOptions | undefined) => Promise<HTMLElement[]>;
30
- getByText: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.SelectorMatcherOptions | undefined) => HTMLElement;
31
- getAllByText: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.SelectorMatcherOptions | undefined) => HTMLElement[];
32
- queryByText: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.SelectorMatcherOptions | undefined) => HTMLElement | null;
33
- queryAllByText: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.SelectorMatcherOptions | undefined) => HTMLElement[];
34
- findByText: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.SelectorMatcherOptions | undefined, waitForElementOptions?: _testing_library_dom.waitForOptions | undefined) => Promise<HTMLElement>;
35
- findAllByText: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.SelectorMatcherOptions | undefined, waitForElementOptions?: _testing_library_dom.waitForOptions | undefined) => Promise<HTMLElement[]>;
36
- getByAltText: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.MatcherOptions | undefined) => HTMLElement;
37
- getAllByAltText: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.MatcherOptions | undefined) => HTMLElement[];
38
- queryByAltText: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.MatcherOptions | undefined) => HTMLElement | null;
39
- queryAllByAltText: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.MatcherOptions | undefined) => HTMLElement[];
40
- findByAltText: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.MatcherOptions | undefined, waitForElementOptions?: _testing_library_dom.waitForOptions | undefined) => Promise<HTMLElement>;
41
- findAllByAltText: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.MatcherOptions | undefined, waitForElementOptions?: _testing_library_dom.waitForOptions | undefined) => Promise<HTMLElement[]>;
42
- getByTitle: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.MatcherOptions | undefined) => HTMLElement;
43
- getAllByTitle: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.MatcherOptions | undefined) => HTMLElement[];
44
- queryByTitle: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.MatcherOptions | undefined) => HTMLElement | null;
45
- queryAllByTitle: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.MatcherOptions | undefined) => HTMLElement[];
46
- findByTitle: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.MatcherOptions | undefined, waitForElementOptions?: _testing_library_dom.waitForOptions | undefined) => Promise<HTMLElement>;
47
- findAllByTitle: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.MatcherOptions | undefined, waitForElementOptions?: _testing_library_dom.waitForOptions | undefined) => Promise<HTMLElement[]>;
48
- getByDisplayValue: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.MatcherOptions | undefined) => HTMLElement;
49
- getAllByDisplayValue: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.MatcherOptions | undefined) => HTMLElement[];
50
- queryByDisplayValue: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.MatcherOptions | undefined) => HTMLElement | null;
51
- queryAllByDisplayValue: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.MatcherOptions | undefined) => HTMLElement[];
52
- findByDisplayValue: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.MatcherOptions | undefined, waitForElementOptions?: _testing_library_dom.waitForOptions | undefined) => Promise<HTMLElement>;
53
- findAllByDisplayValue: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.MatcherOptions | undefined, waitForElementOptions?: _testing_library_dom.waitForOptions | undefined) => Promise<HTMLElement[]>;
54
- getByRole: (role: _testing_library_dom.ByRoleMatcher, options?: _testing_library_dom.ByRoleOptions | undefined) => HTMLElement;
55
- getAllByRole: (role: _testing_library_dom.ByRoleMatcher, options?: _testing_library_dom.ByRoleOptions | undefined) => HTMLElement[];
56
- queryByRole: (role: _testing_library_dom.ByRoleMatcher, options?: _testing_library_dom.ByRoleOptions | undefined) => HTMLElement | null;
57
- queryAllByRole: (role: _testing_library_dom.ByRoleMatcher, options?: _testing_library_dom.ByRoleOptions | undefined) => HTMLElement[];
58
- findByRole: (role: _testing_library_dom.ByRoleMatcher, options?: _testing_library_dom.ByRoleOptions | undefined, waitForElementOptions?: _testing_library_dom.waitForOptions | undefined) => Promise<HTMLElement>;
59
- findAllByRole: (role: _testing_library_dom.ByRoleMatcher, options?: _testing_library_dom.ByRoleOptions | undefined, waitForElementOptions?: _testing_library_dom.waitForOptions | undefined) => Promise<HTMLElement[]>;
60
- getByTestId: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.MatcherOptions | undefined) => HTMLElement;
61
- getAllByTestId: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.MatcherOptions | undefined) => HTMLElement[];
62
- queryByTestId: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.MatcherOptions | undefined) => HTMLElement | null;
63
- queryAllByTestId: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.MatcherOptions | undefined) => HTMLElement[];
64
- findByTestId: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.MatcherOptions | undefined, waitForElementOptions?: _testing_library_dom.waitForOptions | undefined) => Promise<HTMLElement>;
65
- findAllByTestId: (id: _testing_library_dom.Matcher, options?: _testing_library_dom.MatcherOptions | undefined, waitForElementOptions?: _testing_library_dom.waitForOptions | undefined) => Promise<HTMLElement[]>;
66
- store: any;
67
- };
68
-
69
- export { renderWithRouter, selectMaterialUiSelectOption, theme };
5
+ declare const theme: _$_mui_material0.Theme;
6
+ //#endregion
7
+ export { selectMaterialUiSelectOption, theme };
8
+ //# sourceMappingURL=utils.d.ts.map
package/dist/utils.js CHANGED
@@ -1,12 +1,18 @@
1
- import {
2
- renderWithRouter,
3
- selectMaterialUiSelectOption,
4
- theme
5
- } from "./chunk-KCLTR6QS.js";
6
- import "./chunk-HRGVXWMH.js";
7
- export {
8
- renderWithRouter,
9
- selectMaterialUiSelectOption,
10
- theme
1
+ import { light } from "./theme/light.js";
2
+ import { createTheme } from "@mui/material/styles";
3
+ import { act, queryByRole, waitFor, within } from "@testing-library/react";
4
+ import { expect } from "vitest";
5
+ //#region src/utils.ts
6
+ const selectMaterialUiSelectOption = async (element, optionText, user) => {
7
+ const selectButton = element.parentNode.querySelector("[role=combobox]");
8
+ await act(async () => await user.click(selectButton));
9
+ const listItem = within(queryByRole(document.documentElement, "listbox")).getByText(optionText);
10
+ await user.click(listItem);
11
+ await waitFor(() => expect(queryByRole(document.documentElement, "listbox")).not.toBeInTheDocument());
12
+ return Promise.resolve();
11
13
  };
14
+ const theme = createTheme(light);
15
+ //#endregion
16
+ export { selectMaterialUiSelectOption, theme };
17
+
12
18
  //# sourceMappingURL=utils.js.map
package/dist/utils.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
1
+ {"version":3,"file":"utils.js","names":[],"sources":["../src/utils.ts"],"sourcesContent":["// Copyright 2025 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { createTheme } from '@mui/material/styles';\n\nimport { act, queryByRole, waitFor, within } from '@testing-library/react';\nimport { expect } from 'vitest';\n\nimport { light } from './theme/light';\n\nexport const selectMaterialUiSelectOption = async (element, optionText, user) => {\n // The button that opens the dropdown, which is a sibling of the input\n const selectButton = element.parentNode.querySelector('[role=combobox]');\n // Open the select dropdown\n await act(async () => await user.click(selectButton));\n // Get the dropdown element. We don't use getByRole() because it includes <select>s too.\n const listbox = queryByRole(document.documentElement, 'listbox');\n // Click the list item\n const listItem = within(listbox!).getByText(optionText);\n await user.click(listItem);\n // Wait for the listbox to be removed, so it isn't visible in subsequent calls\n await waitFor(() => expect(queryByRole(document.documentElement, 'listbox')).not.toBeInTheDocument());\n return Promise.resolve();\n};\n\nexport const theme = createTheme(light);\n"],"mappings":";;;;;AAoBA,MAAa,+BAA+B,OAAO,SAAS,YAAY,SAAS;CAE/E,MAAM,eAAe,QAAQ,WAAW,cAAc,kBAAkB;AAExE,OAAM,IAAI,YAAY,MAAM,KAAK,MAAM,aAAa,CAAC;CAIrD,MAAM,WAAW,OAFD,YAAY,SAAS,iBAAiB,UAAU,CAE/B,CAAC,UAAU,WAAW;AACvD,OAAM,KAAK,MAAM,SAAS;AAE1B,OAAM,cAAc,OAAO,YAAY,SAAS,iBAAiB,UAAU,CAAC,CAAC,IAAI,mBAAmB,CAAC;AACrG,QAAO,QAAQ,SAAS;;AAG1B,MAAa,QAAQ,YAAY,MAAM"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@northern.tech/testing",
3
- "version": "0.8.3",
3
+ "version": "0.8.4",
4
4
  "license": "Apache-2.0",
5
5
  "private": false,
6
6
  "publishConfig": {
@@ -11,7 +11,7 @@
11
11
  "url": "git+https://github.com/NorthernTechHQ/nt-gui.git"
12
12
  },
13
13
  "exports": {
14
- "./baseTestConfig.json": "./dist/baseTestConfig.json",
14
+ "./baseTestConfig.json": "./dist/public/baseTestConfig.json",
15
15
  "./**/*": {
16
16
  "types": "./dist/*.d.ts",
17
17
  "import": "./dist/*.js",
@@ -25,11 +25,11 @@
25
25
  },
26
26
  "files": [
27
27
  "dist",
28
- "dist/baseTestConfig.json"
28
+ "dist/public/baseTestConfig.json"
29
29
  ],
30
30
  "scripts": {
31
- "build": "tsup --publicDir",
32
- "dev": "tsup --watch --no-dts --onSuccess 'yalc publish --no-script --push'",
31
+ "build": "tsdown",
32
+ "dev": "tsdown --watch --no-dts --onSuccess 'yalc publish --no-script --push'",
33
33
  "lint": "eslint --quiet .",
34
34
  "format:check": "prettier --check \"src/**/*.{js,ts,jsx,tsx,less}\""
35
35
  },
@@ -39,7 +39,7 @@
39
39
  "@northern.tech/eslint-config": "*",
40
40
  "@northern.tech/typescript-config": "*",
41
41
  "eslint": "^9.39.1",
42
- "tsup": "8.5.1"
42
+ "tsdown": "^0.21.7"
43
43
  },
44
44
  "dependencies": {
45
45
  "@emotion/jest": "^11.x",
@@ -1,161 +0,0 @@
1
- import {
2
- mockApiResponses,
3
- releasesList
4
- } from "./chunk-O42KIJXJ.js";
5
-
6
- // src/requestHandlers/releaseHandlers.ts
7
- import { SORTING_OPTIONS, deploymentsApiUrl, deploymentsApiUrlV2, headerNames } from "@northern.tech/utils/constants";
8
- import { customSort } from "@northern.tech/utils/helpers";
9
- import { HttpResponse, http } from "msw";
10
- var deltaJobs = {
11
- "delta-job-1": {
12
- id: "delta-job-1",
13
- to_release: "mender-demo-artifact-3.3.1",
14
- from_release: "mender-demo-artifact-3.2.1",
15
- to_version: "mender-demo-artifact-3.3.1",
16
- from_version: "mender-demo-artifact-3.2.1",
17
- device_types_compatible: ["qemux86-64"],
18
- started: "2022-07-11T20:49:00.000Z",
19
- status: "success"
20
- },
21
- "delta-job-2": {
22
- id: "delta-job-2",
23
- to_release: "mender-demo-artifact-3.3.1",
24
- from_release: "mender-demo-artifact-3.3.0",
25
- to_version: "mender-demo-artifact-3.3.1",
26
- from_version: "mender-demo-artifact-3.3.0",
27
- device_types_compatible: ["raspberrypi0w", "raspberrypi0-wifi", "raspberrypi3", "raspberrypi4"],
28
- started: "2022-07-11T20:49:00.000Z",
29
- status: "failed"
30
- },
31
- "delta-job-3": {
32
- id: "delta-job-3",
33
- to_release: "mender-demo-artifact-3.3.1",
34
- from_release: "mender-demo-artifact-3.3.0",
35
- to_version: "mender-demo-artifact-3.3.1",
36
- from_version: "mender-demo-artifact-3.3.0",
37
- device_types_compatible: ["beaglebone", "beaglebone-yocto", "beaglebone-yocto"],
38
- started: "2022-07-11T20:49:00.000Z",
39
- status: "pending"
40
- },
41
- "delta-job-4": {
42
- id: "delta-job-4",
43
- to_release: "mender-demo-artifact-3.2.0",
44
- from_release: "mender-demo-artifact-3.1.0",
45
- to_version: "mender-demo-artifact-3.2.0",
46
- from_version: "mender-demo-artifact-3.1.0",
47
- device_types_compatible: ["qemux86-64"],
48
- started: "2022-07-10T15:30:00.000Z",
49
- status: "artifact_uploaded"
50
- }
51
- };
52
- var mockDeltaJobDetails = {
53
- "delta-job-1": {
54
- ...deltaJobs["delta-job-1"],
55
- delta_artifact_size: 1024e3,
56
- deployment_id: "d1",
57
- devices_types_compatible: ["qemux86-64"],
58
- exit_code: 0,
59
- log: "Delta generation started at 2022-07-11T20:49:00.000Z\nProcessing artifacts...\nDelta generation completed successfully at 2022-07-11T20:52:15.000Z",
60
- to_artifact_size: 2048e3
61
- },
62
- "delta-job-2": {
63
- ...deltaJobs["delta-job-2"],
64
- delta_artifact_size: null,
65
- deployment_id: "d2",
66
- devices_types_compatible: ["raspberrypi0w", "raspberrypi0-wifi", "raspberrypi3", "raspberrypi4"],
67
- exit_code: 1,
68
- log: "Delta generation started at 2022-07-11T20:49:00.000Z\nError: incompatible artifact types\nDelta generation failed at 2022-07-11T20:51:30.000Z",
69
- to_artifact_size: 3072e3
70
- },
71
- "delta-job-3": {
72
- ...deltaJobs["delta-job-3"],
73
- delta_artifact_size: null,
74
- deployment_id: "d3",
75
- devices_types_compatible: ["beaglebone", "beaglebone-yocto"],
76
- exit_code: null,
77
- log: "Delta generation started at 2022-07-11T20:49:00.000Z\nQueued for processing...",
78
- to_artifact_size: 256e4
79
- },
80
- "delta-job-4": {
81
- ...deltaJobs["delta-job-4"],
82
- delta_artifact_size: 512e3,
83
- deployment_id: "d1",
84
- devices_types_compatible: ["qemux86-64"],
85
- exit_code: 0,
86
- log: "Delta generation started at 2022-07-10T15:30:00.000Z\nProcessing artifacts...\nArtifact uploaded successfully at 2022-07-10T15:45:20.000Z",
87
- to_artifact_size: 1536e3
88
- }
89
- };
90
- var releaseHandlers = [
91
- http.get(`${deploymentsApiUrl}/artifacts/:id`, () => new HttpResponse(null, { status: 200 })),
92
- http.get(`${deploymentsApiUrl}/artifacts/:id/download`, () => HttpResponse.json({ uri: "https://testlocation.com/artifact.mender" })),
93
- http.delete(
94
- `${deploymentsApiUrl}/artifacts/:id`,
95
- ({ params: { id } }) => new HttpResponse(null, { status: id === mockApiResponses.releases.byId.r1.artifacts[0].id ? 200 : 591 })
96
- ),
97
- http.put(`${deploymentsApiUrl}/artifacts/:id`, async ({ params: { id }, request }) => {
98
- const { description } = await request.json();
99
- return new HttpResponse(null, { status: id === mockApiResponses.releases.byId.r1.artifacts[0].id && description ? 200 : 592 });
100
- }),
101
- http.post(
102
- `${deploymentsApiUrl}/artifacts/generate`,
103
- () => new HttpResponse(null, {
104
- headers: { [headerNames.location]: `${deploymentsApiUrl}/artifacts/generate/${mockApiResponses.releases.byId.r1.artifacts[0].id}`, status: 201 }
105
- })
106
- ),
107
- http.post(`${deploymentsApiUrl}/artifacts`, () => new HttpResponse(null, { status: 200 })),
108
- http.get(`${deploymentsApiUrlV2}/deployments/releases`, async ({ request }) => {
109
- const { searchParams } = new URL(request.url);
110
- const page = Number(searchParams.get("page"));
111
- const perPage = Number(searchParams.get("per_page"));
112
- if (!page || ![1, 10, 20, 50, 100, 250, 500].includes(perPage)) {
113
- return new HttpResponse(null, { status: 593 });
114
- }
115
- if (searchParams.get("device_type")) {
116
- return HttpResponse.json([]);
117
- }
118
- if (page == 42) {
119
- return new HttpResponse(JSON.stringify([mockApiResponses.releases.byId.r1]), { headers: { [headerNames.total]: 1 } });
120
- }
121
- const sort = searchParams.get("sort");
122
- const releaseListSection = releasesList.sort(customSort(sort.includes(SORTING_OPTIONS.desc), "name")).slice((page - 1) * perPage, page * perPage);
123
- if (page === 1 && perPage === 1 && searchParams.get("name")) {
124
- return HttpResponse.json([mockApiResponses.releases.byId.r1]);
125
- }
126
- if (searchParams.get("name")) {
127
- return new HttpResponse(JSON.stringify(releaseListSection), { headers: { [headerNames.total]: 1234 } });
128
- }
129
- return new HttpResponse(JSON.stringify(releaseListSection), { headers: { [headerNames.total]: releasesList.length } });
130
- }),
131
- http.get(`${deploymentsApiUrlV2}/deployments/releases/:name`, () => HttpResponse.json(mockApiResponses.releases.byId.r1)),
132
- http.get(`${deploymentsApiUrlV2}/releases/all/tags`, () => HttpResponse.json(["foo", "bar"])),
133
- http.get(`${deploymentsApiUrlV2}/releases/all/types`, () => HttpResponse.json(["single-file", "not-this"])),
134
- http.put(`${deploymentsApiUrlV2}/deployments/releases/:name/tags`, async ({ params: { name }, request }) => {
135
- const tags = await request.json();
136
- if (name && tags.every((i) => i && i.toString() === i)) {
137
- return new HttpResponse(null, { status: 200 });
138
- }
139
- return new HttpResponse(null, { status: 593 });
140
- }),
141
- http.patch(`${deploymentsApiUrlV2}/deployments/releases/:name`, async ({ params: { name }, request }) => {
142
- const { notes } = await request.json();
143
- return new HttpResponse(null, { status: name && notes.length ? 200 : 594 });
144
- }),
145
- http.get(`${deploymentsApiUrlV2}/deployments/releases/delta/jobs`, () => {
146
- const jobs = Object.values(deltaJobs);
147
- return new HttpResponse(JSON.stringify(jobs), { headers: { [headerNames.total]: jobs.length } });
148
- }),
149
- http.get(`${deploymentsApiUrlV2}/deployments/releases/delta/jobs/:jobId`, ({ params: { jobId } }) => {
150
- const jobDetails = mockDeltaJobDetails[jobId];
151
- if (jobDetails) {
152
- return HttpResponse.json(jobDetails);
153
- }
154
- return new HttpResponse(null, { status: 404 });
155
- })
156
- ];
157
-
158
- export {
159
- releaseHandlers
160
- };
161
- //# sourceMappingURL=chunk-3CVNBMEF.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/requestHandlers/releaseHandlers.ts"],"sourcesContent":["// Copyright 2020 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//@ts-nocheck\nimport { SORTING_OPTIONS, deploymentsApiUrl, deploymentsApiUrlV2, headerNames } from '@northern.tech/utils/constants';\nimport { customSort } from '@northern.tech/utils/helpers';\nimport { HttpResponse, http } from 'msw';\n\nimport { mockApiResponses, releasesList } from '../mockData';\n\nconst deltaJobs = {\n 'delta-job-1': {\n id: 'delta-job-1',\n to_release: 'mender-demo-artifact-3.3.1',\n from_release: 'mender-demo-artifact-3.2.1',\n to_version: 'mender-demo-artifact-3.3.1',\n from_version: 'mender-demo-artifact-3.2.1',\n device_types_compatible: ['qemux86-64'],\n started: '2022-07-11T20:49:00.000Z',\n status: 'success'\n },\n 'delta-job-2': {\n id: 'delta-job-2',\n to_release: 'mender-demo-artifact-3.3.1',\n from_release: 'mender-demo-artifact-3.3.0',\n to_version: 'mender-demo-artifact-3.3.1',\n from_version: 'mender-demo-artifact-3.3.0',\n device_types_compatible: ['raspberrypi0w', 'raspberrypi0-wifi', 'raspberrypi3', 'raspberrypi4'],\n started: '2022-07-11T20:49:00.000Z',\n status: 'failed'\n },\n 'delta-job-3': {\n id: 'delta-job-3',\n to_release: 'mender-demo-artifact-3.3.1',\n from_release: 'mender-demo-artifact-3.3.0',\n to_version: 'mender-demo-artifact-3.3.1',\n from_version: 'mender-demo-artifact-3.3.0',\n device_types_compatible: ['beaglebone', 'beaglebone-yocto', 'beaglebone-yocto'],\n started: '2022-07-11T20:49:00.000Z',\n status: 'pending'\n },\n 'delta-job-4': {\n id: 'delta-job-4',\n to_release: 'mender-demo-artifact-3.2.0',\n from_release: 'mender-demo-artifact-3.1.0',\n to_version: 'mender-demo-artifact-3.2.0',\n from_version: 'mender-demo-artifact-3.1.0',\n device_types_compatible: ['qemux86-64'],\n started: '2022-07-10T15:30:00.000Z',\n status: 'artifact_uploaded'\n }\n};\n\nconst mockDeltaJobDetails = {\n 'delta-job-1': {\n ...deltaJobs['delta-job-1'],\n delta_artifact_size: 1024000,\n deployment_id: 'd1',\n devices_types_compatible: ['qemux86-64'],\n exit_code: 0,\n log: 'Delta generation started at 2022-07-11T20:49:00.000Z\\nProcessing artifacts...\\nDelta generation completed successfully at 2022-07-11T20:52:15.000Z',\n to_artifact_size: 2048000\n },\n 'delta-job-2': {\n ...deltaJobs['delta-job-2'],\n delta_artifact_size: null,\n deployment_id: 'd2',\n devices_types_compatible: ['raspberrypi0w', 'raspberrypi0-wifi', 'raspberrypi3', 'raspberrypi4'],\n exit_code: 1,\n log: 'Delta generation started at 2022-07-11T20:49:00.000Z\\nError: incompatible artifact types\\nDelta generation failed at 2022-07-11T20:51:30.000Z',\n to_artifact_size: 3072000\n },\n 'delta-job-3': {\n ...deltaJobs['delta-job-3'],\n delta_artifact_size: null,\n deployment_id: 'd3',\n devices_types_compatible: ['beaglebone', 'beaglebone-yocto'],\n exit_code: null,\n log: 'Delta generation started at 2022-07-11T20:49:00.000Z\\nQueued for processing...',\n to_artifact_size: 2560000\n },\n 'delta-job-4': {\n ...deltaJobs['delta-job-4'],\n delta_artifact_size: 512000,\n deployment_id: 'd1',\n devices_types_compatible: ['qemux86-64'],\n exit_code: 0,\n log: 'Delta generation started at 2022-07-10T15:30:00.000Z\\nProcessing artifacts...\\nArtifact uploaded successfully at 2022-07-10T15:45:20.000Z',\n to_artifact_size: 1536000\n }\n};\n\nexport const releaseHandlers = [\n http.get(`${deploymentsApiUrl}/artifacts/:id`, () => new HttpResponse(null, { status: 200 })),\n http.get(`${deploymentsApiUrl}/artifacts/:id/download`, () => HttpResponse.json({ uri: 'https://testlocation.com/artifact.mender' })),\n http.delete(\n `${deploymentsApiUrl}/artifacts/:id`,\n ({ params: { id } }) => new HttpResponse(null, { status: id === mockApiResponses.releases.byId.r1.artifacts[0].id ? 200 : 591 })\n ),\n http.put(`${deploymentsApiUrl}/artifacts/:id`, async ({ params: { id }, request }) => {\n const { description } = await request.json();\n return new HttpResponse(null, { status: id === mockApiResponses.releases.byId.r1.artifacts[0].id && description ? 200 : 592 });\n }),\n http.post(\n `${deploymentsApiUrl}/artifacts/generate`,\n () =>\n new HttpResponse(null, {\n headers: { [headerNames.location]: `${deploymentsApiUrl}/artifacts/generate/${mockApiResponses.releases.byId.r1.artifacts[0].id}`, status: 201 }\n })\n ),\n http.post(`${deploymentsApiUrl}/artifacts`, () => new HttpResponse(null, { status: 200 })),\n http.get(`${deploymentsApiUrlV2}/deployments/releases`, async ({ request }) => {\n const { searchParams } = new URL(request.url);\n const page = Number(searchParams.get('page'));\n const perPage = Number(searchParams.get('per_page'));\n if (!page || ![1, 10, 20, 50, 100, 250, 500].includes(perPage)) {\n return new HttpResponse(null, { status: 593 });\n }\n if (searchParams.get('device_type')) {\n return HttpResponse.json([]);\n }\n if (page == 42) {\n return new HttpResponse(JSON.stringify([mockApiResponses.releases.byId.r1]), { headers: { [headerNames.total]: 1 } });\n }\n const sort = searchParams.get('sort');\n const releaseListSection = releasesList.sort(customSort(sort.includes(SORTING_OPTIONS.desc), 'name')).slice((page - 1) * perPage, page * perPage);\n if (page === 1 && perPage === 1 && searchParams.get('name')) {\n return HttpResponse.json([mockApiResponses.releases.byId.r1]);\n }\n if (searchParams.get('name')) {\n return new HttpResponse(JSON.stringify(releaseListSection), { headers: { [headerNames.total]: 1234 } });\n }\n return new HttpResponse(JSON.stringify(releaseListSection), { headers: { [headerNames.total]: releasesList.length } });\n }),\n http.get(`${deploymentsApiUrlV2}/deployments/releases/:name`, () => HttpResponse.json(mockApiResponses.releases.byId.r1)),\n http.get(`${deploymentsApiUrlV2}/releases/all/tags`, () => HttpResponse.json(['foo', 'bar'])),\n http.get(`${deploymentsApiUrlV2}/releases/all/types`, () => HttpResponse.json(['single-file', 'not-this'])),\n http.put(`${deploymentsApiUrlV2}/deployments/releases/:name/tags`, async ({ params: { name }, request }) => {\n const tags = await request.json();\n if (name && tags.every(i => i && i.toString() === i)) {\n return new HttpResponse(null, { status: 200 });\n }\n return new HttpResponse(null, { status: 593 });\n }),\n http.patch(`${deploymentsApiUrlV2}/deployments/releases/:name`, async ({ params: { name }, request }) => {\n const { notes } = await request.json();\n return new HttpResponse(null, { status: name && notes.length ? 200 : 594 });\n }),\n http.get(`${deploymentsApiUrlV2}/deployments/releases/delta/jobs`, () => {\n const jobs = Object.values(deltaJobs);\n return new HttpResponse(JSON.stringify(jobs), { headers: { [headerNames.total]: jobs.length } });\n }),\n http.get(`${deploymentsApiUrlV2}/deployments/releases/delta/jobs/:jobId`, ({ params: { jobId } }) => {\n const jobDetails = mockDeltaJobDetails[jobId];\n if (jobDetails) {\n return HttpResponse.json(jobDetails);\n }\n return new HttpResponse(null, { status: 404 });\n })\n];\n"],"mappings":";;;;;;AAcA,SAAS,iBAAiB,mBAAmB,qBAAqB,mBAAmB;AACrF,SAAS,kBAAkB;AAC3B,SAAS,cAAc,YAAY;AAInC,IAAM,YAAY;AAAA,EAChB,eAAe;AAAA,IACb,IAAI;AAAA,IACJ,YAAY;AAAA,IACZ,cAAc;AAAA,IACd,YAAY;AAAA,IACZ,cAAc;AAAA,IACd,yBAAyB,CAAC,YAAY;AAAA,IACtC,SAAS;AAAA,IACT,QAAQ;AAAA,EACV;AAAA,EACA,eAAe;AAAA,IACb,IAAI;AAAA,IACJ,YAAY;AAAA,IACZ,cAAc;AAAA,IACd,YAAY;AAAA,IACZ,cAAc;AAAA,IACd,yBAAyB,CAAC,iBAAiB,qBAAqB,gBAAgB,cAAc;AAAA,IAC9F,SAAS;AAAA,IACT,QAAQ;AAAA,EACV;AAAA,EACA,eAAe;AAAA,IACb,IAAI;AAAA,IACJ,YAAY;AAAA,IACZ,cAAc;AAAA,IACd,YAAY;AAAA,IACZ,cAAc;AAAA,IACd,yBAAyB,CAAC,cAAc,oBAAoB,kBAAkB;AAAA,IAC9E,SAAS;AAAA,IACT,QAAQ;AAAA,EACV;AAAA,EACA,eAAe;AAAA,IACb,IAAI;AAAA,IACJ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,QAAI,QAAQ,KAAK,MAAM,OAAK,KAAK,EAAE,SAAS,MAAM,CAAC,GAAG;AACpD,aAAO,IAAI,aAAa,MAAM,EAAE,QAAQ,IAAI,CAAC;AAAA,IAC/C;AACA,WAAO,IAAI,aAAa,MAAM,EAAE,QAAQ,IAAI,CAAC;AAAA,EAC/C,CAAC;AAAA,EACD,KAAK,MAAM,GAAG,mBAAmB,+BAA+B,OAAO,EAAE,QAAQ,EAAE,KAAK,GAAG,QAAQ,MAAM;AACvG,UAAM,EAAE,MAAM,IAAI,MAAM,QAAQ,KAAK;AACrC,WAAO,IAAI,aAAa,MAAM,EAAE,QAAQ,QAAQ,MAAM,SAAS,MAAM,IAAI,CAAC;AAAA,EAC5E,CAAC;AAAA,EACD,KAAK,IAAI,GAAG,mBAAmB,oCAAoC,MAAM;AACvE,UAAM,OAAO,OAAO,OAAO,SAAS;AACpC,WAAO,IAAI,aAAa,KAAK,UAAU,IAAI,GAAG,EAAE,SAAS,EAAE,CAAC,YAAY,KAAK,GAAG,KAAK,OAAO,EAAE,CAAC;AAAA,EACjG,CAAC;AAAA,EACD,KAAK,IAAI,GAAG,mBAAmB,2CAA2C,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM;AACnG,UAAM,aAAa,oBAAoB,KAAK;AAC5C,QAAI,YAAY;AACd,aAAO,aAAa,KAAK,UAAU;AAAA,IACrC;AACA,WAAO,IAAI,aAAa,MAAM,EAAE,QAAQ,IAAI,CAAC;AAAA,EAC/C,CAAC;AACH;","names":[]}
@@ -1,29 +0,0 @@
1
- import {
2
- mockApiResponses
3
- } from "./chunk-O42KIJXJ.js";
4
-
5
- // src/requestHandlers/monitorHandlers.ts
6
- import { alertChannels, headerNames, monitorApiUrlv1 } from "@northern.tech/utils/constants";
7
- import { HttpResponse, http } from "msw";
8
- var monitorHandlers = [
9
- http.get(`${monitorApiUrlv1}/devices/:id/alerts`, () => new HttpResponse(JSON.stringify([]), { headers: { [headerNames.total]: 1 } })),
10
- http.get(`${monitorApiUrlv1}/devices/:id/alerts/latest`, () => HttpResponse.json([])),
11
- http.get(`${monitorApiUrlv1}/devices/:id/config`, ({ params: { id } }) => {
12
- if (id === mockApiResponses.devices.byId.a1.id) {
13
- return HttpResponse.json([{ something: "here" }]);
14
- }
15
- return HttpResponse.json([]);
16
- }),
17
- http.put(`${monitorApiUrlv1}/settings/global/channel/alerts/:channel/status`, async ({ params: { channel }, request }) => {
18
- const { enabled } = await request.json();
19
- if (Object.keys(alertChannels).includes(channel) && enabled !== void 0) {
20
- return new HttpResponse(null, { status: 200 });
21
- }
22
- return new HttpResponse(null, { status: 590 });
23
- })
24
- ];
25
-
26
- export {
27
- monitorHandlers
28
- };
29
- //# sourceMappingURL=chunk-7GNK7IRV.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/requestHandlers/monitorHandlers.ts"],"sourcesContent":["// Copyright 2021 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//@ts-nocheck\nimport { alertChannels, headerNames, monitorApiUrlv1 } from '@northern.tech/utils/constants';\nimport { HttpResponse, http } from 'msw';\n\nimport { mockApiResponses } from '../mockData';\n\nexport const monitorHandlers = [\n http.get(`${monitorApiUrlv1}/devices/:id/alerts`, () => new HttpResponse(JSON.stringify([]), { headers: { [headerNames.total]: 1 } })),\n http.get(`${monitorApiUrlv1}/devices/:id/alerts/latest`, () => HttpResponse.json([])),\n http.get(`${monitorApiUrlv1}/devices/:id/config`, ({ params: { id } }) => {\n if (id === mockApiResponses.devices.byId.a1.id) {\n return HttpResponse.json([{ something: 'here' }]);\n }\n return HttpResponse.json([]);\n }),\n http.put(`${monitorApiUrlv1}/settings/global/channel/alerts/:channel/status`, async ({ params: { channel }, request }) => {\n const { enabled } = await request.json();\n if (Object.keys(alertChannels).includes(channel) && enabled !== undefined) {\n return new HttpResponse(null, { status: 200 });\n }\n return new HttpResponse(null, { status: 590 });\n })\n];\n"],"mappings":";;;;;AAcA,SAAS,eAAe,aAAa,uBAAuB;AAC5D,SAAS,cAAc,YAAY;AAI5B,IAAM,kBAAkB;AAAA,EAC7B,KAAK,IAAI,GAAG,eAAe,uBAAuB,MAAM,IAAI,aAAa,KAAK,UAAU,CAAC,CAAC,GAAG,EAAE,SAAS,EAAE,CAAC,YAAY,KAAK,GAAG,EAAE,EAAE,CAAC,CAAC;AAAA,EACrI,KAAK,IAAI,GAAG,eAAe,8BAA8B,MAAM,aAAa,KAAK,CAAC,CAAC,CAAC;AAAA,EACpF,KAAK,IAAI,GAAG,eAAe,uBAAuB,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM;AACxE,QAAI,OAAO,iBAAiB,QAAQ,KAAK,GAAG,IAAI;AAC9C,aAAO,aAAa,KAAK,CAAC,EAAE,WAAW,OAAO,CAAC,CAAC;AAAA,IAClD;AACA,WAAO,aAAa,KAAK,CAAC,CAAC;AAAA,EAC7B,CAAC;AAAA,EACD,KAAK,IAAI,GAAG,eAAe,mDAAmD,OAAO,EAAE,QAAQ,EAAE,QAAQ,GAAG,QAAQ,MAAM;AACxH,UAAM,EAAE,QAAQ,IAAI,MAAM,QAAQ,KAAK;AACvC,QAAI,OAAO,KAAK,aAAa,EAAE,SAAS,OAAO,KAAK,YAAY,QAAW;AACzE,aAAO,IAAI,aAAa,MAAM,EAAE,QAAQ,IAAI,CAAC;AAAA,IAC/C;AACA,WAAO,IAAI,aAAa,MAAM,EAAE,QAAQ,IAAI,CAAC;AAAA,EAC/C,CAAC;AACH;","names":[]}