ckfinder.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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 global from '@ckeditor/ckeditor5-utils/src/dom/global';
  7. import CKFinder from '../src/ckfinder';
  8. import CKFinderUI from '../src/ckfinderui';
  9. import CKFinderEditing from '../src/ckfinderediting';
  10. import CKFinderUploadAdapter from '@ckeditor/ckeditor5-adapter-ckfinder/src/uploadadapter';
  11. describe( 'CKFinder', () => {
  12. let editorElement, editor;
  13. beforeEach( () => {
  14. editorElement = global.document.createElement( 'div' );
  15. global.document.body.appendChild( editorElement );
  16. return ClassicTestEditor
  17. .create( editorElement, {
  18. plugins: [ CKFinder ]
  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( CKFinder ) ).to.instanceOf( CKFinder );
  30. } );
  31. it( 'should load CKFinderUI plugin', () => {
  32. expect( editor.plugins.get( CKFinderUI ) ).to.instanceOf( CKFinderUI );
  33. } );
  34. it( 'should load CKFinderEditing plugin', () => {
  35. expect( editor.plugins.get( CKFinderEditing ) ).to.instanceOf( CKFinderEditing );
  36. } );
  37. it( 'should load AdapterCKFinder plugin', () => {
  38. expect( editor.plugins.get( CKFinderUploadAdapter ) ).to.instanceOf( CKFinderUploadAdapter );
  39. } );
  40. it( 'has proper name', () => {
  41. expect( CKFinder.pluginName ).to.equal( 'CKFinder' );
  42. } );
  43. } );