@scality/data-browser-library 1.0.0-preview.9 → 1.0.1

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 (285) hide show
  1. package/dist/components/DataBrowserUI.d.ts +12 -0
  2. package/dist/components/DataBrowserUI.js +99 -0
  3. package/dist/components/Editor.d.ts +1 -1
  4. package/dist/components/Editor.js +3 -3
  5. package/dist/components/__tests__/BucketAccessor.test.js +214 -0
  6. package/dist/components/__tests__/BucketCorsPage.test.d.ts +1 -0
  7. package/dist/components/__tests__/BucketCorsPage.test.js +263 -0
  8. package/dist/components/__tests__/BucketCreate.test.js +271 -105
  9. package/dist/components/__tests__/BucketDetails.test.d.ts +1 -0
  10. package/dist/components/__tests__/BucketDetails.test.js +421 -0
  11. package/dist/components/__tests__/BucketLifecycleFormPage.test.d.ts +13 -0
  12. package/dist/components/__tests__/BucketLifecycleFormPage.test.js +178 -178
  13. package/dist/components/__tests__/BucketLifecycleList.test.js +85 -85
  14. package/dist/components/__tests__/BucketList.test.js +463 -239
  15. package/dist/components/__tests__/BucketNotificationFormPage.test.d.ts +1 -0
  16. package/dist/components/__tests__/BucketNotificationFormPage.test.js +348 -0
  17. package/dist/components/__tests__/BucketNotificationList.test.d.ts +1 -0
  18. package/dist/components/__tests__/BucketNotificationList.test.js +379 -0
  19. package/dist/components/__tests__/BucketOverview.test.js +281 -266
  20. package/dist/components/__tests__/BucketPolicyPage.test.js +151 -99
  21. package/dist/components/__tests__/BucketReplicationFormPage.test.d.ts +15 -0
  22. package/dist/components/__tests__/BucketReplicationFormPage.test.js +544 -544
  23. package/dist/components/__tests__/BucketReplicationList.test.js +106 -106
  24. package/dist/components/__tests__/CreateFolderButton.test.js +56 -56
  25. package/dist/components/__tests__/DeleteBucketButton.test.js +64 -64
  26. package/dist/components/__tests__/DeleteBucketConfigRuleButton.test.js +47 -47
  27. package/dist/components/__tests__/DeleteObjectButton.test.js +64 -64
  28. package/dist/components/__tests__/EmptyBucketButton.test.js +59 -59
  29. package/dist/components/__tests__/MetadataSearch.test.js +65 -65
  30. package/dist/components/__tests__/ObjectList.test.js +741 -240
  31. package/dist/components/__tests__/UploadButton.test.js +45 -45
  32. package/dist/components/breadcrumb/Breadcrumb.d.ts +6 -0
  33. package/dist/components/breadcrumb/Breadcrumb.js +37 -0
  34. package/dist/components/breadcrumb/DataBrowserBreadcrumb.d.ts +1 -0
  35. package/dist/components/breadcrumb/DataBrowserBreadcrumb.js +10 -0
  36. package/dist/components/breadcrumb/__tests__/Breadcrumb.test.d.ts +1 -0
  37. package/dist/components/breadcrumb/__tests__/Breadcrumb.test.js +196 -0
  38. package/dist/components/breadcrumb/__tests__/DataBrowserBreadcrumb.test.d.ts +1 -0
  39. package/dist/components/breadcrumb/__tests__/DataBrowserBreadcrumb.test.js +153 -0
  40. package/dist/components/breadcrumb/__tests__/useBreadcrumbPaths.test.d.ts +1 -0
  41. package/dist/components/breadcrumb/__tests__/useBreadcrumbPaths.test.js +134 -0
  42. package/dist/components/breadcrumb/index.d.ts +8 -0
  43. package/dist/components/breadcrumb/index.js +4 -0
  44. package/dist/components/breadcrumb/useBreadcrumbPaths.d.ts +2 -0
  45. package/dist/components/breadcrumb/useBreadcrumbPaths.js +82 -0
  46. package/dist/components/buckets/BucketAccessor.d.ts +2 -0
  47. package/dist/components/buckets/BucketAccessor.js +125 -0
  48. package/dist/components/buckets/BucketConfigEditButton.d.ts +8 -0
  49. package/dist/components/buckets/{BucketPolicyButton.js → BucketConfigEditButton.js} +9 -5
  50. package/dist/components/buckets/BucketCorsPage.d.ts +1 -0
  51. package/dist/components/buckets/BucketCorsPage.js +234 -0
  52. package/dist/components/buckets/BucketCreate.d.ts +3 -2
  53. package/dist/components/buckets/BucketCreate.js +89 -47
  54. package/dist/components/buckets/BucketDetails.d.ts +42 -0
  55. package/dist/components/buckets/BucketDetails.js +249 -85
  56. package/dist/components/buckets/BucketLifecycleFormPage.js +206 -190
  57. package/dist/components/buckets/BucketLifecycleList.d.ts +2 -2
  58. package/dist/components/buckets/BucketLifecycleList.js +47 -47
  59. package/dist/components/buckets/BucketList.d.ts +7 -8
  60. package/dist/components/buckets/BucketList.js +158 -101
  61. package/dist/components/buckets/BucketLocation.js +4 -4
  62. package/dist/components/buckets/BucketOverview.d.ts +22 -2
  63. package/dist/components/buckets/BucketOverview.js +394 -187
  64. package/dist/components/buckets/BucketPage.js +43 -21
  65. package/dist/components/buckets/BucketPolicyPage.js +155 -127
  66. package/dist/components/buckets/BucketReplicationFormPage.js +134 -133
  67. package/dist/components/buckets/BucketReplicationList.d.ts +2 -2
  68. package/dist/components/buckets/BucketReplicationList.js +42 -42
  69. package/dist/components/buckets/BucketVersioning.d.ts +4 -0
  70. package/dist/components/buckets/BucketVersioning.js +76 -0
  71. package/dist/components/buckets/DeleteBucketButton.js +8 -8
  72. package/dist/components/buckets/DeleteBucketConfigRuleButton.d.ts +2 -2
  73. package/dist/components/buckets/DeleteBucketConfigRuleButton.js +2 -2
  74. package/dist/components/buckets/EmptyBucketButton.js +24 -24
  75. package/dist/components/buckets/EmptyBucketSummary.d.ts +2 -2
  76. package/dist/components/buckets/EmptyBucketSummary.js +1 -1
  77. package/dist/components/buckets/EmptyBucketSummaryList.d.ts +1 -1
  78. package/dist/components/buckets/EmptyBucketSummaryList.js +22 -22
  79. package/dist/components/buckets/__tests__/BucketVersioning.test.d.ts +1 -0
  80. package/dist/components/buckets/__tests__/BucketVersioning.test.js +163 -0
  81. package/dist/components/buckets/notifications/BucketNotificationFormPage.d.ts +1 -0
  82. package/dist/components/buckets/notifications/BucketNotificationFormPage.js +316 -0
  83. package/dist/components/buckets/notifications/BucketNotificationList.d.ts +10 -0
  84. package/dist/components/buckets/notifications/BucketNotificationList.js +267 -0
  85. package/dist/components/buckets/notifications/EventsSection.js +145 -29
  86. package/dist/components/buckets/notifications/__tests__/events.test.d.ts +1 -0
  87. package/dist/components/buckets/notifications/__tests__/events.test.js +56 -0
  88. package/dist/components/buckets/notifications/events.d.ts +71 -7
  89. package/dist/components/buckets/notifications/events.js +98 -16
  90. package/dist/components/index.d.ts +27 -20
  91. package/dist/components/index.js +17 -10
  92. package/dist/components/layouts/ArrowNavigation.d.ts +3 -0
  93. package/dist/components/layouts/ArrowNavigation.js +28 -0
  94. package/dist/components/layouts/BrowserPageLayout.d.ts +5 -1
  95. package/dist/components/layouts/BrowserPageLayout.js +10 -5
  96. package/dist/components/objects/CreateFolderButton.d.ts +2 -2
  97. package/dist/components/objects/CreateFolderButton.js +12 -12
  98. package/dist/components/objects/DeleteObjectButton.d.ts +1 -1
  99. package/dist/components/objects/DeleteObjectButton.js +19 -21
  100. package/dist/components/objects/GetPresignedUrlButton.d.ts +7 -0
  101. package/dist/components/objects/GetPresignedUrlButton.js +255 -0
  102. package/dist/components/objects/ObjectDetails/ObjectMetadata.d.ts +2 -2
  103. package/dist/components/objects/ObjectDetails/ObjectMetadata.js +263 -230
  104. package/dist/components/objects/ObjectDetails/ObjectSummary.d.ts +2 -2
  105. package/dist/components/objects/ObjectDetails/ObjectSummary.js +540 -138
  106. package/dist/components/objects/ObjectDetails/ObjectTags.d.ts +2 -2
  107. package/dist/components/objects/ObjectDetails/ObjectTags.js +95 -123
  108. package/dist/components/objects/ObjectDetails/__tests__/ObjectDetails.test.d.ts +1 -0
  109. package/dist/components/objects/ObjectDetails/__tests__/ObjectDetails.test.js +516 -0
  110. package/dist/components/objects/ObjectDetails/__tests__/ObjectSummary.test.d.ts +1 -0
  111. package/dist/components/objects/ObjectDetails/__tests__/ObjectSummary.test.js +1064 -0
  112. package/dist/components/objects/ObjectDetails/index.d.ts +18 -2
  113. package/dist/components/objects/ObjectDetails/index.js +152 -40
  114. package/dist/components/objects/ObjectList.d.ts +12 -10
  115. package/dist/components/objects/ObjectList.js +590 -263
  116. package/dist/components/objects/ObjectLock/EditRetentionButton.js +4 -4
  117. package/dist/components/objects/ObjectLock/ObjectLockRetentionSettings.js +15 -15
  118. package/dist/components/objects/ObjectLock/ObjectLockSettings.d.ts +1 -1
  119. package/dist/components/objects/ObjectLock/ObjectLockSettings.js +32 -31
  120. package/dist/components/objects/ObjectLock/ObjectLockSettingsUtils.d.ts +1 -1
  121. package/dist/components/objects/ObjectLock/ObjectLockSettingsUtils.js +6 -6
  122. package/dist/components/objects/ObjectLock/__tests__/EditRetentionButton.test.js +51 -51
  123. package/dist/components/objects/ObjectLock/__tests__/ObjectLockSettings.test.js +78 -78
  124. package/dist/components/objects/ObjectPage.js +12 -8
  125. package/dist/components/objects/UploadButton.d.ts +3 -3
  126. package/dist/components/objects/UploadButton.js +10 -10
  127. package/dist/components/objects/__tests__/GetPresignedUrlButton.test.d.ts +1 -0
  128. package/dist/components/objects/__tests__/GetPresignedUrlButton.test.js +531 -0
  129. package/dist/components/providers/DataBrowserProvider.d.ts +23 -12
  130. package/dist/components/providers/DataBrowserProvider.js +60 -38
  131. package/dist/components/providers/QueryProvider.d.ts +9 -0
  132. package/dist/components/providers/QueryProvider.js +21 -0
  133. package/dist/components/search/MetadataSearch.js +29 -28
  134. package/dist/components/search/SearchHints.js +1 -1
  135. package/dist/components/ui/ArrayFieldActions.js +12 -7
  136. package/dist/components/ui/ConfirmDeleteRuleModal.d.ts +2 -2
  137. package/dist/components/ui/ConfirmDeleteRuleModal.js +6 -1
  138. package/dist/components/ui/DeleteObjectModalContent.d.ts +1 -1
  139. package/dist/components/ui/DeleteObjectModalContent.js +12 -12
  140. package/dist/components/ui/FilterFormSection.d.ts +2 -2
  141. package/dist/components/ui/FilterFormSection.js +29 -29
  142. package/dist/components/ui/Search.elements.d.ts +2 -2
  143. package/dist/components/ui/Search.elements.js +7 -7
  144. package/dist/components/ui/Table.elements.d.ts +2 -1
  145. package/dist/components/ui/Table.elements.js +18 -12
  146. package/dist/config/__tests__/factory.test.d.ts +1 -0
  147. package/dist/config/__tests__/factory.test.js +311 -0
  148. package/dist/config/factory.d.ts +10 -56
  149. package/dist/config/factory.js +23 -71
  150. package/dist/config/types.d.ts +212 -34
  151. package/dist/contexts/DataBrowserUICustomizationContext.d.ts +27 -0
  152. package/dist/contexts/DataBrowserUICustomizationContext.js +13 -0
  153. package/dist/hooks/__tests__/useAccessibleBuckets.test.d.ts +1 -0
  154. package/dist/hooks/__tests__/useAccessibleBuckets.test.js +145 -0
  155. package/dist/hooks/__tests__/useISVBucketDetection.test.js +45 -45
  156. package/dist/hooks/__tests__/useIsBucketEmpty.test.js +27 -27
  157. package/dist/hooks/__tests__/useLoginMutation.test.d.ts +1 -0
  158. package/dist/hooks/__tests__/useLoginMutation.test.js +194 -0
  159. package/dist/hooks/bucketConfiguration.d.ts +8 -1
  160. package/dist/hooks/bucketConfiguration.js +52 -51
  161. package/dist/hooks/bucketOperations.d.ts +10 -1
  162. package/dist/hooks/bucketOperations.js +10 -9
  163. package/dist/hooks/factories/__tests__/useCreateS3FunctionMutationHook.test.js +80 -80
  164. package/dist/hooks/factories/__tests__/useCreateS3InfiniteQueryHook.test.js +80 -80
  165. package/dist/hooks/factories/__tests__/useCreateS3LoginHook.test.js +44 -44
  166. package/dist/hooks/factories/__tests__/useCreateS3MutationHook.test.js +63 -63
  167. package/dist/hooks/factories/__tests__/useCreateS3QueryHook.test.js +65 -65
  168. package/dist/hooks/factories/index.d.ts +4 -4
  169. package/dist/hooks/factories/index.js +2 -2
  170. package/dist/hooks/factories/useCreateS3InfiniteQueryHook.d.ts +2 -2
  171. package/dist/hooks/factories/useCreateS3InfiniteQueryHook.js +16 -13
  172. package/dist/hooks/factories/useCreateS3LoginHook.d.ts +2 -2
  173. package/dist/hooks/factories/useCreateS3LoginHook.js +1 -1
  174. package/dist/hooks/factories/useCreateS3MutationHook.d.ts +3 -3
  175. package/dist/hooks/factories/useCreateS3MutationHook.js +7 -2
  176. package/dist/hooks/factories/useCreateS3QueryHook.d.ts +2 -2
  177. package/dist/hooks/factories/useCreateS3QueryHook.js +11 -6
  178. package/dist/hooks/index.d.ts +19 -12
  179. package/dist/hooks/index.js +16 -9
  180. package/dist/hooks/loginOperations.d.ts +1 -1
  181. package/dist/hooks/loginOperations.js +1 -1
  182. package/dist/hooks/objectOperations.d.ts +2 -2
  183. package/dist/hooks/objectOperations.js +50 -49
  184. package/dist/hooks/presignedOperations.d.ts +4 -4
  185. package/dist/hooks/presignedOperations.js +5 -5
  186. package/dist/hooks/useAccessibleBuckets.d.ts +11 -0
  187. package/dist/hooks/useAccessibleBuckets.js +115 -0
  188. package/dist/hooks/useBatchObjectLegalHold.d.ts +11 -0
  189. package/dist/hooks/useBatchObjectLegalHold.js +48 -0
  190. package/dist/hooks/useBucketConfigEditor.d.ts +31 -0
  191. package/dist/hooks/useBucketConfigEditor.js +82 -0
  192. package/dist/hooks/useDataBrowserNavigate.d.ts +28 -0
  193. package/dist/hooks/useDataBrowserNavigate.js +24 -0
  194. package/dist/hooks/useDeleteBucketConfigRule.d.ts +2 -2
  195. package/dist/hooks/useDeleteBucketConfigRule.js +4 -4
  196. package/dist/hooks/useEmptyBucket.js +11 -11
  197. package/dist/hooks/useFeatures.d.ts +7 -0
  198. package/dist/hooks/useFeatures.js +8 -0
  199. package/dist/hooks/useISVBucketDetection.js +6 -6
  200. package/dist/hooks/useIsBucketEmpty.js +4 -4
  201. package/dist/hooks/useLimitedAccessFlow.d.ts +48 -0
  202. package/dist/hooks/useLimitedAccessFlow.js +23 -0
  203. package/dist/hooks/useS3Client.d.ts +6 -0
  204. package/dist/hooks/useS3Client.js +3 -2
  205. package/dist/hooks/useS3ConfigSwitch.d.ts +11 -0
  206. package/dist/hooks/useS3ConfigSwitch.js +37 -0
  207. package/dist/hooks/useSupportedNotificationEvents.d.ts +6 -0
  208. package/dist/hooks/useSupportedNotificationEvents.js +8 -0
  209. package/dist/index.d.ts +6 -6
  210. package/dist/index.js +2 -2
  211. package/dist/schemas/bucketPolicySchema.json +3 -13
  212. package/dist/test/msw/handlers/deleteBucket.d.ts +1 -1
  213. package/dist/test/msw/handlers/deleteBucket.js +20 -10
  214. package/dist/test/msw/handlers/getBucketAcl.d.ts +1 -1
  215. package/dist/test/msw/handlers/getBucketAcl.js +29 -17
  216. package/dist/test/msw/handlers/getBucketLocation.d.ts +1 -1
  217. package/dist/test/msw/handlers/getBucketLocation.js +29 -15
  218. package/dist/test/msw/handlers/getBucketPolicy.d.ts +1 -1
  219. package/dist/test/msw/handlers/getBucketPolicy.js +52 -32
  220. package/dist/test/msw/handlers/headObject.d.ts +1 -1
  221. package/dist/test/msw/handlers/headObject.js +31 -13
  222. package/dist/test/msw/handlers/listBuckets.d.ts +1 -1
  223. package/dist/test/msw/handlers/listBuckets.js +5 -3
  224. package/dist/test/msw/handlers/listObjectVersions.d.ts +1 -1
  225. package/dist/test/msw/handlers/listObjectVersions.js +38 -26
  226. package/dist/test/msw/handlers/listObjects.d.ts +1 -1
  227. package/dist/test/msw/handlers/listObjects.js +35 -23
  228. package/dist/test/msw/handlers/objectLegalHold.d.ts +1 -1
  229. package/dist/test/msw/handlers/objectLegalHold.js +32 -17
  230. package/dist/test/msw/handlers/objectRetention.d.ts +1 -1
  231. package/dist/test/msw/handlers/objectRetention.js +31 -17
  232. package/dist/test/msw/handlers/putBucketAcl.d.ts +1 -1
  233. package/dist/test/msw/handlers/putBucketAcl.js +29 -14
  234. package/dist/test/msw/handlers/putObject.d.ts +1 -1
  235. package/dist/test/msw/handlers/putObject.js +27 -12
  236. package/dist/test/msw/handlers.d.ts +3 -3
  237. package/dist/test/msw/handlers.js +77 -54
  238. package/dist/test/msw/index.d.ts +2 -2
  239. package/dist/test/msw/index.js +1 -1
  240. package/dist/test/msw/server.d.ts +1 -1
  241. package/dist/test/msw/server.js +1 -1
  242. package/dist/test/msw/utils.js +2 -2
  243. package/dist/test/setup.d.ts +1 -1
  244. package/dist/test/setup.js +13 -30
  245. package/dist/test/testUtils.d.ts +85 -33
  246. package/dist/test/testUtils.js +176 -111
  247. package/dist/test/utils/errorHandling.test.js +119 -119
  248. package/dist/types/index.d.ts +49 -36
  249. package/dist/types/monaco.d.ts +13 -0
  250. package/dist/types/monaco.js +0 -0
  251. package/dist/utils/__tests__/proxyMiddleware.test.d.ts +1 -0
  252. package/dist/utils/__tests__/proxyMiddleware.test.js +579 -0
  253. package/dist/utils/__tests__/s3Client.test.d.ts +1 -0
  254. package/dist/utils/__tests__/s3Client.test.js +340 -0
  255. package/dist/utils/__tests__/s3ConfigIdentifier.test.d.ts +1 -0
  256. package/dist/utils/__tests__/s3ConfigIdentifier.test.js +437 -0
  257. package/dist/utils/constants.d.ts +10 -0
  258. package/dist/utils/constants.js +19 -9
  259. package/dist/utils/deletion/index.d.ts +2 -2
  260. package/dist/utils/deletion/index.js +1 -1
  261. package/dist/utils/deletion/messages.d.ts +1 -1
  262. package/dist/utils/deletion/messages.js +4 -4
  263. package/dist/utils/errorHandling.d.ts +3 -3
  264. package/dist/utils/errorHandling.js +6 -6
  265. package/dist/utils/hooks.js +8 -8
  266. package/dist/utils/index.d.ts +5 -4
  267. package/dist/utils/index.js +4 -2
  268. package/dist/utils/proxyMiddleware.d.ts +32 -13
  269. package/dist/utils/proxyMiddleware.js +90 -36
  270. package/dist/utils/s3Client.d.ts +14 -4
  271. package/dist/utils/s3Client.js +5 -26
  272. package/dist/utils/s3ConfigIdentifier.d.ts +79 -0
  273. package/dist/utils/s3ConfigIdentifier.js +57 -0
  274. package/dist/utils/s3RuleUtils.d.ts +5 -5
  275. package/dist/utils/s3RuleUtils.js +17 -17
  276. package/package.json +10 -8
  277. package/dist/components/__tests__/BucketNotificationCreatePage.test.js +0 -316
  278. package/dist/components/buckets/BucketPolicyButton.d.ts +0 -7
  279. package/dist/components/buckets/notifications/BucketNotificationCreatePage.d.ts +0 -1
  280. package/dist/components/buckets/notifications/BucketNotificationCreatePage.js +0 -234
  281. package/dist/hooks/useLoginMutation.d.ts +0 -21
  282. package/dist/hooks/useLoginMutation.js +0 -9
  283. package/dist/utils/useFeatures.d.ts +0 -1
  284. package/dist/utils/useFeatures.js +0 -7
  285. /package/dist/components/__tests__/{BucketNotificationCreatePage.test.d.ts → BucketAccessor.test.d.ts} +0 -0
