@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,20 +1,19 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { render, screen, waitFor } from "@testing-library/react";
3
- import { MemoryRouter } from "react-router-dom";
3
+ import { MemoryRouter } from "react-router";
4
4
  import { BucketDetails } from "../buckets/BucketDetails.js";
5
5
  import { applyBucketMocks, createTestWrapper } from "../../test/testUtils.js";
6
6
  import { useGetBucketAcl, useGetBucketCors, useGetBucketLifecycle, useGetBucketLocation, useGetBucketObjectLockConfiguration, useGetBucketPolicy, useGetBucketReplication, useGetBucketTagging, useGetBucketVersioning } from "../../hooks/index.js";
7
7
  import { useISVBucketStatus } from "../../hooks/useISVBucketDetection.js";
8
8
  import { useFeatures } from "../../utils/useFeatures.js";
9
9
  import * as __WEBPACK_EXTERNAL_MODULE__contexts_DataBrowserUICustomizationContext_js_f267b01c__ from "../../contexts/DataBrowserUICustomizationContext.js";
10
- jest.mock("../../hooks");
11
- jest.mock("../../hooks/useISVBucketDetection");
12
- jest.mock("../../utils/useFeatures");
13
- jest.mock("../../contexts/DataBrowserUICustomizationContext");
10
+ jest.mock('../../hooks');
11
+ jest.mock('../../hooks/useISVBucketDetection');
12
+ jest.mock('../../utils/useFeatures');
14
13
  const mockUseParams = jest.fn();
15
14
  const mockUseNavigate = jest.fn();
