Improve deteriminism of simulateDrag
What does this MR do and why?
This MR addresses an issue identified in this comment where tests using the simulateDrag
helper were very flaky.
- Instead of using
setTimeout
let's userequestAnimationFrame
. - Let's also wait a frame between moving and finishing.
Screenshots or screen recordings
Screencast_2021-11-24_20_19_42
How to set up and validate locally
-
Either on
.com
or locally, go to an issues board page which has 3 or more issues in the first list. -
Remove the
export function
part of thesimulate_drag.js
. Copy and paste thesimulate_drag.js
contents into a browser console (see demo) -
Run the following in the browser console:
simulateDrag({ scrollable: document.querySelector('body'), duration: 1000, performDrop: true, extraHeight: 0, from: { el: document.querySelectorAll('.board-list')[0], index: 0, }, to: { el: document.querySelectorAll('.board-list')[0], index: 2 } });
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Paul Slaughter