|
|
@@ -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;
|
|
|
} );
|
|
|
} );
|