|
|
@@ -7,12 +7,12 @@
|
|
|
|
|
|
import ClassicTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/classictesteditor';
|
|
|
import testUtils from '@ckeditor/ckeditor5-core/tests/_utils/utils';
|
|
|
-import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview';
|
|
|
|
|
|
import Indent from '../src/indent';
|
|
|
-import MultiCommand from '../src/multicommand';
|
|
|
+import IndentEditing from '../src/indentediting';
|
|
|
+import IndentUI from '../src/indentui';
|
|
|
|
|
|
-describe( 'indent', () => {
|
|
|
+describe( 'Indent', () => {
|
|
|
let editor, element;
|
|
|
|
|
|
testUtils.createSinonSandbox();
|
|
|
@@ -40,51 +40,11 @@ describe( 'indent', () => {
|
|
|
expect( Indent.pluginName ).to.equal( 'Indent' );
|
|
|
} );
|
|
|
|
|
|
- it( 'should be loaded', () => {
|
|
|
- expect( editor.plugins.get( Indent ) ).to.be.instanceOf( Indent );
|
|
|
+ it( 'should load the IndentUI plugin', () => {
|
|
|
+ expect( editor.plugins.get( IndentUI ) ).to.be.instanceOf( IndentUI );
|
|
|
} );
|
|
|
|
|
|
- it( 'should register indent command', () => {
|
|
|
- const command = editor.commands.get( 'indent' );
|
|
|
-
|
|
|
- expect( command ).to.be.instanceof( MultiCommand );
|
|
|
- } );
|
|
|
-
|
|
|
- it( 'should register outdent command', () => {
|
|
|
- const command = editor.commands.get( 'outdent' );
|
|
|
-
|
|
|
- expect( command ).to.be.instanceof( MultiCommand );
|
|
|
- } );
|
|
|
-
|
|
|
- it( 'should set up button for indent', () => {
|
|
|
- const indentButton = editor.ui.componentFactory.create( 'indent' );
|
|
|
-
|
|
|
- expect( indentButton ).to.be.instanceOf( ButtonView );
|
|
|
- } );
|
|
|
-
|
|
|
- it( 'should set up button for indent', () => {
|
|
|
- const outdentButton = editor.ui.componentFactory.create( 'outdent' );
|
|
|
-
|
|
|
- expect( outdentButton ).to.be.instanceOf( ButtonView );
|
|
|
- } );
|
|
|
-
|
|
|
- it( 'should execute indent command on button execute', () => {
|
|
|
- const button = editor.ui.componentFactory.create( 'indent' );
|
|
|
- const spy = sinon.spy( editor, 'execute' );
|
|
|
-
|
|
|
- button.fire( 'execute' );
|
|
|
-
|
|
|
- sinon.assert.calledOnce( spy );
|
|
|
- sinon.assert.calledWithExactly( spy, 'indent' );
|
|
|
- } );
|
|
|
-
|
|
|
- it( 'should execute outdent command on button execute', () => {
|
|
|
- const button = editor.ui.componentFactory.create( 'outdent' );
|
|
|
- const spy = sinon.spy( editor, 'execute' );
|
|
|
-
|
|
|
- button.fire( 'execute' );
|
|
|
-
|
|
|
- sinon.assert.calledOnce( spy );
|
|
|
- sinon.assert.calledWithExactly( spy, 'outdent' );
|
|
|
+ it( 'should load the IndentEditing plugin', () => {
|
|
|
+ expect( editor.plugins.get( IndentEditing ) ).to.be.instanceOf( IndentEditing );
|
|
|
} );
|
|
|
} );
|