diff --git a/src/files-and-videos/videos-page/data/utils.js b/src/files-and-videos/videos-page/data/utils.js index a19c8fe1b6..1e5e7a5dc7 100644 --- a/src/files-and-videos/videos-page/data/utils.js +++ b/src/files-and-videos/videos-page/data/utils.js @@ -110,11 +110,19 @@ export const getSupportedFormats = (supportedFileFormats) => { let format; if (isArray(value)) { value.forEach(val => { - format = key.replace('*', val.substring(1)); + if (val === '.mov') { + format = key.replace('*', 'quicktime'); + } else { + format = key.replace('*', val.substring(1)); + } supportedFormats.push(format); }); } else { - format = key.replace('*', value?.substring(1)); + if (value === '.mov') { + format = key.replace('*', 'quicktime'); + } else { + format = key.replace('*', value.substring(1)); + } supportedFormats.push(format); } }); diff --git a/src/files-and-videos/videos-page/data/utils.test.js b/src/files-and-videos/videos-page/data/utils.test.js index 2d3708a99d..54ca8dee0f 100644 --- a/src/files-and-videos/videos-page/data/utils.test.js +++ b/src/files-and-videos/videos-page/data/utils.test.js @@ -23,8 +23,13 @@ describe('getSupportedFormats', () => { const actual = getSupportedFormats({ 'image/*': '.png' }); expect(expected).toEqual(actual); }); + it('should return video/quicktime for .mov', () => { + const expected = ['video/quicktime']; + const actual = getSupportedFormats({ 'video/*': '.mov' }); + expect(expected).toEqual(actual); + }); it('should return array of valid file types', () => { - const expected = ['video/mp4', 'video/mov']; + const expected = ['video/mp4', 'video/quicktime']; const actual = getSupportedFormats({ 'video/*': ['.mp4', '.mov'] }); expect(expected).toEqual(actual); });