소스 검색

Check whether the event was cancelled.

Piotrek Koszuliński 8 년 전
부모
커밋
9a93b95f8a
1개의 변경된 파일5개의 추가작업 그리고 3개의 파일을 삭제
  1. 5 3
      packages/ckeditor5-basic-styles/tests/bold.js

+ 5 - 3
packages/ckeditor5-basic-styles/tests/bold.js

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