|
@@ -486,7 +486,7 @@ describe( 'LinkUI', () => {
|
|
|
preventDefault: sinon.spy(),
|
|
preventDefault: sinon.spy(),
|
|
|
stopPropagation: sinon.spy()
|
|
stopPropagation: sinon.spy()
|
|
|
} );
|
|
} );
|
|
|
- sinon.assert.calledWithExactly( spy );
|
|
|
|
|
|
|
+ sinon.assert.calledWithExactly( spy, true );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
it( 'should prevent default action on Ctrl+K keystroke', () => {
|
|
it( 'should prevent default action on Ctrl+K keystroke', () => {
|
|
@@ -504,6 +504,57 @@ describe( 'LinkUI', () => {
|
|
|
sinon.assert.calledOnce( stopPropagationSpy );
|
|
sinon.assert.calledOnce( stopPropagationSpy );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
|
|
+ it( 'should make stack with link visible on Ctrl+K keystroke - no link', () => {
|
|
|
|
|
+ const command = editor.commands.get( 'link' );
|
|
|
|
|
+
|
|
|
|
|
+ command.isEnabled = true;
|
|
|
|
|
+
|
|
|
|
|
+ balloon.add( {
|
|
|
|
|
+ view: new View(),
|
|
|
|
|
+ stackId: 'custom'
|
|
|
|
|
+ } );
|
|
|
|
|
+
|
|
|
|
|
+ editor.keystrokes.press( {
|
|
|
|
|
+ keyCode: keyCodes.k,
|
|
|
|
|
+ ctrlKey: true,
|
|
|
|
|
+ preventDefault: sinon.spy(),
|
|
|
|
|
+ stopPropagation: sinon.spy()
|
|
|
|
|
+ } );
|
|
|
|
|
+
|
|
|
|
|
+ expect( balloon.visibleView ).to.equal( formView );
|
|
|
|
|
+ } );
|
|
|
|
|
+
|
|
|
|
|
+ it( 'should make stack with link visible on Ctrl+K keystroke - link', () => {
|
|
|
|
|
+ setModelData( editor.model, '<paragraph><$text linkHref="foo.html">f[]oo</$text></paragraph>' );
|
|
|
|
|
+
|
|
|
|
|
+ const customView = new View();
|
|
|
|
|
+
|
|
|
|
|
+ balloon.add( {
|
|
|
|
|
+ view: customView,
|
|
|
|
|
+ stackId: 'custom'
|
|
|
|
|
+ } );
|
|
|
|
|
+
|
|
|
|
|
+ expect( balloon.visibleView ).to.equal( customView );
|
|
|
|
|
+
|
|
|
|
|
+ editor.keystrokes.press( {
|
|
|
|
|
+ keyCode: keyCodes.k,
|
|
|
|
|
+ ctrlKey: true,
|
|
|
|
|
+ preventDefault: sinon.spy(),
|
|
|
|
|
+ stopPropagation: sinon.spy()
|
|
|
|
|
+ } );
|
|
|
|
|
+
|
|
|
|
|
+ expect( balloon.visibleView ).to.equal( actionsView );
|
|
|
|
|
+
|
|
|
|
|
+ editor.keystrokes.press( {
|
|
|
|
|
+ keyCode: keyCodes.k,
|
|
|
|
|
+ ctrlKey: true,
|
|
|
|
|
+ preventDefault: sinon.spy(),
|
|
|
|
|
+ stopPropagation: sinon.spy()
|
|
|
|
|
+ } );
|
|
|
|
|
+
|
|
|
|
|
+ expect( balloon.visibleView ).to.equal( formView );
|
|
|
|
|
+ } );
|
|
|
|
|
+
|
|
|
it( 'should focus the the #actionsView on `Tab` key press when #actionsView is visible', () => {
|
|
it( 'should focus the the #actionsView on `Tab` key press when #actionsView is visible', () => {
|
|
|
const keyEvtData = {
|
|
const keyEvtData = {
|
|
|
keyCode: keyCodes.tab,
|
|
keyCode: keyCodes.tab,
|