ckfinderediting.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /**
  2. * @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  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 Notification from '@ckeditor/ckeditor5-ui/src/notification/notification';
  9. import global from '@ckeditor/ckeditor5-utils/src/dom/global';
  10. import CKFinder from '../src/ckfinder';
  11. import CKFinderEditing from '../src/ckfinderediting';
  12. describe( 'CKFinderEditing', () => {
  13. let editorElement, editor;
  14. testUtils.createSinonSandbox();
  15. beforeEach( () => {
  16. editorElement = global.document.createElement( 'div' );
  17. global.document.body.appendChild( editorElement );
  18. return ClassicTestEditor
  19. .create( editorElement, {
  20. plugins: [ CKFinder ]
  21. } )
  22. .then( newEditor => {
  23. editor = newEditor;
  24. } );
  25. } );
  26. afterEach( () => {
  27. editorElement.remove();
  28. return editor.destroy();
  29. } );
  30. it( 'should be loaded', () => {
  31. expect( editor.plugins.get( CKFinderEditing ) ).to.be.instanceOf( CKFinderEditing );
  32. } );
  33. it( 'should load Notification plugin', () => {
  34. expect( editor.plugins.get( Notification ) ).to.instanceOf( Notification );
  35. } );
  36. it( 'should register command', () => {
  37. const command = editor.commands.get( 'ckfinder' );
  38. expect( command ).to.be.instanceOf( Command );
  39. } );
  40. } );