ckfinderediting.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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 Command from '@ckeditor/ckeditor5-core/src/command';
  6. import ClassicTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/classictesteditor';
  7. import testUtils from '@ckeditor/ckeditor5-core/tests/_utils/utils';
  8. import ImageEditing from '@ckeditor/ckeditor5-image/src/image/imageediting';
  9. import LinkEditing from '@ckeditor/ckeditor5-link/src/linkediting';
  10. import Notification from '@ckeditor/ckeditor5-ui/src/notification/notification';
  11. import global from '@ckeditor/ckeditor5-utils/src/dom/global';
  12. import CKFinder from '../src/ckfinder';
  13. import CKFinderEditing from '../src/ckfinderediting';
  14. describe( 'CKFinderEditing', () => {
  15. let editorElement, editor;
  16. testUtils.createSinonSandbox();
  17. beforeEach( () => {
  18. editorElement = global.document.createElement( 'div' );
  19. global.document.body.appendChild( editorElement );
  20. return ClassicTestEditor
  21. .create( editorElement, {
  22. plugins: [ CKFinder ]
  23. } )
  24. .then( newEditor => {
  25. editor = newEditor;
  26. } );
  27. } );
  28. afterEach( () => {
  29. editorElement.remove();
  30. return editor.destroy();
  31. } );
  32. it( 'should be loaded', () => {
  33. expect( editor.plugins.get( CKFinderEditing ) ).to.be.instanceOf( CKFinderEditing );
  34. } );
  35. it( 'should load Notification plugin', () => {
  36. expect( editor.plugins.get( Notification ) ).to.instanceOf( Notification );
  37. } );
  38. it( 'should load ImageEditing plugin', () => {
  39. expect( editor.plugins.get( ImageEditing ) ).to.instanceOf( ImageEditing );
  40. } );
  41. it( 'should load LinkEditing plugin', () => {
  42. expect( editor.plugins.get( LinkEditing ) ).to.instanceOf( LinkEditing );
  43. } );
  44. it( 'should register command', () => {
  45. const command = editor.commands.get( 'ckfinder' );
  46. expect( command ).to.be.instanceOf( Command );
  47. } );
  48. } );