|
@@ -37,6 +37,10 @@ describe('getFileType', () => {
|
|
|
name: 'bar.dicom',
|
|
|
data: 'sdfsfhfh329fhwihs',
|
|
|
}
|
|
|
+ const fileWebp = {
|
|
|
+ name: 'bar.webp',
|
|
|
+ data: 'sdfsfhfh329fhwihs',
|
|
|
+ }
|
|
|
const toUpper = (file) => ({ ...file, name: file.name.toUpperCase() })
|
|
|
expect(getFileType(fileMP3)).toEqual('audio/mp3')
|
|
|
expect(getFileType(toUpper(fileMP3))).toEqual('audio/mp3')
|
|
@@ -46,6 +50,8 @@ describe('getFileType', () => {
|
|
|
expect(getFileType(toUpper(fileMKV))).toEqual('video/x-matroska')
|
|
|
expect(getFileType(fileDicom)).toEqual('application/dicom')
|
|
|
expect(getFileType(toUpper(fileDicom))).toEqual('application/dicom')
|
|
|
+ expect(getFileType(fileWebp)).toEqual('image/webp')
|
|
|
+ expect(getFileType(toUpper(fileWebp))).toEqual('image/webp')
|
|
|
})
|
|
|
|
|
|
it('should fail gracefully if unable to detect', () => {
|