@scality/data-browser-library 1.0.0-preview.13 → 1.0.0-preview.15

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 (206) hide show
  1. package/dist/components/DataBrowserUI.d.ts +15 -8
  2. package/dist/components/DataBrowserUI.js +79 -55
  3. package/dist/components/Editor.d.ts +1 -1
  4. package/dist/components/Editor.js +3 -3
  5. package/dist/components/__tests__/BucketCreate.test.js +102 -102
  6. package/dist/components/__tests__/BucketDetails.test.js +121 -122
  7. package/dist/components/__tests__/BucketLifecycleFormPage.test.js +177 -177
  8. package/dist/components/__tests__/BucketLifecycleList.test.js +85 -85
  9. package/dist/components/__tests__/BucketList.test.js +175 -176
  10. package/dist/components/__tests__/BucketNotificationCreatePage.test.js +84 -84
  11. package/dist/components/__tests__/BucketOverview.test.js +256 -200
  12. package/dist/components/__tests__/BucketPolicyPage.test.js +62 -62
  13. package/dist/components/__tests__/BucketReplicationFormPage.test.js +542 -542
  14. package/dist/components/__tests__/BucketReplicationList.test.js +106 -106
  15. package/dist/components/__tests__/CreateFolderButton.test.js +56 -56
  16. package/dist/components/__tests__/DeleteBucketButton.test.js +62 -62
  17. package/dist/components/__tests__/DeleteBucketConfigRuleButton.test.js +47 -47
  18. package/dist/components/__tests__/DeleteObjectButton.test.js +63 -63
  19. package/dist/components/__tests__/EmptyBucketButton.test.js +56 -56
  20. package/dist/components/__tests__/MetadataSearch.test.js +65 -65
  21. package/dist/components/__tests__/ObjectList.test.js +251 -250
  22. package/dist/components/__tests__/UploadButton.test.js +45 -45
  23. package/dist/components/buckets/BucketCreate.d.ts +2 -2
  24. package/dist/components/buckets/BucketCreate.js +41 -41
  25. package/dist/components/buckets/BucketDetails.d.ts +2 -2
  26. package/dist/components/buckets/BucketDetails.js +48 -36
  27. package/dist/components/buckets/BucketLifecycleFormPage.js +161 -160
  28. package/dist/components/buckets/BucketLifecycleList.d.ts +2 -2
  29. package/dist/components/buckets/BucketLifecycleList.js +46 -46
  30. package/dist/components/buckets/BucketList.d.ts +2 -2
  31. package/dist/components/buckets/BucketList.js +28 -27
  32. package/dist/components/buckets/BucketLocation.js +3 -3
  33. package/dist/components/buckets/BucketOverview.d.ts +1 -1
  34. package/dist/components/buckets/BucketOverview.js +62 -62
  35. package/dist/components/buckets/BucketPage.js +19 -11
  36. package/dist/components/buckets/BucketPolicyButton.js +2 -2
  37. package/dist/components/buckets/BucketPolicyPage.js +27 -25
  38. package/dist/components/buckets/BucketReplicationFormPage.js +133 -132
  39. package/dist/components/buckets/BucketReplicationList.d.ts +2 -2
  40. package/dist/components/buckets/BucketReplicationList.js +41 -41
  41. package/dist/components/buckets/BucketVersioning.js +11 -11
  42. package/dist/components/buckets/DeleteBucketButton.js +5 -5
  43. package/dist/components/buckets/DeleteBucketConfigRuleButton.d.ts +2 -2
  44. package/dist/components/buckets/DeleteBucketConfigRuleButton.js +1 -1
  45. package/dist/components/buckets/EmptyBucketButton.js +19 -19
  46. package/dist/components/buckets/EmptyBucketSummary.d.ts +1 -1
  47. package/dist/components/buckets/EmptyBucketSummary.js +1 -1
  48. package/dist/components/buckets/EmptyBucketSummaryList.js +22 -22
  49. package/dist/components/buckets/__tests__/BucketVersioning.test.js +45 -45
  50. package/dist/components/buckets/notifications/BucketNotificationCreatePage.js +34 -33
  51. package/dist/components/buckets/notifications/EventsSection.js +144 -28
  52. package/dist/components/buckets/notifications/__tests__/events.test.d.ts +1 -0
  53. package/dist/components/buckets/notifications/__tests__/events.test.js +56 -0
  54. package/dist/components/buckets/notifications/events.d.ts +71 -7
  55. package/dist/components/buckets/notifications/events.js +98 -16
  56. package/dist/components/index.d.ts +23 -22
  57. package/dist/components/index.js +3 -2
  58. package/dist/components/layouts/ArrowNavigation.d.ts +1 -2
  59. package/dist/components/layouts/ArrowNavigation.js +3 -3
  60. package/dist/components/layouts/BrowserPageLayout.d.ts +2 -3
  61. package/dist/components/layouts/BrowserPageLayout.js +1 -1
  62. package/dist/components/objects/CreateFolderButton.d.ts +2 -2
  63. package/dist/components/objects/CreateFolderButton.js +9 -9
  64. package/dist/components/objects/DeleteObjectButton.d.ts +1 -1
  65. package/dist/components/objects/DeleteObjectButton.js +20 -20
  66. package/dist/components/objects/ObjectDetails/ObjectMetadata.d.ts +1 -1
  67. package/dist/components/objects/ObjectDetails/ObjectMetadata.js +56 -56
  68. package/dist/components/objects/ObjectDetails/ObjectSummary.d.ts +1 -1
  69. package/dist/components/objects/ObjectDetails/ObjectSummary.js +39 -39
  70. package/dist/components/objects/ObjectDetails/ObjectTags.d.ts +1 -1
  71. package/dist/components/objects/ObjectDetails/ObjectTags.js +25 -25
  72. package/dist/components/objects/ObjectDetails/__tests__/ObjectDetails.test.js +119 -119
  73. package/dist/components/objects/ObjectDetails/__tests__/ObjectSummary.test.js +211 -211
  74. package/dist/components/objects/ObjectDetails/index.d.ts +1 -1
  75. package/dist/components/objects/ObjectDetails/index.js +30 -30
  76. package/dist/components/objects/ObjectList.d.ts +5 -5
  77. package/dist/components/objects/ObjectList.js +112 -111
  78. package/dist/components/objects/ObjectLock/EditRetentionButton.js +3 -3
  79. package/dist/components/objects/ObjectLock/ObjectLockRetentionSettings.js +14 -14
  80. package/dist/components/objects/ObjectLock/ObjectLockSettings.d.ts +1 -1
  81. package/dist/components/objects/ObjectLock/ObjectLockSettings.js +29 -28
  82. package/dist/components/objects/ObjectLock/ObjectLockSettingsUtils.d.ts +1 -1
  83. package/dist/components/objects/ObjectLock/ObjectLockSettingsUtils.js +6 -6
  84. package/dist/components/objects/ObjectLock/__tests__/EditRetentionButton.test.js +50 -50
  85. package/dist/components/objects/ObjectLock/__tests__/ObjectLockSettings.test.js +77 -77
  86. package/dist/components/objects/ObjectPage.js +5 -4
  87. package/dist/components/objects/UploadButton.d.ts +3 -3
  88. package/dist/components/objects/UploadButton.js +5 -5
  89. package/dist/components/providers/DataBrowserProvider.d.ts +15 -4
  90. package/dist/components/providers/DataBrowserProvider.js +33 -11
  91. package/dist/components/search/MetadataSearch.js +26 -25
  92. package/dist/components/search/SearchHints.js +1 -1
  93. package/dist/components/ui/ArrayFieldActions.js +4 -4
  94. package/dist/components/ui/ConfirmDeleteRuleModal.d.ts +1 -1
  95. package/dist/components/ui/ConfirmDeleteRuleModal.js +1 -1
  96. package/dist/components/ui/DeleteObjectModalContent.d.ts +1 -1
  97. package/dist/components/ui/DeleteObjectModalContent.js +12 -12
  98. package/dist/components/ui/FilterFormSection.d.ts +2 -2
  99. package/dist/components/ui/FilterFormSection.js +29 -29
  100. package/dist/components/ui/Search.elements.d.ts +1 -1
  101. package/dist/components/ui/Search.elements.js +7 -7
  102. package/dist/components/ui/Table.elements.js +5 -5
  103. package/dist/config/factory.d.ts +23 -10
  104. package/dist/config/factory.js +22 -7
  105. package/dist/config/types.d.ts +20 -3
  106. package/dist/contexts/DataBrowserUICustomizationContext.d.ts +2 -2
  107. package/dist/hooks/__tests__/useISVBucketDetection.test.js +41 -41
  108. package/dist/hooks/__tests__/useIsBucketEmpty.test.js +25 -25
  109. package/dist/hooks/bucketConfiguration.d.ts +1 -1
  110. package/dist/hooks/bucketConfiguration.js +48 -48
  111. package/dist/hooks/bucketOperations.d.ts +1 -1
  112. package/dist/hooks/bucketOperations.js +6 -6
  113. package/dist/hooks/factories/__tests__/useCreateS3FunctionMutationHook.test.js +78 -78
  114. package/dist/hooks/factories/__tests__/useCreateS3InfiniteQueryHook.test.js +78 -78
  115. package/dist/hooks/factories/__tests__/useCreateS3LoginHook.test.js +42 -42
  116. package/dist/hooks/factories/__tests__/useCreateS3MutationHook.test.js +61 -61
  117. package/dist/hooks/factories/__tests__/useCreateS3QueryHook.test.js +63 -63
  118. package/dist/hooks/factories/index.d.ts +4 -4
  119. package/dist/hooks/factories/useCreateS3InfiniteQueryHook.d.ts +2 -2
  120. package/dist/hooks/factories/useCreateS3InfiniteQueryHook.js +15 -12
  121. package/dist/hooks/factories/useCreateS3LoginHook.d.ts +2 -2
  122. package/dist/hooks/factories/useCreateS3MutationHook.d.ts +3 -3
  123. package/dist/hooks/factories/useCreateS3MutationHook.js +6 -1
  124. package/dist/hooks/factories/useCreateS3QueryHook.d.ts +2 -2
  125. package/dist/hooks/factories/useCreateS3QueryHook.js +8 -5
  126. package/dist/hooks/index.d.ts +14 -13
  127. package/dist/hooks/index.js +2 -1
  128. package/dist/hooks/loginOperations.d.ts +1 -1
  129. package/dist/hooks/loginOperations.js +1 -1
  130. package/dist/hooks/objectOperations.d.ts +2 -2
  131. package/dist/hooks/objectOperations.js +49 -49
  132. package/dist/hooks/presignedOperations.d.ts +2 -2
  133. package/dist/hooks/presignedOperations.js +3 -3
  134. package/dist/hooks/useBatchObjectLegalHold.js +7 -4
  135. package/dist/hooks/useDataBrowserNavigate.d.ts +14 -0
  136. package/dist/hooks/useDataBrowserNavigate.js +24 -0
  137. package/dist/hooks/useDeleteBucketConfigRule.d.ts +2 -2
  138. package/dist/hooks/useDeleteBucketConfigRule.js +4 -4
  139. package/dist/hooks/useEmptyBucket.js +10 -10
  140. package/dist/hooks/useISVBucketDetection.js +3 -3
  141. package/dist/hooks/useIsBucketEmpty.js +4 -4
  142. package/dist/hooks/useLoginMutation.d.ts +1 -1
  143. package/dist/hooks/useLoginMutation.js +1 -1
  144. package/dist/hooks/useS3Client.d.ts +5 -0
  145. package/dist/hooks/useS3Client.js +3 -2
  146. package/dist/hooks/useS3ConfigSwitch.d.ts +11 -0
  147. package/dist/hooks/useS3ConfigSwitch.js +37 -0
  148. package/dist/index.d.ts +6 -6
  149. package/dist/test/msw/handlers/deleteBucket.d.ts +1 -1
  150. package/dist/test/msw/handlers/deleteBucket.js +20 -10
  151. package/dist/test/msw/handlers/getBucketAcl.d.ts +1 -1
  152. package/dist/test/msw/handlers/getBucketAcl.js +29 -17
  153. package/dist/test/msw/handlers/getBucketLocation.d.ts +1 -1
  154. package/dist/test/msw/handlers/getBucketLocation.js +29 -15
  155. package/dist/test/msw/handlers/getBucketPolicy.d.ts +1 -1
  156. package/dist/test/msw/handlers/getBucketPolicy.js +52 -32
  157. package/dist/test/msw/handlers/headObject.d.ts +1 -1
  158. package/dist/test/msw/handlers/headObject.js +31 -13
  159. package/dist/test/msw/handlers/listBuckets.d.ts +1 -1
  160. package/dist/test/msw/handlers/listBuckets.js +5 -3
  161. package/dist/test/msw/handlers/listObjectVersions.d.ts +1 -1
  162. package/dist/test/msw/handlers/listObjectVersions.js +38 -26
  163. package/dist/test/msw/handlers/listObjects.d.ts +1 -1
  164. package/dist/test/msw/handlers/listObjects.js +35 -23
  165. package/dist/test/msw/handlers/objectLegalHold.d.ts +1 -1
  166. package/dist/test/msw/handlers/objectLegalHold.js +31 -16
  167. package/dist/test/msw/handlers/objectRetention.d.ts +1 -1
  168. package/dist/test/msw/handlers/objectRetention.js +31 -17
  169. package/dist/test/msw/handlers/putBucketAcl.d.ts +1 -1
  170. package/dist/test/msw/handlers/putBucketAcl.js +29 -14
  171. package/dist/test/msw/handlers/putObject.d.ts +1 -1
  172. package/dist/test/msw/handlers/putObject.js +27 -12
  173. package/dist/test/msw/handlers.d.ts +3 -3
  174. package/dist/test/msw/handlers.js +72 -49
  175. package/dist/test/msw/index.d.ts +2 -2
  176. package/dist/test/msw/server.d.ts +1 -1
  177. package/dist/test/msw/server.js +1 -1
  178. package/dist/test/msw/utils.js +2 -2
  179. package/dist/test/setup.d.ts +1 -1
  180. package/dist/test/setup.js +19 -19
  181. package/dist/test/testUtils.d.ts +9 -15
  182. package/dist/test/testUtils.js +78 -92
  183. package/dist/test/utils/errorHandling.test.js +119 -119
  184. package/dist/types/index.d.ts +6 -31
  185. package/dist/utils/__tests__/s3ConfigIdentifier.test.d.ts +1 -0
  186. package/dist/utils/__tests__/s3ConfigIdentifier.test.js +429 -0
  187. package/dist/utils/constants.js +8 -8
  188. package/dist/utils/deletion/index.d.ts +2 -2
  189. package/dist/utils/deletion/messages.d.ts +1 -1
  190. package/dist/utils/deletion/messages.js +4 -4
  191. package/dist/utils/errorHandling.d.ts +3 -3
  192. package/dist/utils/errorHandling.js +6 -6
  193. package/dist/utils/hooks.js +8 -8
  194. package/dist/utils/index.d.ts +5 -4
  195. package/dist/utils/index.js +2 -0
  196. package/dist/utils/proxyMiddleware.d.ts +1 -1
  197. package/dist/utils/proxyMiddleware.js +6 -11
  198. package/dist/utils/s3Client.d.ts +2 -2
  199. package/dist/utils/s3Client.js +1 -1
  200. package/dist/utils/s3ConfigIdentifier.d.ts +68 -0
  201. package/dist/utils/s3ConfigIdentifier.js +55 -0
  202. package/dist/utils/s3RuleUtils.d.ts +5 -5
  203. package/dist/utils/s3RuleUtils.js +17 -17
  204. package/dist/utils/useSupportedNotificationEvents.d.ts +6 -0
  205. package/dist/utils/useSupportedNotificationEvents.js +7 -0
  206. package/package.json +2 -2
