8
0

indent.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. /* global document */
  6. import ClassicTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/classictesteditor';
  7. import testUtils from '@ckeditor/ckeditor5-core/tests/_utils/utils';
  8. import Indent from '../src/indent';
  9. import IndentEditing from '../src/indentediting';
  10. import IndentUI from '../src/indentui';
  11. describe( 'Indent', () => {
  12. let editor, element;
  13. testUtils.createSinonSandbox();
  14. beforeEach( () => {
  15. element = document.createElement( 'div' );
  16. document.body.appendChild( element );
  17. return ClassicTestEditor
  18. .create( element, { plugins: [ Indent ] } )
  19. .then( newEditor => {
  20. editor = newEditor;
  21. } );
  22. } );
  23. afterEach( () => {
  24. element.remove();
  25. if ( editor ) {
  26. return editor.destroy();
  27. }
  28. } );
  29. it( 'should be named', () => {
  30. expect( Indent.pluginName ).to.equal( 'Indent' );
  31. } );
  32. it( 'should load the IndentUI plugin', () => {
  33. expect( editor.plugins.get( IndentUI ) ).to.be.instanceOf( IndentUI );
  34. } );
  35. it( 'should load the IndentEditing plugin', () => {
  36. expect( editor.plugins.get( IndentEditing ) ).to.be.instanceOf( IndentEditing );
  37. } );
  38. } );