Issue #3618818: Stop the picker tests holding an element handle across a redraw

Finding an element and then clicking it are two round trips, and every surface on the plan redraws its panel from an answer, so a redraw landing between the two clicks a node that has left the document. The trait these tests use says exactly this about itself, in the docblock of the assertion written for it — "no handle to go stale". The clicks never followed the rule.

It has two outcomes, which is why it read as two unrelated bugs: Chrome reports a stale element reference and the test dies at once (what [#3618720] fixed in one scenario), or the click reaches the detached node, nothing happens, no request is made, and a wait for the consequence burns its whole budget to say that a string never appeared.

Twenty-seven handles now go through the handle-free click. Two runs of presses become one dispatched run, because a run past a limit has to land inside the window the queue coalesces and a round trip each closes it — through the driver, on a loaded runner, one ask silently becomes several.

Two handles stay, and say why. One scenario presses the same row twice to put two lines in one request, where re-querying between them defeats the point. And the drag scenario keeps one real driver press for its control, because what it proves is that a REAL press still books, which a dispatched sequence is not.

The helper needed fixing too, and running the conversion is what found it — both of these came back as failures, one in the scenario whose whole subject is that a plain click books:

  • element.click() does not exist on an SVG node. It is defined on HTMLElement, not on Element, so a zone drawn on the plan answers "click is not a function".
  • A handler waiting on the press rather than the click never hears a bare click(), so a seat that books on one is never taken.

It dispatches mousedown, mouseup and click now, which the project already knew was necessary elsewhere.

Not in here. Seven sites remain in three other classes. SlotBookingAreaTest reaches its button through a helper whose docblock already says it is "re-read each time rather than held across a request", the milder form of this; the other two are one site each. None has ever failed this way, and converting them would mean touching tests this issue has no reading on, including a performance test pinned to exact query counts.

Verification. Both converted classes green, checked by running them rather than by reading. phpstan level 3 [OK], phpcs and cspell clean.

Merge request reports

Loading
Loading