/** * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ import { isImageType } from '../../src/imageupload/utils'; describe( 'upload utils', () => { describe( 'isImageType()', () => { it( 'should return true for png mime type', () => { expect( isImageType( { type: 'image/png' } ) ).to.be.true; } ); it( 'should return true for jpeg mime type', () => { expect( isImageType( { type: 'image/jpeg' } ) ).to.be.true; } ); it( 'should return true for gif mime type', () => { expect( isImageType( { type: 'image/gif' } ) ).to.be.true; } ); it( 'should return true for bmp mime type', () => { expect( isImageType( { type: 'image/bmp' } ) ).to.be.true; } ); it( 'should return false for other mime types', () => { expect( isImageType( { type: 'audio/mp3' } ) ).to.be.false; expect( isImageType( { type: 'video/mpeg' } ) ).to.be.false; } ); } ); } );