imagestyle.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. import ClassicTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/classictesteditor';
  6. import Image from '../src/image';
  7. import ImageStyle from '../src/imagestyle';
  8. import ImageStyleEditing from '../src/imagestyle/imagestyleediting';
  9. import ImageStyleUI from '../src/imagestyle/imagestyleui';
  10. import global from '@ckeditor/ckeditor5-utils/src/dom/global';
  11. describe( 'ImageStyle', () => {
  12. let editor, editorElement;
  13. beforeEach( () => {
  14. editorElement = global.document.createElement( 'div' );
  15. global.document.body.appendChild( editorElement );
  16. return ClassicTestEditor
  17. .create( editorElement, {
  18. plugins: [ Image, ImageStyle ]
  19. } )
  20. .then( newEditor => {
  21. editor = newEditor;
  22. } );
  23. } );
  24. afterEach( () => {
  25. editorElement.remove();
  26. return editor.destroy();
  27. } );
  28. it( 'should be loaded', () => {
  29. expect( editor.plugins.get( ImageStyle ) ).to.be.instanceOf( ImageStyle );
  30. } );
  31. it( 'should load ImageStyleEditing plugin', () => {
  32. expect( editor.plugins.get( ImageStyleEditing ) ).to.be.instanceOf( ImageStyleEditing );
  33. } );
  34. it( 'should load ImageStyleUI plugin', () => {
  35. expect( editor.plugins.get( ImageStyleUI ) ).to.be.instanceOf( ImageStyleUI );
  36. } );
  37. } );