essentials.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /**
  2. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. /* global document */
  6. import EssentialsPreset 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, {
  18. plugins: [ EssentialsPreset ]
  19. } )
  20. .then( newEditor => {
  21. editor = newEditor;
  22. } );
  23. } );
  24. afterEach( () => {
  25. editor.destroy();
  26. editorElement.remove();
  27. } );
  28. it( 'should be loaded', () => {
  29. expect( editor.plugins.get( EssentialsPreset ) ).to.be.instanceOf( EssentialsPreset );
  30. } );
  31. it( 'should load all its dependencies', () => {
  32. expect( editor.plugins.get( Clipboard ) ).to.be.instanceOf( Clipboard );
  33. expect( editor.plugins.get( Enter ) ).to.be.instanceOf( Enter );
  34. expect( editor.plugins.get( Typing ) ).to.be.instanceOf( Typing );
  35. expect( editor.plugins.get( Undo ) ).to.be.instanceOf( Undo );
  36. } );
  37. } );