Skip to content
Snippets Groups Projects

Issue #3238915: Refactor (if feasible) uses of the jQuery ready function to use VanillaJS

Closed Issue #3238915: Refactor (if feasible) uses of the jQuery ready function to use VanillaJS
Closed Harumi Jang requested to merge issue/drupal-3238915:3238915-refactor-if-feasible into 9.3.x
3 files
+ 22
16
Compare changes
  • Side-by-side
  • Inline
Files
3
  • 6a1bac3c
    Issue #3316816 by Wim Leers, nod_: Stabilize FunctionalJavascript testing... · 6a1bac3c
    catch authored
    Issue #3316816 by Wim Leers, nod_: Stabilize FunctionalJavascript testing AJAX: make ::setValue() trigger both "input" and "formUpdated" events
@@ -86,14 +86,8 @@ protected function addImage() {
@@ -86,14 +86,8 @@ protected function addImage() {
$this->waitForEditor();
$this->waitForEditor();
$this->pressEditorButton('Insert image');
$this->pressEditorButton('Insert image');
$panel = $page->find('css', '.ck-dropdown__panel.ck-image-insert__panel');
$panel = $page->find('css', '.ck-dropdown__panel.ck-image-insert__panel');
// Do not use setValue method as it triggers a blur event by default that
$src_input = $panel->find('css', 'input[type=text]');
// closes the CKEditor 5 panel, making it impossible to click on the Insert
$src_input->setValue($src);
// button.
$this->getSession()->executeScript('
const input = document.querySelector(".ck-dropdown__panel.ck-image-insert__panel input[type=text]");
input.value = "' . $src . '";
input.dispatchEvent(new Event("input", {bubbles:true}));
');
$panel->find('xpath', "//button[span[text()='Insert']]")->click();
$panel->find('xpath', "//button[span[text()='Insert']]")->click();
}
}
Loading