Files
floci-ui/packages/frontend/src/components/DynamicResourceView.test.tsx
T
2026-09-24 22:34:04 -04:00

14 lines
561 B
TypeScript

import {expect, test} from 'vitest'
import {bucketDeleteWarning} from '@/lib/bucketDeletion'
test('warns before deleting a bucket that contains folder prefixes', () => {
expect(bucketDeleteWarning({
prefix: '',
objects: [{key: 'orders/', name: 'orders', type: 'folder', size: null, lastModified: null, metadata: {}}],
})).toBe('This bucket contains objects or folders. Delete them before deleting the bucket.')
})
test('allows deleting an empty bucket', () => {
expect(bucketDeleteWarning({prefix: '', objects: []})).toBeNull()
})