Parcourir la source

Merge branch 't/ckeditor5-core/90'

Tests: Updated tests to match changes in the core.
Piotrek Koszuliński il y a 8 ans
Parent
commit
600ebb0291

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

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