essentials.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. /* 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 SelectAll from '@ckeditor/ckeditor5-select-all/src/selectall';
  11. import ShiftEnter from '@ckeditor/ckeditor5-enter/src/shiftenter';
  12. import Typing from '@ckeditor/ckeditor5-typing/src/typing';
  13. import Undo from '@ckeditor/ckeditor5-undo/src/undo';
  14. describe( 'Essentials preset', () => {
  15. let editor, editorElement;
  16. beforeEach( () => {
  17. editorElement = document.createElement( 'div' );
  18. document.body.appendChild( editorElement );
  19. return ClassicTestEditor.create( editorElement, { plugins: [ Essentials ] } )
  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( Essentials ) ).to.be.instanceOf( Essentials );
  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( SelectAll ) ).to.be.instanceOf( SelectAll );
  35. expect( editor.plugins.get( ShiftEnter ) ).to.be.instanceOf( ShiftEnter );
  36. expect( editor.plugins.get( Typing ) ).to.be.instanceOf( Typing );
  37. expect( editor.plugins.get( Undo ) ).to.be.instanceOf( Undo );
  38. } );
  39. } );