imageupload.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /**
  2. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. /* globals document */
  6. import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';
  7. import Image from '@ckeditor/ckeditor5-image/src/image';
  8. import ImageUpload from '../src/imageupload';
  9. import ImageUploadProgress from '../src/imageuploadprogress';
  10. import ImageUploadButton from '../src/imageuploadbutton';
  11. import { UploadAdapterPluginMock } from './_utils/mocks';
  12. describe( 'ImageUpload', () => {
  13. let editor, editorElement;
  14. beforeEach( () => {
  15. editorElement = document.createElement( 'div' );
  16. document.body.appendChild( editorElement );
  17. return ClassicEditor
  18. .create( editorElement, {
  19. plugins: [ Image, ImageUpload, UploadAdapterPluginMock ]
  20. } )
  21. .then( newEditor => {
  22. editor = newEditor;
  23. } );
  24. } );
  25. afterEach( () => {
  26. editorElement.remove();
  27. return editor.destroy();
  28. } );
  29. it( 'should include ImageUploadProgress', () => {
  30. expect( editor.plugins.get( ImageUploadProgress ) ).to.be.instanceOf( ImageUploadProgress );
  31. } );
  32. it( 'should include ImageUploadButton', () => {
  33. expect( editor.plugins.get( ImageUploadButton ) ).to.be.instanceOf( ImageUploadButton );
  34. } );
  35. } );