essentials.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /**
  2. * @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. /* global document */
  6. import Essentials from '../src/essentials';
  7. import ClassicTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/classictesteditor';
  8. import Clipboard from '@ckeditor/ckeditor5-clipboard/src/clipboard';
  9. import Enter from '@ckeditor/ckeditor5-enter/src/enter';
  10. import Typing from '@ckeditor/ckeditor5-typing/src/typing';
  11. import Undo from '@ckeditor/ckeditor5-undo/src/undo';
  12. describe( 'Essentials preset', () => {
  13. let editor, editorElement;
  14. beforeEach( () => {
  15. editorElement = document.createElement( 'div' );
  16. document.body.appendChild( editorElement );
  17. return ClassicTestEditor.create( editorElement, { plugins: [ Essentials ] } )
  18. .then( newEditor => {
  19. editor = newEditor;
  20. } );
  21. } );
  22. afterEach( () => {
  23. editor.destroy();
  24. editorElement.remove();
  25. } );
  26. it( 'should be loaded', () => {
  27. expect( editor.plugins.get( Essentials ) ).to.be.instanceOf( Essentials );
  28. } );
  29. it( 'should load all its dependencies', () => {
  30. expect( editor.plugins.get( Clipboard ) ).to.be.instanceOf( Clipboard );
  31. expect( editor.plugins.get( Enter ) ).to.be.instanceOf( Enter );
  32. expect( editor.plugins.get( Typing ) ).to.be.instanceOf( Typing );
  33. expect( editor.plugins.get( Undo ) ).to.be.instanceOf( Undo );
  34. } );
  35. } );