8
0

indentediting.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /**
  2. * @license Copyright (c) 2003-2019, 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 ClassicTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/classictesteditor';
  7. import testUtils from '@ckeditor/ckeditor5-core/tests/_utils/utils';
  8. import MultiCommand from '../src/multicommand';
  9. import IndentEditing from '../src/indentediting';
  10. describe( 'IndentEditing', () => {
  11. let editor, element;
  12. testUtils.createSinonSandbox();
  13. beforeEach( () => {
  14. element = document.createElement( 'div' );
  15. document.body.appendChild( element );
  16. return ClassicTestEditor
  17. .create( element, { plugins: [ IndentEditing ] } )
  18. .then( newEditor => {
  19. editor = newEditor;
  20. } );
  21. } );
  22. afterEach( () => {
  23. element.remove();
  24. if ( editor ) {
  25. return editor.destroy();
  26. }
  27. } );
  28. it( 'should be named', () => {
  29. expect( IndentEditing.pluginName ).to.equal( 'IndentEditing' );
  30. } );
  31. it( 'should be loaded', () => {
  32. expect( editor.plugins.get( IndentEditing ) ).to.be.instanceOf( IndentEditing );
  33. } );
  34. it( 'should register indent command', () => {
  35. const command = editor.commands.get( 'indent' );
  36. expect( command ).to.be.instanceof( MultiCommand );
  37. } );
  38. it( 'should register outdent command', () => {
  39. const command = editor.commands.get( 'outdent' );
  40. expect( command ).to.be.instanceof( MultiCommand );
  41. } );
  42. } );