|
|
@@ -266,7 +266,9 @@ describe( 'Link', () => {
|
|
|
viewDocument.render();
|
|
|
|
|
|
sinon.assert.calledOnce( spy );
|
|
|
- sinon.assert.calledWithExactly( spy );
|
|
|
+ sinon.assert.calledWithExactly( spy, {
|
|
|
+ target: viewDocument.domConverter.mapViewToDom( root.getChild( 0 ).getChild( 0 ) )
|
|
|
+ } );
|
|
|
} );
|
|
|
|
|
|
// https://github.com/ckeditor/ckeditor5-link/issues/113
|
|
|
@@ -481,6 +483,11 @@ describe( 'Link', () => {
|
|
|
stopPropagation: sinon.spy()
|
|
|
};
|
|
|
|
|
|
+ const normalPriorityTabCallbackSpy = sinon.spy();
|
|
|
+ const highestPriorityTabCallbackSpy = sinon.spy();
|
|
|
+ editor.keystrokes.set( 'Tab', normalPriorityTabCallbackSpy );
|
|
|
+ editor.keystrokes.set( 'Tab', highestPriorityTabCallbackSpy, { priority: 'highest' } );
|
|
|
+
|
|
|
// Balloon is invisible, form not focused.
|
|
|
formView.focusTracker.isFocused = false;
|
|
|
|
|
|
@@ -490,6 +497,8 @@ describe( 'Link', () => {
|
|
|
sinon.assert.notCalled( keyEvtData.preventDefault );
|
|
|
sinon.assert.notCalled( keyEvtData.stopPropagation );
|
|
|
sinon.assert.notCalled( spy );
|
|
|
+ sinon.assert.calledOnce( normalPriorityTabCallbackSpy );
|
|
|
+ sinon.assert.calledOnce( highestPriorityTabCallbackSpy );
|
|
|
|
|
|
// Balloon is visible, form focused.
|
|
|
linkFeature._showPanel( true );
|
|
|
@@ -499,6 +508,8 @@ describe( 'Link', () => {
|
|
|
sinon.assert.notCalled( keyEvtData.preventDefault );
|
|
|
sinon.assert.notCalled( keyEvtData.stopPropagation );
|
|
|
sinon.assert.notCalled( spy );
|
|
|
+ sinon.assert.calledTwice( normalPriorityTabCallbackSpy );
|
|
|
+ sinon.assert.calledTwice( highestPriorityTabCallbackSpy );
|
|
|
|
|
|
// Balloon is still visible, form not focused.
|
|
|
formView.focusTracker.isFocused = false;
|
|
|
@@ -507,6 +518,8 @@ describe( 'Link', () => {
|
|
|
sinon.assert.calledOnce( keyEvtData.preventDefault );
|
|
|
sinon.assert.calledOnce( keyEvtData.stopPropagation );
|
|
|
sinon.assert.calledOnce( spy );
|
|
|
+ sinon.assert.calledTwice( normalPriorityTabCallbackSpy );
|
|
|
+ sinon.assert.calledThrice( highestPriorityTabCallbackSpy );
|
|
|
} );
|
|
|
|
|
|
it( 'should hide the #_balloon after Esc key press (from editor) and not focus the editable', () => {
|