adopted-ember-addons / adopted-ember-addons/ember-sortable

drag test helper division by 0

未關閉
#513 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
TypeScript
星號
299
分支
159
平均合併
4 天 6 小時
30 天內合併 PR
4

描述

**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

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。