Browse Source

Add missing test for indent.

Maciej Gołaszewski 6 years ago
parent
commit
5db1eaf6d4
1 changed files with 20 additions and 0 deletions
  1. 20 0
      packages/ckeditor5-core/tests/indent.js

+ 20 - 0
packages/ckeditor5-core/tests/indent.js

@@ -67,4 +67,24 @@ describe( 'indent', () => {
 
 		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' );
+	} );
 } );