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

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