14 lines
561 B
TypeScript
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()
|
|
})
|