ember-test-helpers icon indicating copy to clipboard operation
ember-test-helpers copied to clipboard

click, tap etc helpers can't specify coordinates of click

Open BryanCrotaz opened this issue 6 years ago • 7 comments

I'm working on a visual editor where clicking at different positions gives different results (eg clicking on or outside a shape).

I'd like to be able to pass x,y coords to the click, tap helpers

BryanCrotaz avatar Mar 29 '18 22:03 BryanCrotaz

Pretty sure you can already do this

rwjblue avatar Mar 29 '18 23:03 rwjblue

Ahh, I am mistaken. The internal event triggering code supports it, but we don't allow options to be passed in to click.

rwjblue avatar Mar 29 '18 23:03 rwjblue

See here for the internal event firing system:

https://github.com/emberjs/ember-test-helpers/blob/dc1ec8e1377cee58a08d69d0bbcdd0f269440dfa/addon-test-support/%40ember/test-helpers/dom/fire-event.js#L56

We basically need to update click and tap to allow a second options argument and thread that through.

Updating the following locations:

https://github.com/emberjs/ember-test-helpers/blob/dc1ec8e1377cee58a08d69d0bbcdd0f269440dfa/addon-test-support/%40ember/test-helpers/dom/click.js#L51

https://github.com/emberjs/ember-test-helpers/blob/dc1ec8e1377cee58a08d69d0bbcdd0f269440dfa/addon-test-support/%40ember/test-helpers/dom/click.js#L12

https://github.com/emberjs/ember-test-helpers/blob/dc1ec8e1377cee58a08d69d0bbcdd0f269440dfa/addon-test-support/%40ember/test-helpers/dom/click.js#L20

rwjblue avatar Mar 29 '18 23:03 rwjblue

Would love a PR adding support (along with tests for the feature)....

rwjblue avatar Mar 29 '18 23:03 rwjblue

already working on it...

BryanCrotaz avatar Mar 29 '18 23:03 BryanCrotaz

https://github.com/emberjs/ember-test-helpers/pull/398

BryanCrotaz avatar Jul 14 '18 16:07 BryanCrotaz

Done for click, doubleClick, tap.

BryanCrotaz avatar Jul 14 '18 16:07 BryanCrotaz