utils.js 938 B

12345678910111213141516171819202122232425262728293031
  1. /**
  2. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. import { isImageType } from '../src/utils';
  6. describe( 'utils', () => {
  7. describe( 'isImageType', () => {
  8. it( 'should return true for png mime type', () => {
  9. expect( isImageType( { type: 'image/png' } ) ).to.be.true;
  10. } );
  11. it( 'should return true for jpeg mime type', () => {
  12. expect( isImageType( { type: 'image/jpeg' } ) ).to.be.true;
  13. } );
  14. it( 'should return true for gif mime type', () => {
  15. expect( isImageType( { type: 'image/gif' } ) ).to.be.true;
  16. } );
  17. it( 'should return true for bmp mime type', () => {
  18. expect( isImageType( { type: 'image/bmp' } ) ).to.be.true;
  19. } );
  20. it( 'should return false for other mime types', () => {
  21. expect( isImageType( { type: 'audio/mp3' } ) ).to.be.false;
  22. expect( isImageType( { type: 'video/mpeg' } ) ).to.be.false;
  23. } );
  24. } );
  25. } );