Преглед на файлове

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' );
+	} );
 } );