@@ -1,12 +1,13 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import "react";
3
3
  import { PutObjectCommand, S3Client } from "@aws-sdk/client-s3";
4
- import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
4
+ import { QueryClient } from "@tanstack/react-query";
5
5
  import { fireEvent, renderHook, screen, waitFor } from "@testing-library/react";
6
6
  import { coreUIAvailableThemes } from "@scality/core-ui/dist/style/theme";
7
7
  import { CoreUiThemeProvider } from "@scality/core-ui/dist/next";
8
8
  import { ToastProvider } from "@scality/core-ui";
9
9
  import { DataBrowserProvider } from "../components/providers/DataBrowserProvider.js";
10
+ import { DataBrowserUICustomizationProvider } from "../contexts/DataBrowserUICustomizationContext.js";
10
11
  import { overrideHandlers, setupMswServer } from "./msw/index.js";
11
12
  var __webpack_require__ = {};
12
13
  (()=>{
@@ -20,14 +21,14 @@ var __webpack_require__ = {};
20
21
  })();
21
22
  })();
22
23
  const testConfig = {
23
- endpoint: "https://s3.amazonaws.com",
24
- region: "us-east-1",
24
+ endpoint: 'https://s3.amazonaws.com',
25
+ region: 'us-east-1',
25
26
  forcePathStyle: true
26
27
  };
