You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
527 B
13 lines
527 B
|
2 years ago
|
import { describe, expect, it } from '@jest/globals'
|
||
|
|
import isPreviewSupported from './isPreviewSupported.js'
|
||
|
|
|
||
|
|
describe('isPreviewSupported', () => {
|
||
|
|
it('should return true for any filetypes that browsers can preview', () => {
|
||
|
|
const supported = ['image/jpeg', 'image/gif', 'image/png', 'image/svg', 'image/svg+xml', 'image/bmp', 'image/jpg', 'image/webp', 'image/avif']
|
||
|
|
supported.forEach(ext => {
|
||
|
|
expect(isPreviewSupported(ext)).toEqual(true)
|
||
|
|
})
|
||
|
|
expect(isPreviewSupported('foo')).toEqual(false)
|
||
|
|
})
|
||
|
|
})
|