|
|
@@ -420,6 +420,16 @@ describe( 'LinkUI', () => {
|
|
|
sinon.assert.calledTwice( spy );
|
|
|
} );
|
|
|
|
|
|
+ // https://github.com/ckeditor/ckeditor5-link/issues/193
|
|
|
+ it( 'should focus the `editable` before before removing elements from the balloon', () => {
|
|
|
+ const focusSpy = testUtils.sinon.spy( editor.editing.view, 'focus' );
|
|
|
+ const removeSpy = testUtils.sinon.spy( balloon, 'remove' );
|
|
|
+
|
|
|
+ linkUIFeature._hideUI();
|
|
|
+
|
|
|
+ expect( focusSpy.calledBefore( removeSpy ) ).to.equal( true );
|
|
|
+ } );
|
|
|
+
|
|
|
it( 'should not throw an error when views are not in the `balloon`', () => {
|
|
|
linkUIFeature._hideUI();
|
|
|
|
|
|
@@ -823,6 +833,18 @@ describe( 'LinkUI', () => {
|
|
|
expect( balloon.visibleView ).to.equal( actionsView );
|
|
|
expect( focusEditableSpy.calledOnce ).to.be.true;
|
|
|
} );
|
|
|
+
|
|
|
+ // https://github.com/ckeditor/ckeditor5/issues/1501
|
|
|
+ it( 'should blur url input element before hiding the view', () => {
|
|
|
+ linkUIFeature._showUI();
|
|
|
+
|
|
|
+ const focusSpy = testUtils.sinon.spy( formView.saveButtonView, 'focus' );
|
|
|
+ const removeSpy = testUtils.sinon.spy( balloon, 'remove' );
|
|
|
+
|
|
|
+ formView.fire( 'cancel' );
|
|
|
+
|
|
|
+ expect( focusSpy.calledBefore( removeSpy ) ).to.equal( true );
|
|
|
+ } );
|
|
|
} );
|
|
|
} );
|
|
|
} );
|