indentediting.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. import VirtualTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/virtualtesteditor';
  6. import testUtils from '@ckeditor/ckeditor5-core/tests/_utils/utils';
  7. import MultiCommand from '@ckeditor/ckeditor5-core/src/multicommand';
  8. import IndentEditing from '../src/indentediting';
  9. describe( 'IndentEditing', () => {
  10. let editor;
  11. testUtils.createSinonSandbox();
  12. beforeEach( () => {
  13. return VirtualTestEditor
  14. .create( { plugins: [ IndentEditing ] } )
  15. .then( newEditor => {
  16. editor = newEditor;
  17. } );
  18. } );
  19. afterEach( () => {
  20. if ( editor ) {
  21. return editor.destroy();
  22. }
  23. } );
  24. it( 'should be named', () => {
  25. expect( IndentEditing.pluginName ).to.equal( 'IndentEditing' );
  26. } );
  27. it( 'should be loaded', () => {
  28. expect( editor.plugins.get( IndentEditing ) ).to.be.instanceOf( IndentEditing );
  29. } );
  30. it( 'should register indent command', () => {
  31. const command = editor.commands.get( 'indent' );
  32. expect( command ).to.be.instanceof( MultiCommand );
  33. } );
  34. it( 'should register outdent command', () => {
  35. const command = editor.commands.get( 'outdent' );
  36. expect( command ).to.be.instanceof( MultiCommand );
  37. } );
  38. } );