public function testImageSettingsForm() { $assert_session =
$this->
assertSession();
$this->
drupalGet('admin/config/content/formats/manage/test_format'
);
// The image resize and upload plugin settings forms should be present.
$assert_session->
elementExists('css', '[data-drupal-selector="edit-editor-settings-plugins-ckeditor5-imageresize"]'
);
$assert_session->
elementExists('css', '[data-drupal-selector="edit-editor-settings-plugins-ckeditor5-image"]'
);
// Removing the drupalImageInsert button from the toolbar must remove the
// plugin settings forms too.
$this->
triggerKeyUp('.ckeditor5-toolbar-item-drupalInsertImage', 'ArrowUp'
);
$assert_session->
assertWaitOnAjaxRequest();
$assert_session->
elementNotExists('css', '[data-drupal-selector="edit-editor-settings-plugins-ckeditor5-imageresize"]'
);
$assert_session->
elementNotExists('css', '[data-drupal-selector="edit-editor-settings-plugins-ckeditor5-image"]'
);
// Re-adding the drupalImageInsert button to the toolbar must re-add the
// plugin settings forms too.
$this->
triggerKeyUp('.ckeditor5-toolbar-item-drupalInsertImage', 'ArrowDown'
);
$assert_session->
assertWaitOnAjaxRequest();
$assert_session->
elementExists('css', '[data-drupal-selector="edit-editor-settings-plugins-ckeditor5-imageresize"]'
);
$assert_session->
elementExists('css', '[data-drupal-selector="edit-editor-settings-plugins-ckeditor5-image"]'
);
}}