- πΊπΈUnited States danflanagan8 St. Louis, US
Holy moly, I think I have it! The new code in ::setValue() is
$this->executeJsOnXpath($xpath, <<<JS if (typeof Drupal !== 'undefined') { var node = {{ELEMENT}}; var original = node.blur; node.blur = function() { node.dispatchEvent(new Event("input", {bubbles:true})); node.dispatchEvent(new Event("change", {bubbles:true})); // Do not wait for the debounce, which only triggers the 'formUpdated` event // up to once every 0.3 seconds. In tests, no humans are typing, hence there // is no need to debounce. // @see Drupal.behaviors.formUpdated node.dispatchEvent(new Event("formUpdated", {bubbles:true})); node.blur = original; }; } JS);
If I comment out
node.dispatchEvent(new Event("input", {bubbles:true}));
then the test pass. So I think the problem is that crossword.js doesn't expect the input to be triggered with no real input. The patch here guards against that possibility and passes locally. It also passes my basic manual tests, like using a backspace or a 0 on the keyboard. -
danflanagan8 β
committed f5998418 on 2.0.x
Issue #3326427 by danflanagan8: Crossword Functional JS tests failing
-
danflanagan8 β
committed f5998418 on 2.0.x
- Status changed to Fixed
almost 2 years ago 10:00pm 3 March 2023 - πΊπΈUnited States danflanagan8 St. Louis, US
It is such an incredible relief to have this fixed! This took hours and hours. It will be good to have green tests on the project page for the first time since October 2022! It was like 5 months of red.
Automatically closed - issue fixed for 2 weeks with no activity.