27
28
  const testCredentials = {
28
- accessKeyId: "test-access-key",
29
- secretAccessKey: "test-secret-key",
30
- sessionToken: "test-session-token"
29
+ accessKeyId: 'test-access-key',
30
+ secretAccessKey: 'test-secret-key',
31
+ sessionToken: 'test-session-token'
31
32
  };
32
33
  const mockS3Client = {
33
34
  send: jest.fn()
@@ -81,44 +82,24 @@ function mockOffsetSize(width, height) {
81
82
  }
82
83
  });
83
84
  const mockComputedStyle = {
84
- fontSize: "14px",
85
- paddingLeft: "0px",
86
- paddingRight: "0px",
87
- paddingTop: "0px",
88
- paddingBottom: "0px",
85
+ fontSize: '14px',
86
+ paddingLeft: '0px',
87
+ paddingRight: '0px',
88
+ paddingTop: '0px',
89
+ paddingBottom: '0px',
89
90
  getPropertyValue: jest.fn((prop)=>{
90
91
  const styles = {
91
- "font-size": "14px",
92
- "padding-left": "0px",
93
- "padding-right": "0px",
94
- "padding-top": "0px",
95
- "padding-bottom": "0px"
92
+ 'font-size': '14px',
93
+ 'padding-left': '0px',
94
+ 'padding-right': '0px',
95
+ 'padding-top': '0px',
96
+ 'padding-bottom': '0px'
96
97
  };
97
- return styles[prop] || "";
98
+ return styles[prop] || '';
98
99
  })
99
100
  };
