Explorar o código

Tests: Secured HeadingCommand execution test.

Aleksander Nowodzinski %!s(int64=8) %!d(string=hai) anos
pai
achega
c728efab5a
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  1. 5 1
      packages/ckeditor5-heading/tests/headingcommand.js

+ 5 - 1
packages/ckeditor5-heading/tests/headingcommand.js

@@ -160,11 +160,15 @@ describe( 'HeadingCommand', () => {
 
 
 			it( 'does nothing when executed with already applied option', () => {
 			it( 'does nothing when executed with already applied option', () => {
 				const command = commands.heading1;
 				const command = commands.heading1;
+				const batch = document.batch();
+				const spy = sinon.spy( batch, 'rename' );
 
 
 				setData( document, '<heading1>foo[]bar</heading1>' );
 				setData( document, '<heading1>foo[]bar</heading1>' );
-				command.execute();
+
+				command.execute( { batch } );
 
 
 				expect( getData( document ) ).to.equal( '<heading1>foo[]bar</heading1>' );
 				expect( getData( document ) ).to.equal( '<heading1>foo[]bar</heading1>' );
+				sinon.assert.notCalled( spy );
 			} );
 			} );
 
 
 			it( 'converts topmost blocks', () => {
 			it( 'converts topmost blocks', () => {