浏览代码

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

Aleksander Nowodzinski 8 年之前
父节点
当前提交
a4c9f61323
共有 2 个文件被更改,包括 12 次插入2 次删除
  1. 6 1
      packages/ckeditor5-basic-styles/tests/bold.js
  2. 6 1
      packages/ckeditor5-basic-styles/tests/italic.js

+ 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;