Ver código fonte

Tests: Updated tests after tthe refactoring in the EditingKeystrokeHandler. See ckeditor/ckeditor5-core#90.

Aleksander Nowodzinski 8 anos atrás
pai
commit
a4c9f61323

+ 6 - 1
packages/ckeditor5-basic-styles/tests/bold.js

@@ -81,7 +81,12 @@ describe( 'Bold', () => {
 	it( 'should set editor keystroke', () => {
 		const spy = sinon.spy( editor, 'execute' );
 
-		const wasHandled = editor.keystrokes.press( { keyCode: keyCodes.b, ctrlKey: true } );
+		const wasHandled = editor.keystrokes.press( {
+			keyCode: keyCodes.b,
+			ctrlKey: true,
+			preventDefault: sinon.spy(),
+			stopPropagation: sinon.spy()
+		} );
 
 		expect( wasHandled ).to.be.true;
 		expect( spy.calledOnce ).to.be.true;

+ 6 - 1
packages/ckeditor5-basic-styles/tests/italic.js

@@ -81,7 +81,12 @@ describe( 'Italic', () => {
 	it( 'should set editor keystroke', () => {
 		const spy = sinon.spy( editor, 'execute' );
 
-		const wasHandled = editor.keystrokes.press( { keyCode: keyCodes.i, ctrlKey: true } );
+		const wasHandled = editor.keystrokes.press( {
+			keyCode: keyCodes.i,
+			ctrlKey: true,
+			preventDefault: sinon.spy(),
+			stopPropagation: sinon.spy()
+		} );
 
 		expect( wasHandled ).to.be.true;
 		expect( spy.calledOnce ).to.be.true;