100
- jest.spyOn(window, "getComputedStyle").mockImplementation(()=>mockComputedStyle);
101
+ jest.spyOn(window, 'getComputedStyle').mockImplementation(()=>mockComputedStyle);
101
102
  }
102
- const createQueryWrapper = ()=>{
103
- const queryClient = new QueryClient({
104
- defaultOptions: {
105
- queries: {
106
- retry: false
107
- },
108
- mutations: {
109
- retry: false
110
- }
111
- }
112
- });
113
- const theme = coreUIAvailableThemes.darkRebrand;
114
- return ({ children })=>/*#__PURE__*/ jsx(QueryClientProvider, {
115
- client: queryClient,
116
- children: /*#__PURE__*/ jsx(CoreUiThemeProvider, {
117
- theme: theme,
118
- children: children
119
- })
120
- });
121
- };
122
103
  const createTestWrapper = (config = testConfig, credentials = testCredentials)=>{
123
104
  const queryClient = new QueryClient({
124
105
  defaultOptions: {
@@ -140,10 +121,15 @@ const createTestWrapper = (config = testConfig, credentials = testCredentials)=>
140
121
  getS3Config: getConfig,
141
122
  theme: theme,
142
123
  enableDevtools: false,
143
- children: /*#__PURE__*/ jsx(CoreUiThemeProvider, {
144
- theme: theme,
145
- children: /*#__PURE__*/ jsx(ToastProvider, {
146
- children: children
124
+ children: /*#__PURE__*/ jsx(DataBrowserUICustomizationProvider, {
125
+ config: {
126
+ basePath: ''
127
+ },
128
+ children: /*#__PURE__*/ jsx(CoreUiThemeProvider, {
129
+ theme: theme,
130
+ children: /*#__PURE__*/ jsx(ToastProvider, {
131
+ children: children
132
+ })
147
133
  })
148
134
  })
149
135
  });
@@ -155,7 +141,7 @@ const renderHookWithWrapper = (hook, options)=>{
155
141
  ...renderOptions
156
142
  });
157
143
  };
158
- const createTestFile = (name, content, type = "text/plain")=>new File([
144
+ const createTestFile = (name, content, type = 'text/plain')=>new File([
159
145
  content
160
146
  ], name, {
161
147
  type
@@ -178,16 +164,16 @@ const overrideGlobalConfig = (overrides)=>{
178
164
  };
179
165
  const resetGlobalConfig = ()=>{
180
166
  globalThis.__S3_CONFIG__ = {
181
- endpoint: "http://localhost:8000",
182
- region: "us-east-1",
183
- realHost: "s3.amazonaws.com",
167
+ endpoint: 'http://localhost:8000',
168
+ region: 'us-east-1',
169
+ realHost: 's3.amazonaws.com',
184
170
  forcePathStyle: true
185
171
  };
186
172
  globalThis.__DEV_CONFIG__ = {
187
173
  useProxy: false,
188
- proxyEndpoint: "http://localhost:3000/api/s3",
189
- proxyBasePath: "/api/s3",
190
- proxyHost: "localhost",
174
+ proxyEndpoint: 'http://localhost:3000/api/s3',
175
+ proxyBasePath: '/api/s3',
176
+ proxyHost: 'localhost',
191
177
  proxyPort: 3000
192
178
  };
193
179
  globalThis.__IS_DEVELOPMENT__ = true;
@@ -201,37 +187,37 @@ const withGlobalConfig = (overrides, testFn)=>async ()=>{
201
187
  resetGlobalConfig();
202
188
  }
203
189
  };
204
- const createFactoryTestError = (testContext, operationName, details)=>new Error(`Factory Test Failure [${testContext}]: ${operationName} - ${details || "Unknown error"}. Check factory implementation and hook usage patterns.`);
190
+ const createFactoryTestError = (testContext, operationName, details)=>new Error(`Factory Test Failure [${testContext}]: ${operationName} - ${details || 'Unknown error'}. Check factory implementation and hook usage patterns.`);
205
191
  const validateFactoryHook = (hook, operationName)=>{
206
- if ("function" != typeof hook) throw createFactoryTestError("Factory Validation", operationName, "hook should be a function - check if useCreate*Hook factory is properly returning a hook function");
192
+ if ('function' != typeof hook) throw createFactoryTestError('Factory Validation', operationName, 'hook should be a function - check if useCreate*Hook factory is properly returning a hook function');
207
193
  };
208
194
  const validateHookResult = (result, hookType)=>{
209
195
  const commonProps = [
210
- "isError",
211
- "isSuccess",
212
- "data",
213
- "error"
196
+ 'isError',
197
+ 'isSuccess',
198
+ 'data',
199
+ 'error'
214
200
  ];
215
201
  const queryProps = [
216
- "isLoading"
202
+ 'isLoading'
217
203
  ];
218
204
  const mutationProps = [
219
- "mutate",
220
- "mutateAsync",
221
- "isPending"
205
+ 'mutate',
206
+ 'mutateAsync',
207
+ 'isPending'
222
208
  ];
223
209
  const infiniteProps = [
224
- "hasNextPage",
225
- "fetchNextPage",
226
- "isFetchingNextPage"
210
+ 'hasNextPage',
211
+ 'fetchNextPage',
212
+ 'isFetchingNextPage'
227
213
  ];
228
214
  const expectedProps = [
229
215
  ...commonProps,
230
- ..."query" === hookType ? queryProps : [],
231
- ..."mutation" === hookType ? mutationProps : [],
232
- ..."infiniteQuery" === hookType ? infiniteProps : []
216
+ ...'query' === hookType ? queryProps : [],
217
+ ...'mutation' === hookType ? mutationProps : [],
218
+ ...'infiniteQuery' === hookType ? infiniteProps : []
233
219
  ];
234
- for (const prop of expectedProps)if (!(prop in result)) throw createFactoryTestError("Hook Validation", hookType, `Missing property '${prop}' - check if factory is returning proper React Query hook result`);
220
+ for (const prop of expectedProps)if (!(prop in result)) throw createFactoryTestError('Hook Validation', hookType, `Missing property '${prop}' - check if factory is returning proper React Query hook result`);
235
221
  };
236
222
  const createMockMutationResult = (mutate, overrides = {})=>({
237
223
  mutate,
@@ -241,7 +227,7 @@ const createMockMutationResult = (mutate, overrides = {})=>({
241
227
  isIdle: true,
242
228
  isError: false,
243
229
  isSuccess: false,
244
- status: "idle",
230
+ status: 'idle',
245
231
  data: void 0,
246
232
  error: null,
247
233
  variables: void 0,
@@ -260,7 +246,7 @@ const createMockQueryResult = (overrides = {})=>({
260
246
  isLoadingError: false,
261
247
  isRefetchError: false,
262
248
  isSuccess: false,
263
- status: "pending",
249
+ status: 'pending',
264
250
  dataUpdatedAt: 0,
265
251
  errorUpdatedAt: 0,
266
252
  failureCount: 0,
@@ -284,15 +270,15 @@ const findToggleByLabel = (labelText)=>{
284
270
  while(current && !current.querySelector('input[type="checkbox"]'))current = current.parentElement;
285
271
  return current?.querySelector('input[type="checkbox"]');
286
272
  };
287
- const submitForm = async (buttonName = "create")=>{
273
+ const submitForm = async (buttonName = 'create')=>{
288
274
  await waitFor(()=>{
289
- const button = screen.getByRole("button", {
290
- name: "create" === buttonName ? /create/i : /save/i
275
+ const button = screen.getByRole('button', {
276
+ name: 'create' === buttonName ? /create/i : /save/i
291
277
  });
292
278
  expect(button).toBeEnabled();
293
279
  });
294
- const button = screen.getByRole("button", {
295
- name: "create" === buttonName ? /create/i : /save/i
280
+ const button = screen.getByRole('button', {
281
+ name: 'create' === buttonName ? /create/i : /save/i
296
282
  });
297
283
  fireEvent.click(button);
298
284
  };
@@ -301,7 +287,7 @@ const mockSuccessSubmit = (mockMutate)=>{
301
287
  options?.onSuccess?.();
302
288
  });
303
289
  };
304
- const mockErrorSubmit = (mockMutate, errorMessage = "Network Error")=>{
290
+ const mockErrorSubmit = (mockMutate, errorMessage = 'Network Error')=>{
305
291
  const error = new Error(errorMessage);
306
292
  mockMutate.mockImplementation((_, options)=>{
307
293
  options?.onError?.(error);
@@ -310,72 +296,72 @@ const mockErrorSubmit = (mockMutate, errorMessage = "Network Error")=>{
310
296
  const createDefaultBucketMocks = ()=>({
311
297
  versioning: {
312
298
  data: {
313
- Status: "Enabled"
299
+ Status: 'Enabled'
314
300
  },
315
- status: "success"
301
+ status: 'success'
316
302
  },
317
303
  acl: {
318
304
  data: {
319
305
  Owner: {
320
- DisplayName: "test-owner"
306
+ DisplayName: 'test-owner'
321
307
  },
322
308
  Grants: [
323
309
  {
324
310
  Grantee: {
325
- Type: "CanonicalUser",
326
- DisplayName: "test-grantee"
311
+ Type: 'CanonicalUser',
312
+ DisplayName: 'test-grantee'
327
313
  }
328
314
  }
329
315
  ]
330
316
  },
331
- status: "success"
317
+ status: 'success'
332
318
  },
333
319
  location: {
334
320
  data: {
335
- LocationConstraint: "us-west-2"
321
+ LocationConstraint: 'us-west-2'
336
322
  },
337
- status: "success"
323
+ status: 'success'
338
324
  },
339
325
  cors: {
340
326
  data: {
341
327
  CORSRules: []
342
328
  },
343
- status: "success"
329
+ status: 'success'
344
330
  },
345
331
  objectLock: {
346
332
  data: {
347
333
  ObjectLockConfiguration: {
348
- ObjectLockEnabled: "Disabled"
334
+ ObjectLockEnabled: 'Disabled'
349
335
  }
350
336
  },
351
- status: "success"
337
+ status: 'success'
352
338
  },
353
339
  policy: {
354
340
  data: void 0,
355
341
  error: null,
356
- status: "success"
342
+ status: 'success'
357
343
  },
358
344
  tagging: {
359
345
  data: {
360
346
  TagSet: []
361
347
  },
362
- status: "success"
348
+ status: 'success'
363
349
  },
364
350
  lifecycle: {
365
351
  data: {
366
352
  Rules: []
367
353
  },
368
- status: "success",
354
+ status: 'success',
369
355
  error: null
370
356
  },
371
357
  replication: {
372
358
  data: {
373
359
  ReplicationConfiguration: {
374
- Role: "arn:aws:iam::123456789012:role/replication-role",
360
+ Role: 'arn:aws:iam::123456789012:role/replication-role',
375
361
  Rules: []
376
362
  }
377
363
  },
378
- status: "success",
364
+ status: 'success',
379
365
  error: null
380
366
  },
381
367
  isvBucketStatus: {
@@ -384,7 +370,7 @@ const createDefaultBucketMocks = ()=>({
384
370
  isISVManaged: false,
385
371
  isvApplication: void 0,
386
372
  isLoading: false,
387
- bucketTagsStatus: "success"
373
+ bucketTagsStatus: 'success'
388
374
  },
389
375
  features: false
390
376
  });
@@ -406,4 +392,4 @@ const applyBucketMocks = (mocks, mockData = {})=>{
406
392
  if (mocks.useGetBucketLifecycle) mocks.useGetBucketLifecycle.mockReturnValue(data.lifecycle);
407
393
  if (mocks.useGetBucketReplication) mocks.useGetBucketReplication.mockReturnValue(data.replication);
408
394
  };
409
- export { MockedPutObjectCommand, MockedS3Client, applyBucketMocks, createDefaultBucketMocks, createFactoryTestError, createMockMutationResult, createMockQueryResult, createQueryWrapper, createTestFile, createTestWrapper, findToggleByLabel, mockErrorSubmit, mockOffsetSize, mockS3Client, mockSuccessSubmit, overrideGlobalConfig, overrideHandlers, renderHookWithWrapper, resetGlobalConfig, setupCommonMocks, setupMswServer, setupS3Mocks, submitForm, testConfig, testCredentials, validateFactoryHook, validateHookResult, withGlobalConfig };
395
+ export { MockedPutObjectCommand, MockedS3Client, applyBucketMocks, createDefaultBucketMocks, createFactoryTestError, createMockMutationResult, createMockQueryResult, createTestFile, createTestWrapper, findToggleByLabel, mockErrorSubmit, mockOffsetSize, mockS3Client, mockSuccessSubmit, overrideGlobalConfig, overrideHandlers, renderHookWithWrapper, resetGlobalConfig, setupCommonMocks, setupMswServer, setupS3Mocks, submitForm, testConfig, testCredentials, validateFactoryHook, validateHookResult, withGlobalConfig };