ソースを参照

Add missing test for indent.

Maciej Gołaszewski 6 年 前
コミット
5db1eaf6d4
1 ファイル変更20 行追加0 行削除
  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' );
+	} );
 } );