imageupload.js 1.6 KB

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