|
|
@@ -43,8 +43,8 @@ describe( 'Link', () => {
|
|
|
formView = linkFeature.formView;
|
|
|
|
|
|
// There is no point to execute BalloonPanelView attachTo and pin methods so lets override it.
|
|
|
- testUtils.sinon.stub( balloon.view, 'attachTo', () => {} );
|
|
|
- testUtils.sinon.stub( balloon.view, 'pin', () => {} );
|
|
|
+ testUtils.sinon.stub( balloon.view, 'attachTo' ).returns( {} );
|
|
|
+ testUtils.sinon.stub( balloon.view, 'pin' ).returns( {} );
|
|
|
|
|
|
formView.init();
|
|
|
} );
|
|
|
@@ -240,7 +240,7 @@ describe( 'Link', () => {
|
|
|
|
|
|
setModelData( editor.document, '<paragraph>f[]oo</paragraph>' );
|
|
|
|
|
|
- const spy = testUtils.sinon.stub( balloon, 'updatePosition', () => {} );
|
|
|
+ const spy = testUtils.sinon.stub( balloon, 'updatePosition' ).returns( {} );
|
|
|
|
|
|
linkFeature._showPanel();
|
|
|
viewDocument.render();
|
|
|
@@ -258,7 +258,7 @@ describe( 'Link', () => {
|
|
|
setModelData( editor.document, '<paragraph><$text linkHref="url">f[]oo</$text></paragraph>' );
|
|
|
|
|
|
linkFeature._showPanel();
|
|
|
- const spy = testUtils.sinon.stub( balloon, 'updatePosition', () => {} );
|
|
|
+ const spy = testUtils.sinon.stub( balloon, 'updatePosition' ).returns( {} );
|
|
|
|
|
|
const root = viewDocument.getRoot();
|
|
|
const text = root.getChild( 0 ).getChild( 0 ).getChild( 0 );
|
|
|
@@ -278,7 +278,7 @@ describe( 'Link', () => {
|
|
|
setModelData( editor.document, '<paragraph>f[]oo</paragraph>' );
|
|
|
|
|
|
linkFeature._showPanel();
|
|
|
- const spy = testUtils.sinon.stub( balloon, 'updatePosition', () => {} );
|
|
|
+ const spy = testUtils.sinon.stub( balloon, 'updatePosition' ).returns( {} );
|
|
|
|
|
|
// Fires #render.
|
|
|
const root = viewDocument.getRoot();
|
|
|
@@ -302,7 +302,7 @@ describe( 'Link', () => {
|
|
|
|
|
|
linkFeature._showPanel();
|
|
|
|
|
|
- const spyUpdate = testUtils.sinon.stub( balloon, 'updatePosition', () => {} );
|
|
|
+ const spyUpdate = testUtils.sinon.stub( balloon, 'updatePosition' ).returns( {} );
|
|
|
const spyHide = testUtils.sinon.spy( linkFeature, '_hidePanel' );
|
|
|
|
|
|
const root = viewDocument.getRoot();
|
|
|
@@ -327,7 +327,7 @@ describe( 'Link', () => {
|
|
|
|
|
|
linkFeature._showPanel();
|
|
|
|
|
|
- const spyUpdate = testUtils.sinon.stub( balloon, 'updatePosition', () => {} );
|
|
|
+ const spyUpdate = testUtils.sinon.stub( balloon, 'updatePosition' ).returns( {} );
|
|
|
const spyHide = testUtils.sinon.spy( linkFeature, '_hidePanel' );
|
|
|
|
|
|
const root = viewDocument.getRoot();
|
|
|
@@ -349,7 +349,7 @@ describe( 'Link', () => {
|
|
|
|
|
|
linkFeature._showPanel();
|
|
|
|
|
|
- const spyUpdate = testUtils.sinon.stub( balloon, 'updatePosition', () => {} );
|
|
|
+ const spyUpdate = testUtils.sinon.stub( balloon, 'updatePosition' ).returns( {} );
|
|
|
const spyHide = testUtils.sinon.spy( linkFeature, '_hidePanel' );
|
|
|
|
|
|
const root = viewDocument.getRoot();
|
|
|
@@ -431,7 +431,7 @@ describe( 'Link', () => {
|
|
|
} );
|
|
|
|
|
|
it( 'should show the #_balloon on execute event with the selected #formView', () => {
|
|
|
- const spy = testUtils.sinon.stub( linkFeature, '_showPanel', () => {} );
|
|
|
+ const spy = testUtils.sinon.stub( linkFeature, '_showPanel' ).returns( {} );
|
|
|
|
|
|
linkButton.fire( 'execute' );
|
|
|
sinon.assert.calledWithExactly( spy, true );
|
|
|
@@ -465,7 +465,7 @@ describe( 'Link', () => {
|
|
|
|
|
|
describe( 'keyboard support', () => {
|
|
|
it( 'should show the #_balloon with selected #formView on Ctrl+K keystroke', () => {
|
|
|
- const spy = testUtils.sinon.stub( linkFeature, '_showPanel', () => {} );
|
|
|
+ const spy = testUtils.sinon.stub( linkFeature, '_showPanel' ).returns( {} );
|
|
|
const command = editor.commands.get( 'link' );
|
|
|
|
|
|
command.isEnabled = false;
|
|
|
@@ -589,7 +589,7 @@ describe( 'Link', () => {
|
|
|
observer = editor.editing.view.getObserver( ClickObserver );
|
|
|
editor.document.schema.allow( { name: '$text', inside: '$root' } );
|
|
|
|
|
|
- spy = testUtils.sinon.stub( linkFeature, '_showPanel', () => {} );
|
|
|
+ spy = testUtils.sinon.stub( linkFeature, '_showPanel' ).returns( {} );
|
|
|
} );
|
|
|
|
|
|
it( 'should open with not selected formView when collapsed selection is inside link element', () => {
|