|
|
@@ -278,6 +278,20 @@ describe( 'ImageInsertUI', () => {
|
|
|
sinon.assert.notCalled( commandSpy );
|
|
|
sinon.assert.calledOnce( cancelSpy );
|
|
|
} );
|
|
|
+
|
|
|
+ it( 'should focus on "insert image via URL" input after opening', () => {
|
|
|
+ let spy;
|
|
|
+
|
|
|
+ // The ImageInsertPanelView is added on first open.
|
|
|
+ // See https://github.com/ckeditor/ckeditor5/pull/8019#discussion_r484069652
|
|
|
+ dropdown.on( 'change:isOpen', () => {
|
|
|
+ const imageInsertPanelView = dropdown.panelView.children.first;
|
|
|
+ spy = sinon.spy( imageInsertPanelView, 'focus' );
|
|
|
+ }, { priority: 'highest' } );
|
|
|
+
|
|
|
+ dropdown.buttonView.fire( 'open' );
|
|
|
+ sinon.assert.calledOnce( spy );
|
|
|
+ } );
|
|
|
} );
|
|
|
|
|
|
it( 'should inject integrations to the dropdown panel view from the config', async () => {
|