essentials.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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 ShiftEnter from '@ckeditor/ckeditor5-enter/src/shiftenter';
  11. import Typing from '@ckeditor/ckeditor5-typing/src/typing';
  12. import Undo from '@ckeditor/ckeditor5-undo/src/undo';
  13. describe( 'Essentials preset', () => {
  14. let editor, editorElement;
  15. beforeEach( () => {
  16. editorElement = document.createElement( 'div' );
  17. document.body.appendChild( editorElement );
  18. return ClassicTestEditor.create( editorElement, { plugins: [ Essentials ] } )
  19. .then( newEditor => {
  20. editor = newEditor;
  21. } );
  22. } );
  23. afterEach( () => {
  24. editor.destroy();
  25. editorElement.remove();
  26. } );
  27. it( 'should be loaded', () => {
  28. expect( editor.plugins.get( Essentials ) ).to.be.instanceOf( Essentials );
  29. } );
  30. it( 'should load all its dependencies', () => {
  31. expect( editor.plugins.get( Clipboard ) ).to.be.instanceOf( Clipboard );
  32. expect( editor.plugins.get( Enter ) ).to.be.instanceOf( Enter );
  33. expect( editor.plugins.get( ShiftEnter ) ).to.be.instanceOf( ShiftEnter );
  34. expect( editor.plugins.get( Typing ) ).to.be.instanceOf( Typing );
  35. expect( editor.plugins.get( Undo ) ).to.be.instanceOf( Undo );
  36. } );
  37. } );