16
- jest.mock("react-router-dom", ()=>({
17
- ...jest.requireActual("react-router-dom"),
15
+ jest.mock('react-router', ()=>({
16
+ ...jest.requireActual('react-router'),
18
17
  useParams: ()=>mockUseParams(),
19
18
  useNavigate: ()=>mockUseNavigate()
20
19
  }));
@@ -30,13 +29,13 @@ const mockUseGetBucketTagging = jest.mocked(useGetBucketTagging);
30
29
  const mockUseISVBucketStatus = jest.mocked(useISVBucketStatus);
31
30
  const mockUseFeatures = jest.mocked(useFeatures);
32
31
  const mockUseDataBrowserUICustomization = (config = {})=>{
33
- jest.spyOn(__WEBPACK_EXTERNAL_MODULE__contexts_DataBrowserUICustomizationContext_js_f267b01c__, "useDataBrowserUICustomization").mockReturnValue(config);
32
+ jest.spyOn(__WEBPACK_EXTERNAL_MODULE__contexts_DataBrowserUICustomizationContext_js_f267b01c__, 'useDataBrowserUICustomization').mockReturnValue(config);
34
33
  };
35
34
  const renderBucketDetails = ()=>{
36
35
  const Wrapper = createTestWrapper();
37
36
  return render(/*#__PURE__*/ jsx(MemoryRouter, {
38
37
  initialEntries: [
39
- "/buckets/test-bucket"
38
+ '/buckets/test-bucket'
40
39
  ],
41
40
  children: /*#__PURE__*/ jsx(Wrapper, {
42
41
  children: /*#__PURE__*/ jsx(BucketDetails, {})
@@ -58,165 +57,165 @@ const mockHookDefaults = (overrides = {})=>{
58
57
  useFeatures: mockUseFeatures
59
58
  }, overrides);
60
59
  };
61
- describe("BucketDetails", ()=>{
60
+ describe('BucketDetails', ()=>{
62
61
  beforeEach(()=>{
63
62
  jest.clearAllMocks();
64
63
  mockHookDefaults();
65
64
  mockUseDataBrowserUICustomization({});
66
65
  mockUseParams.mockReturnValue({
67
- bucketName: "test-bucket"
66
+ bucketName: 'test-bucket'
68
67
  });
69
68
  mockUseNavigate.mockReturnValue(jest.fn());
70
69
  });
71
- it("renders all default tabs", async ()=>{
70
+ it('renders all default tabs', async ()=>{
72
71
  renderBucketDetails();
73
72
  await waitFor(()=>{
74
- expect(screen.getByText("Overview")).toBeInTheDocument();
75
- expect(screen.getByText("Lifecycle")).toBeInTheDocument();
76
- expect(screen.getByText("Replication")).toBeInTheDocument();
73
+ expect(screen.getByText('Overview')).toBeInTheDocument();
74
+ expect(screen.getByText('Lifecycle')).toBeInTheDocument();
75
+ expect(screen.getByText('Replication')).toBeInTheDocument();
77
76
  });
78
77
  });
79
- it("shows overview tab content by default", ()=>{
78
+ it('shows overview tab content by default', ()=>{
80
79
  renderBucketDetails();
81
- const overviewTab = screen.getByText("Overview").closest('[role="tab"]');
82
- expect(overviewTab).toHaveAttribute("class", expect.stringContaining("selected"));
80
+ const overviewTab = screen.getByText('Overview').closest('[role="tab"]');
81
+ expect(overviewTab).toHaveAttribute('class', expect.stringContaining('selected'));
83
82
  });
84
- it("handles lifecycle data loading", ()=>{
83
+ it('handles lifecycle data loading', ()=>{
85
84
  mockUseGetBucketLifecycle.mockReturnValue({
86
85
  data: void 0,
87
- status: "pending",
86
+ status: 'pending',
88
87
  error: null
89
88
  });
90
89
  renderBucketDetails();
91
- expect(screen.getByText("Lifecycle")).toBeInTheDocument();
90
+ expect(screen.getByText('Lifecycle')).toBeInTheDocument();
92
91
  });
93
- it("handles lifecycle error gracefully", ()=>{
92
+ it('handles lifecycle error gracefully', ()=>{
94
93
  mockUseGetBucketLifecycle.mockReturnValue({
95
94
  data: void 0,
96
- status: "error",
97
- error: new Error("Failed to fetch")
95
+ status: 'error',
96
+ error: new Error('Failed to fetch')
98
97
  });
99
98
  renderBucketDetails();
100
- expect(screen.getByText("Lifecycle")).toBeInTheDocument();
99
+ expect(screen.getByText('Lifecycle')).toBeInTheDocument();
101
100
  });
102
- it("handles lifecycle 404 as success", ()=>{
103
- const notFoundError = new Error("Not found");
104
- notFoundError.name = "NoSuchLifecycleConfiguration";
101
+ it('handles lifecycle 404 as success', ()=>{
102
+ const notFoundError = new Error('Not found');
103
+ notFoundError.name = 'NoSuchLifecycleConfiguration';
105
104
  notFoundError.$metadata = {
106
105
  httpStatusCode: 404
107
106
  };
108
107
  mockUseGetBucketLifecycle.mockReturnValue({
109
108
  data: void 0,
110
- status: "error",
109
+ status: 'error',
111
110
  error: notFoundError
112
111
  });
113
112
  renderBucketDetails();
114
- expect(screen.getByText("Lifecycle")).toBeInTheDocument();
113
+ expect(screen.getByText('Lifecycle')).toBeInTheDocument();
115
114
  });
116
- it("displays lifecycle rules when available", ()=>{
115
+ it('displays lifecycle rules when available', ()=>{
117
116
  mockUseGetBucketLifecycle.mockReturnValue({
118
117
  data: {
119
118
  Rules: [
120
119
  {
121
- ID: "rule-1",
122
- Status: "Enabled",
120
+ ID: 'rule-1',
121
+ Status: 'Enabled',
123
122
  Filter: {}
124
123
  },
125
124
  {
126
- ID: "rule-2",
127
- Status: "Disabled",
125
+ ID: 'rule-2',
126
+ Status: 'Disabled',
128
127
  Filter: {}
129
128
  }
130
129
  ]
131
130
  },
132
- status: "success",
131
+ status: 'success',
133
132
  error: null
134
133
  });
135
134
  renderBucketDetails();
136
- expect(screen.getByText("Lifecycle")).toBeInTheDocument();
135
+ expect(screen.getByText('Lifecycle')).toBeInTheDocument();
137
136
  });
138
- it("handles replication data loading", ()=>{
137
+ it('handles replication data loading', ()=>{
139
138
  mockUseGetBucketReplication.mockReturnValue({
140
139
  data: void 0,
141
- status: "pending",
140
+ status: 'pending',
142
141
  error: null
143
142
  });
144
143
  renderBucketDetails();
145
- expect(screen.getByText("Replication")).toBeInTheDocument();
144
+ expect(screen.getByText('Replication')).toBeInTheDocument();
146
145
  });
147
- it("handles replication error gracefully", ()=>{
146
+ it('handles replication error gracefully', ()=>{
148
147
  mockUseGetBucketReplication.mockReturnValue({
149
148
  data: void 0,
150
- status: "error",
151
- error: new Error("Failed to fetch")
149
+ status: 'error',
150
+ error: new Error('Failed to fetch')
152
151
  });
153
152
  renderBucketDetails();
154
- expect(screen.getByText("Replication")).toBeInTheDocument();
153
+ expect(screen.getByText('Replication')).toBeInTheDocument();
155
154
  });
156
- it("handles replication 404 as success", ()=>{
157
- const notFoundError = new Error("Not found");
158
- notFoundError.name = "ReplicationConfigurationNotFoundError";
155
+ it('handles replication 404 as success', ()=>{
156
+ const notFoundError = new Error('Not found');
157
+ notFoundError.name = 'ReplicationConfigurationNotFoundError';
159
158
  notFoundError.$metadata = {
160
159
  httpStatusCode: 404
161
160
  };
162
161
  mockUseGetBucketReplication.mockReturnValue({
163
162
  data: void 0,
164
- status: "error",
163
+ status: 'error',
165
164
  error: notFoundError
166
165
  });
167
166
  renderBucketDetails();
168
- expect(screen.getByText("Replication")).toBeInTheDocument();
167
+ expect(screen.getByText('Replication')).toBeInTheDocument();
169
168
  });
170
- it("displays replication rules when available", ()=>{
169
+ it('displays replication rules when available', ()=>{
171
170
  mockUseGetBucketReplication.mockReturnValue({
172
171
  data: {
173
172
  ReplicationConfiguration: {
174
- Role: "arn:aws:iam::123456789012:role/replication-role",
173
+ Role: 'arn:aws:iam::123456789012:role/replication-role',
175
174
  Rules: [
176
175
  {
177
- ID: "repl-rule-1",
178
- Status: "Enabled",
176
+ ID: 'repl-rule-1',
177
+ Status: 'Enabled',
179
178
  Priority: 1,
180
179
  Destination: {
181
- Bucket: "arn:aws:s3:::destination-bucket"
180
+ Bucket: 'arn:aws:s3:::destination-bucket'
182
181
  }
183
182
  }
184
183
  ]
185
184
  }
186
185
  },
187
- status: "success",
186
+ status: 'success',
188
187
  error: null
189
188
  });
190
189
  renderBucketDetails();
191
- expect(screen.getByText("Replication")).toBeInTheDocument();
190
+ expect(screen.getByText('Replication')).toBeInTheDocument();
192
191
  });
193
- it("shows message when bucket name is missing", ()=>{
192
+ it('shows message when bucket name is missing', ()=>{
194
193
  mockUseParams.mockReturnValue({
195
194
  bucketName: void 0
196
195
  });
197
196
  renderBucketDetails();
198
- expect(screen.getByText("No bucket selected")).toBeInTheDocument();
197
+ expect(screen.getByText('No bucket selected')).toBeInTheDocument();
199
198
  });
200
- describe("extraBucketTabs support", ()=>{
201
- it("renders extra tabs when configured", async ()=>{
199
+ describe('extraBucketTabs support', ()=>{
200
+ it('renders extra tabs when configured', async ()=>{
202
201
  const CustomTab = ()=>/*#__PURE__*/ jsx("div", {
203
202
  children: "Custom Tab Content"
204
203
  });
205
204
  mockUseDataBrowserUICustomization({
206
205
  extraBucketTabs: [
207
206
  {
208
- id: "customTab",
209
- title: "Custom Tab",
207
+ id: 'customTab',
208
+ title: 'Custom Tab',
210
209
  render: CustomTab
211
210
  }
212
211
  ]
213
212
  });
214
213
  renderBucketDetails();
215
214
  await waitFor(()=>{
216
- expect(screen.getByText("Custom Tab")).toBeInTheDocument();
215
+ expect(screen.getByText('Custom Tab')).toBeInTheDocument();
217
216
  });
218
217
  });
219
- it("renders multiple extra tabs", async ()=>{
218
+ it('renders multiple extra tabs', async ()=>{
220
219
  const Tab1 = ()=>/*#__PURE__*/ jsx("div", {
221
220
  children: "Tab 1 Content"
222
221
  });
@@ -226,51 +225,51 @@ describe("BucketDetails", ()=>{
226
225
  mockUseDataBrowserUICustomization({
227
226
  extraBucketTabs: [
228
227
  {
229
- id: "tab1",
230
- title: "Tab 1",
228
+ id: 'tab1',
229
+ title: 'Tab 1',
231
230
  render: Tab1
232
231
  },
233
232
  {
234
- id: "tab2",
235
- title: "Tab 2",
233
+ id: 'tab2',
234
+ title: 'Tab 2',
236
235
  render: Tab2
237
236
  }
238
237
  ]
239
238
  });
240
239
  renderBucketDetails();
241
240
  await waitFor(()=>{
242
- expect(screen.getByText("Tab 1")).toBeInTheDocument();
243
- expect(screen.getByText("Tab 2")).toBeInTheDocument();
241
+ expect(screen.getByText('Tab 1')).toBeInTheDocument();
242
+ expect(screen.getByText('Tab 2')).toBeInTheDocument();
244
243
  });
245
244
  });
246
- it("can replace default tabs using matching IDs", async ()=>{
245
+ it('can replace default tabs using matching IDs', async ()=>{
247
246
  const CustomOverview = ()=>/*#__PURE__*/ jsx("div", {
248
247
  children: "Custom Overview Content"
249
248
  });
250
249
  mockUseDataBrowserUICustomization({
251
250
  extraBucketTabs: [
252
251
  {
253
- id: "overview",
254
- title: "Custom Overview",
252
+ id: 'overview',
253
+ title: 'Custom Overview',
255
254
  render: CustomOverview
256
255
  }
257
256
  ]
258
257
  });
259
258
  renderBucketDetails();
260
259
  await waitFor(()=>{
261
- expect(screen.getByText("Custom Overview")).toBeInTheDocument();
262
- expect(screen.queryByText("Overview")).not.toBeInTheDocument();
260
+ expect(screen.getByText('Custom Overview')).toBeInTheDocument();
261
+ expect(screen.queryByText('Overview')).not.toBeInTheDocument();
263
262
  });
264
263
  });
265
- it("supports withoutPadding option for extra tabs", async ()=>{
264
+ it('supports withoutPadding option for extra tabs', async ()=>{
266
265
  const CustomTab = ()=>/*#__PURE__*/ jsx("div", {
267
266
  children: "No Padding Content"
268
267
  });
269
268
  mockUseDataBrowserUICustomization({
270
269
  extraBucketTabs: [
271
270
  {
272
- id: "noPaddingTab",
273
- title: "No Padding",
271
+ id: 'noPaddingTab',
272
+ title: 'No Padding',
274
273
  withoutPadding: true,
275
274
  render: CustomTab
276
275
  }
@@ -278,144 +277,144 @@ describe("BucketDetails", ()=>{
278
277
  });
279
278
  renderBucketDetails();
280
279
  await waitFor(()=>{
281
- expect(screen.getByText("No Padding")).toBeInTheDocument();
280
+ expect(screen.getByText('No Padding')).toBeInTheDocument();
282
281
  });
283
282
  });
284
- it("supports custom path for extra tabs", async ()=>{
283
+ it('supports custom path for extra tabs', async ()=>{
285
284
  const CustomTab = ()=>/*#__PURE__*/ jsx("div", {
286
285
  children: "Custom Path Content"
287
286
  });
288
287
  mockUseDataBrowserUICustomization({
289
288
  extraBucketTabs: [
290
289
  {
291
- id: "customPath",
292
- title: "Custom Path Tab",
293
- path: "/custom-path",
290
+ id: 'customPath',
291
+ title: 'Custom Path Tab',
292
+ path: '/custom-path',
294
293
  render: CustomTab
295
294
  }
296
295
  ]
297
296
  });
298
297
  renderBucketDetails();
299
298
  await waitFor(()=>{
300
- expect(screen.getByText("Custom Path Tab")).toBeInTheDocument();
299
+ expect(screen.getByText('Custom Path Tab')).toBeInTheDocument();
301
300
  });
302
301
  });
303
- it("maintains correct tab order with extra tabs", async ()=>{
302
+ it('maintains correct tab order with extra tabs', async ()=>{
304
303
  const ExtraTab = ()=>/*#__PURE__*/ jsx("div", {
305
304
  children: "Extra Tab Content"
306
305
  });
307
306
  mockUseDataBrowserUICustomization({
308
307
  extraBucketTabs: [
309
308
  {
310
- id: "extraTab",
311
- title: "Extra Tab",
309
+ id: 'extraTab',
310
+ title: 'Extra Tab',
312
311
  render: ExtraTab
313
312
  }
314
313
  ]
315
314
  });
316
315
  renderBucketDetails();
317
316
  await waitFor(()=>{
318
- const tabs = screen.getAllByRole("tab");
317
+ const tabs = screen.getAllByRole('tab');
319
318
  const tabTexts = tabs.map((tab)=>tab.textContent);
320
319
  expect(tabTexts).toEqual([
321
- "Overview",
322
- "Lifecycle",
323
- "Replication",
324
- "Extra Tab"
320
+ 'Overview',
321
+ 'Lifecycle',
322
+ 'Replication',
323
+ 'Extra Tab'
325
324
  ]);
326
325
  });
327
326
  });
328
- it("can replace lifecycle tab", async ()=>{
327
+ it('can replace lifecycle tab', async ()=>{
329
328
  const CustomLifecycle = ()=>/*#__PURE__*/ jsx("div", {
330
329
  children: "Custom Lifecycle Content"
331
330
  });
332
331
  mockUseDataBrowserUICustomization({
333
332
  extraBucketTabs: [
334
333
  {
335
- id: "lifecycle",
336
- title: "Custom Lifecycle",
334
+ id: 'lifecycle',
335
+ title: 'Custom Lifecycle',
337
336
  render: CustomLifecycle
338
337
  }
339
338
  ]
340
339
  });
341
340
  renderBucketDetails();
342
341
  await waitFor(()=>{
343
- expect(screen.getByText("Custom Lifecycle")).toBeInTheDocument();
344
- expect(screen.queryByText("Lifecycle")).not.toBeInTheDocument();
342
+ expect(screen.getByText('Custom Lifecycle')).toBeInTheDocument();
343
+ expect(screen.queryByText('Lifecycle')).not.toBeInTheDocument();
345
344
  });
346
345
  });
347
- it("can replace replication tab", async ()=>{
346
+ it('can replace replication tab', async ()=>{
348
347
  const CustomReplication = ()=>/*#__PURE__*/ jsx("div", {
349
348
  children: "Custom Replication Content"
350
349
  });
351
350
  mockUseDataBrowserUICustomization({
352
351
  extraBucketTabs: [
353
352
  {
354
- id: "replication",
355
- title: "Custom Replication",
353
+ id: 'replication',
354
+ title: 'Custom Replication',
356
355
  render: CustomReplication
357
356
  }
358
357
  ]
359
358
  });
360
359
  renderBucketDetails();
361
360
  await waitFor(()=>{
362
- expect(screen.getByText("Custom Replication")).toBeInTheDocument();
363
- expect(screen.queryByText("Replication")).not.toBeInTheDocument();
361
+ expect(screen.getByText('Custom Replication')).toBeInTheDocument();
362
+ expect(screen.queryByText('Replication')).not.toBeInTheDocument();
364
363
  });
365
364
  });
366
365
  });
367
- describe("Tab query parameters", ()=>{
368
- it("creates correct query object for overview tab", ()=>{
366
+ describe('Tab query parameters', ()=>{
367
+ it('creates correct query object for overview tab', ()=>{
369
368
  renderBucketDetails();
370
- const overviewTab = screen.getByText("Overview");
369
+ const overviewTab = screen.getByText('Overview');
371
370
  expect(overviewTab).toBeInTheDocument();
372
371
  expect(overviewTab.closest('[role="tab"]')).toBeInTheDocument();
373
372
  });
374
- it("creates correct query object for lifecycle tab", ()=>{
373
+ it('creates correct query object for lifecycle tab', ()=>{
375
374
  renderBucketDetails();
376
- const lifecycleTab = screen.getByText("Lifecycle");
375
+ const lifecycleTab = screen.getByText('Lifecycle');
377
376
  expect(lifecycleTab).toBeInTheDocument();
378
377
  expect(lifecycleTab.closest('[role="tab"]')).toBeInTheDocument();
379
378
  });
380
- it("creates correct query object for replication tab", ()=>{
379
+ it('creates correct query object for replication tab', ()=>{
381
380
  renderBucketDetails();
382
- const replicationTab = screen.getByText("Replication");
381
+ const replicationTab = screen.getByText('Replication');
383
382
  expect(replicationTab).toBeInTheDocument();
384
383
  expect(replicationTab.closest('[role="tab"]')).toBeInTheDocument();
385
384
  });
386
385
  });
387
- describe("Status transformation", ()=>{
388
- it("transforms pending status to loading", ()=>{
386
+ describe('Status transformation', ()=>{
387
+ it('transforms pending status to loading', ()=>{
389
388
  mockUseGetBucketLifecycle.mockReturnValue({
390
389
  data: void 0,
391
- status: "pending",
390
+ status: 'pending',
392
391
  error: null
393
392
  });
394
393
  renderBucketDetails();
395
- expect(screen.getByText("Lifecycle")).toBeInTheDocument();
394
+ expect(screen.getByText('Lifecycle')).toBeInTheDocument();
396
395
  });
397
- it("transforms error status correctly", ()=>{
396
+ it('transforms error status correctly', ()=>{
398
397
  mockUseGetBucketLifecycle.mockReturnValue({
399
398
  data: void 0,
400
- status: "error",
401
- error: new Error("Generic error")
399
+ status: 'error',
400
+ error: new Error('Generic error')
402
401
  });
403
402
  renderBucketDetails();
404
- expect(screen.getByText("Lifecycle")).toBeInTheDocument();
403
+ expect(screen.getByText('Lifecycle')).toBeInTheDocument();
405
404
  });
406
- it("transforms 404 error to success", ()=>{
407
- const notFoundError = new Error("Not found");
408
- notFoundError.name = "NoSuchLifecycleConfiguration";
405
+ it('transforms 404 error to success', ()=>{
406
+ const notFoundError = new Error('Not found');
407
+ notFoundError.name = 'NoSuchLifecycleConfiguration';
409
408
  notFoundError.$metadata = {
410
409
  httpStatusCode: 404
411
410
  };
412
411
  mockUseGetBucketLifecycle.mockReturnValue({
413
412
  data: void 0,
414
- status: "error",
413
+ status: 'error',
415
414
  error: notFoundError
416
415
  });
417
416
  renderBucketDetails();
418
- expect(screen.getByText("Lifecycle")).toBeInTheDocument();
417
+ expect(screen.getByText('Lifecycle')).toBeInTheDocument();
419
418
  });
420
419
  });
421
420
  });