Skip to content

Refactor test_utils bundle

Mike Greiling requested to merge refactor_simulate_drag into master

What does this MR do?

Fixes a bug blocking gitlab-ee!1540 in which scrollTop is wrongly assumed to be a component of Element.getBoundingClientRect() and was being corrected for in the values sent to the mousemove event's clientX attribute. Here's a useful stack overflow answer related to the topic of clientX and clientY. This was causing tests to fail once the Sortable elements being targeted by simulateDrag were moved far enough down the page.

It also refactors simulate_drag.js to remove eslint violations and merges it to the main.js bundle in a block which will be omitted when compiled for production.

Are there points in the code the reviewer needs to double check?

The tests which relied on simulate_drag ought to still pass. This should be proof enough that the script is still functioning as intended.

Why was this MR needed?

Blocking gitlab-ee!1540

Screenshots (if relevant)

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Merge request reports