@@ -17,22 +17,22 @@ const renderBucketLifecycleList = (props = {})=>{
17
17
  };
18
18
  const mockLifecycleRules = [
19
19
  {
20
- ID: "rule-1",
21
- Status: "Enabled",
20
+ ID: 'rule-1',
21
+ Status: 'Enabled',
22
22
  Expiration: {
23
23
  Days: 30
24
24
  }
25
25
  },
26
26
  {
27
- ID: "rule-2",
28
- Status: "Disabled",
27
+ ID: 'rule-2',
28
+ Status: 'Disabled',
29
29
  NoncurrentVersionExpiration: {
30
30
  NoncurrentDays: 90
31
31
  }
32
32
  },
33
33
  {
34
- ID: "rule-3",
35
- Status: "Enabled",
34
+ ID: 'rule-3',
35
+ Status: 'Enabled',
36
36
  AbortIncompleteMultipartUpload: {
37
37
  DaysAfterInitiation: 7
38
38
  },
@@ -45,59 +45,59 @@ const mockLifecycleRules = [
45
45
  }
46
46
  ];
47
47
  const mockRuleWithDate = {
48
- ID: "rule-with-date",
49
- Status: "Enabled",
48
+ ID: 'rule-with-date',
49
+ Status: 'Enabled',
50
50
  Expiration: {
51
- Date: new Date("2025-12-31T00:00:00Z")
51
+ Date: new Date('2025-12-31T00:00:00Z')
52
52
  }
53
53
  };
54
54
  const mockRuleWithSingleDay = {
55
- ID: "rule-single-day",
56
- Status: "Enabled",
55
+ ID: 'rule-single-day',
56
+ Status: 'Enabled',
57
57
  Expiration: {
58
58
  Days: 1
59
59
  }
60
60
  };
61
- describe("BucketLifecycleList", ()=>{
61
+ describe('BucketLifecycleList', ()=>{
62
62
  beforeEach(()=>{
63
63
  jest.clearAllMocks();
64
64
  mockOffsetSize(800, 600);
65
65
  });
66
- it("shows a table with proper headers", ()=>{
66
+ it('shows a table with proper headers', ()=>{
67
67
  renderBucketLifecycleList({
68
68
  lifecycleRules: mockLifecycleRules
69
69
  });
70
- expect(screen.getByRole("grid")).toBeInTheDocument();
71
- expect(screen.getByText("Rule ID")).toBeInTheDocument();
72
- expect(screen.getByText("Status")).toBeInTheDocument();
73
- expect(screen.getByText("Actions")).toBeInTheDocument();
70
+ expect(screen.getByRole('grid')).toBeInTheDocument();
71
+ expect(screen.getByText('Rule ID')).toBeInTheDocument();
72
+ expect(screen.getByText('Status')).toBeInTheDocument();
73
+ expect(screen.getByText('Actions')).toBeInTheDocument();
74
74
  });
75
- it("displays lifecycle rules with their IDs", ()=>{
75
+ it('displays lifecycle rules with their IDs', ()=>{
76
76
  renderBucketLifecycleList({
77
77
  lifecycleRules: mockLifecycleRules
78
78
  });
79
- expect(screen.getByText("rule-1")).toBeInTheDocument();
80
- expect(screen.getByText("rule-2")).toBeInTheDocument();
81
- expect(screen.getByText("rule-3")).toBeInTheDocument();
79
+ expect(screen.getByText('rule-1')).toBeInTheDocument();
80
+ expect(screen.getByText('rule-2')).toBeInTheDocument();
81
+ expect(screen.getByText('rule-3')).toBeInTheDocument();
82
82
  });
83
- it("displays status as Active for Enabled rules", ()=>{
83
+ it('displays status as Active for Enabled rules', ()=>{
84
84
  renderBucketLifecycleList({
85
85
  lifecycleRules: mockLifecycleRules
86
86
  });
87
- const activeStatuses = screen.getAllByText("Active");
87
+ const activeStatuses = screen.getAllByText('Active');
88
88
  expect(activeStatuses.length).toBe(2);
89
89
  });
90
- it("displays status as Inactive for Disabled rules", ()=>{
90
+ it('displays status as Inactive for Disabled rules', ()=>{
91
91
  renderBucketLifecycleList({
92
92
  lifecycleRules: mockLifecycleRules
93
93
  });
94
- expect(screen.getByText("Inactive")).toBeInTheDocument();
94
+ expect(screen.getByText('Inactive')).toBeInTheDocument();
95
95
  });
96
- it("displays single action correctly", ()=>{
96
+ it('displays single action correctly', ()=>{
97
97
  const singleActionRule = [
98
98
  {
99
- ID: "single-action-rule",
100
- Status: "Enabled",
99
+ ID: 'single-action-rule',
100
+ Status: 'Enabled',
101
101
  Expiration: {
102
102
  Days: 30
103
103
  }
@@ -108,13 +108,13 @@ describe("BucketLifecycleList", ()=>{
108
108
  });
109
109
  expect(screen.getByText(/Expire current \(30 days\)/)).toBeInTheDocument();
110
110
  });
111
- it("displays multiple actions with +N more indicator", ()=>{
111
+ it('displays multiple actions with +N more indicator', ()=>{
112
112
  renderBucketLifecycleList({
113
113
  lifecycleRules: mockLifecycleRules
114
114
  });
115
115
  expect(screen.getByText(/\+2/)).toBeInTheDocument();
116
116
  });
117
- it("pluralizes days correctly - singular", ()=>{
117
+ it('pluralizes days correctly - singular', ()=>{
118
118
  renderBucketLifecycleList({
119
119
  lifecycleRules: [
120
120
  mockRuleWithSingleDay
@@ -122,17 +122,17 @@ describe("BucketLifecycleList", ()=>{
122
122
  });
123
123
  expect(screen.getByText(/1 day/)).toBeInTheDocument();
124
124
  });
125
- it("pluralizes days correctly - plural", ()=>{
125
+ it('pluralizes days correctly - plural', ()=>{
126
126
  renderBucketLifecycleList({
127
127
  lifecycleRules: mockLifecycleRules
128
128
  });
129
129
  expect(screen.getByText(/30 days/)).toBeInTheDocument();
130
130
  });
131
- it("displays Abort Incomplete MPU action", ()=>{
131
+ it('displays Abort Incomplete MPU action', ()=>{
132
132
  const mpuRule = [
133
133
  {
134
- ID: "mpu-rule",
135
- Status: "Enabled",
134
+ ID: 'mpu-rule',
135
+ Status: 'Enabled',
136
136
  AbortIncompleteMultipartUpload: {
137
137
  DaysAfterInitiation: 7
138
138
  }
@@ -143,22 +143,22 @@ describe("BucketLifecycleList", ()=>{
143
143
  });
144
144
  expect(screen.getByText(/Abort Incomplete MPU \(7 days\)/)).toBeInTheDocument();
145
145
  });
146
- it("displays dates in formatted format", ()=>{
146
+ it('displays dates in formatted format', ()=>{
147
147
  renderBucketLifecycleList({
148
148
  lifecycleRules: [
149
149
  mockRuleWithDate
150
150
  ]
151
151
  });
152
- const gridElement = screen.getByRole("grid");
153
- expect(gridElement).toHaveTextContent("2025");
152
+ const gridElement = screen.getByRole('grid');
153
+ expect(gridElement).toHaveTextContent('2025');
154
154
  });
155
- it("handles edit button click", ()=>{
155
+ it('handles edit button click', ()=>{
156
156
  const onEditRule = jest.fn();
157
157
  renderBucketLifecycleList({
158
158
  lifecycleRules: mockLifecycleRules,
159
159
  onEditRule
160
160
  });
161
- const editButtons = screen.getAllByRole("button", {
161
+ const editButtons = screen.getAllByRole('button', {
162
162
  name: /edit rule/i
163
163
  });
164
164
  expect(editButtons.length).toBeGreaterThanOrEqual(3);
@@ -166,92 +166,92 @@ describe("BucketLifecycleList", ()=>{
166
166
  expect(onEditRule).toHaveBeenCalled();
167
167
  expect(onEditRule).toHaveBeenCalledWith(expect.any(String));
168
168
  });
169
- it("renders delete buttons for each rule", ()=>{
169
+ it('renders delete buttons for each rule', ()=>{
170
170
  renderBucketLifecycleList({
171
171
  lifecycleRules: mockLifecycleRules
172
172
  });
173
- const deleteButtons = screen.getAllByRole("button", {
173
+ const deleteButtons = screen.getAllByRole('button', {
174
174
  name: /delete rule/i
175
175
  });
176
176
  expect(deleteButtons.length).toBeGreaterThanOrEqual(3);
177
177
  });
178
- it("handles empty lifecycle rules list", ()=>{
178
+ it('handles empty lifecycle rules list', ()=>{
179
179
  renderBucketLifecycleList({
180
180
  lifecycleRules: []
181
181
  });
182
- expect(screen.getByRole("grid")).toBeInTheDocument();
183
- expect(screen.getByText("Rule ID")).toBeInTheDocument();
182
+ expect(screen.getByRole('grid')).toBeInTheDocument();
183
+ expect(screen.getByText('Rule ID')).toBeInTheDocument();
184
184
  });
185
- it("handles lifecycle rules without IDs", ()=>{
185
+ it('handles lifecycle rules without IDs', ()=>{
186
186
  const rulesWithoutIds = [
187
187
  {
188
188
  ID: void 0,
189
- Status: "Enabled"
189
+ Status: 'Enabled'
190
190
  },
191
191
  {
192
- Status: "Disabled"
192
+ Status: 'Disabled'
193
193
  }
194
194
  ];
195
195
  renderBucketLifecycleList({
196
196
  lifecycleRules: rulesWithoutIds
197
197
  });
198
- const dashes = screen.getAllByText("-");
198
+ const dashes = screen.getAllByText('-');
199
199
  expect(dashes.length).toBeGreaterThan(0);
200
200
  });
201
- it("shows loading state when lifecycleStatus is loading", ()=>{
201
+ it('shows loading state when lifecycleStatus is loading', ()=>{
202
202
  renderBucketLifecycleList({
203
203
  lifecycleRules: [],
204
- lifecycleStatus: "loading"
204
+ lifecycleStatus: 'loading'
205
205
  });
206
- expect(screen.getByRole("grid")).toBeInTheDocument();
207
- expect(screen.queryByText("rule-1")).not.toBeInTheDocument();
206
+ expect(screen.getByRole('grid')).toBeInTheDocument();
207
+ expect(screen.queryByText('rule-1')).not.toBeInTheDocument();
208
208
  });
209
- it("shows error state when lifecycleStatus is error", ()=>{
209
+ it('shows error state when lifecycleStatus is error', ()=>{
210
210
  renderBucketLifecycleList({
211
211
  lifecycleRules: [],
212
- lifecycleStatus: "error"
212
+ lifecycleStatus: 'error'
213
213
  });
214
- expect(screen.getByRole("grid")).toBeInTheDocument();
215
- expect(screen.queryByText("rule-1")).not.toBeInTheDocument();
214
+ expect(screen.getByRole('grid')).toBeInTheDocument();
215
+ expect(screen.queryByText('rule-1')).not.toBeInTheDocument();
216
216
  });
217
- it("shows data when lifecycleStatus is success", ()=>{
217
+ it('shows data when lifecycleStatus is success', ()=>{
218
218
  renderBucketLifecycleList({
219
219
  lifecycleRules: mockLifecycleRules,
220
- lifecycleStatus: "success"
220
+ lifecycleStatus: 'success'
221
221
  });
222
- expect(screen.getByRole("grid")).toBeInTheDocument();
223
- expect(screen.getByText("rule-1")).toBeInTheDocument();
224
- expect(screen.getByText("rule-2")).toBeInTheDocument();
222
+ expect(screen.getByRole('grid')).toBeInTheDocument();
223
+ expect(screen.getByText('rule-1')).toBeInTheDocument();
224
+ expect(screen.getByText('rule-2')).toBeInTheDocument();
225
225
  });
226
- it("works when no callbacks are provided", ()=>{
226
+ it('works when no callbacks are provided', ()=>{
227
227
  renderBucketLifecycleList({
228
228
  lifecycleRules: mockLifecycleRules
229
229
  });
230
230
  expect(()=>{
231
- const createButton = screen.getByRole("button", {
231
+ const createButton = screen.getByRole('button', {
232
232
  name: /create rule/i
233
233
  });
234
234
  fireEvent.click(createButton);
235
- const editButtons = screen.getAllByLabelText("Edit rule");
235
+ const editButtons = screen.getAllByLabelText('Edit rule');
236
236
  fireEvent.click(editButtons[0]);
237
- const deleteButtons = screen.getAllByLabelText("Delete rule");
237
+ const deleteButtons = screen.getAllByLabelText('Delete rule');
238
238
  fireEvent.click(deleteButtons[0]);
239
239
  }).not.toThrow();
240
240
  });
241
- it("renders rows that can be selected", ()=>{
241
+ it('renders rows that can be selected', ()=>{
242
242
  renderBucketLifecycleList({
243
243
  lifecycleRules: mockLifecycleRules
244
244
  });
245
- const rows = screen.getAllByRole("row");
245
+ const rows = screen.getAllByRole('row');
246
246
  expect(rows.length).toBeGreaterThan(1);
247
247
  const firstDataRow = rows[1];
248
- expect(firstDataRow).toHaveAttribute("aria-selected");
248
+ expect(firstDataRow).toHaveAttribute('aria-selected');
249
249
  });
250
- it("displays noncurrent version expiration with keep versions", ()=>{
250
+ it('displays noncurrent version expiration with keep versions', ()=>{
251
251
  const ruleWithKeep = [
252
252
  {
253
- ID: "rule-with-keep",
254
- Status: "Enabled",
253
+ ID: 'rule-with-keep',
254
+ Status: 'Enabled',
255
255
  NoncurrentVersionExpiration: {
256
256
  NoncurrentDays: 90,
257
257
  NewerNoncurrentVersions: 3
@@ -263,15 +263,15 @@ describe("BucketLifecycleList", ()=>{
263
263
  });
264
264
  expect(screen.getByText(/90 days, keep 3/)).toBeInTheDocument();
265
265
  });
266
- it("displays transition actions", ()=>{
266
+ it('displays transition actions', ()=>{
267
267
  const ruleWithTransition = [
268
268
  {
269
- ID: "transition-rule",
270
- Status: "Enabled",
269
+ ID: 'transition-rule',
270
+ Status: 'Enabled',
271
271
  Transitions: [
272
272
  {
273
273
  Days: 60,
274
- StorageClass: "GLACIER"
274
+ StorageClass: 'GLACIER'
275
275
  }
276
276
  ]
277
277
  }
@@ -281,15 +281,15 @@ describe("BucketLifecycleList", ()=>{
281
281
  });
282
282
  expect(screen.getByText(/Transition current \(60 days\)/)).toBeInTheDocument();
283
283
  });
284
- it("displays noncurrent version transition actions", ()=>{
284
+ it('displays noncurrent version transition actions', ()=>{
285
285
  const ruleWithNoncurrentTransition = [
286
286
  {
287
- ID: "noncurrent-transition-rule",
288
- Status: "Enabled",
287
+ ID: 'noncurrent-transition-rule',
288
+ Status: 'Enabled',
289
289
  NoncurrentVersionTransitions: [
290
290
  {
291
291
  NoncurrentDays: 30,
292
- StorageClass: "GLACIER"
292
+ StorageClass: 'GLACIER'
293
293
  }
294
294
  ]
295
295
  }
@@ -299,11 +299,11 @@ describe("BucketLifecycleList", ()=>{
299
299
  });
300
300
  expect(screen.getByText(/Transition noncurrent \(30 days\)/)).toBeInTheDocument();
301
301
  });
302
- it("displays expired object delete marker action", ()=>{
302
+ it('displays expired object delete marker action', ()=>{
303
303
  const ruleWithDeleteMarker = [
304
304
  {
305
- ID: "delete-marker-rule",
306
- Status: "Enabled",
305
+ ID: 'delete-marker-rule',
306
+ Status: 'Enabled',
307
307
  Expiration: {
308
308
  ExpiredObjectDeleteMarker: true
309
309
  }
@@ -312,13 +312,13 @@ describe("BucketLifecycleList", ()=>{
312
312
  renderBucketLifecycleList({
313
313
  lifecycleRules: ruleWithDeleteMarker
314
314
  });
315
- expect(screen.getByText("Delete expired markers")).toBeInTheDocument();
315
+ expect(screen.getByText('Delete expired markers')).toBeInTheDocument();
316
316
  });
317
- it("shows info icon for multiple actions", ()=>{
317
+ it('shows info icon for multiple actions', ()=>{
318
318
  renderBucketLifecycleList({
319
319
  lifecycleRules: mockLifecycleRules
320
320
  });
321
- const rows = screen.getAllByRole("row");
321
+ const rows = screen.getAllByRole('row');
322
322
  const ruleWithMultipleActions = rows.find((row)=>within(row).queryByText(/\+2/));
323
323
  expect(ruleWithMultipleActions).toBeInTheDocument();
324
324
  });