Skip to content

drag test helper division by 0  #513

@Yelinz

Description

@Yelinz

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions