adopted-ember-addons / ember-sortable

Sortable UI primitives for Ember.js
https://ember-sortable.netlify.app/
MIT License
298 stars 148 forks source link

drag test helper division by 0 #513

Open Yelinz opened 1 year ago

Yelinz commented 1 year ago

Describe the bug drag test helper can produce a division by 0, which causes an error for triggerEvent because the value is Infinity

To Reproduce Reproduction unsure, but only seems to happen in headless test mode.

Expected behavior Avoid the division by 0

Additional context The offending line

  const scale = clientHeight / (rect.bottom - rect.top);

https://github.com/adopted-ember-addons/ember-sortable/blob/master/addon/src/test-support/helpers/drag.js#L61