ember-test-helpers
ember-test-helpers copied to clipboard
click, tap etc helpers can't specify coordinates of click
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
Pretty sure you can already do this
Ahh, I am mistaken. The internal event triggering code supports it, but we don't allow options to be passed in to click
.
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
Would love a PR adding support (along with tests for the feature)....
already working on it...
https://github.com/emberjs/ember-test-helpers/pull/398
Done for click, doubleClick, tap.