Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clicking remove button - acceptance tests #385

Closed
snewcomer opened this issue Mar 20, 2016 · 2 comments
Closed

Clicking remove button - acceptance tests #385

snewcomer opened this issue Mar 20, 2016 · 2 comments

Comments

@snewcomer
Copy link
Contributor

Having trouble clicking the remove button for multiple inputs in my acceptance tests. This change came after the 0.9.0 release. I guess I am trying to understand the reason why my basic css selectors of clicking the dropdown, selecting an option and removing an option don't work anymore (it seems dispatchEvent is req'd). I have to use the test helpers, which are great, but don't know the why. Maybe a bit of an explantion or thoughts on a solution to the above would be greatly appreciated. Maybe some insight could help me in perhaps getting a new test helper in there as well! Thanks!

@cibernox
Copy link
Owner

This is an issue with ember 2.4 that is fixed in ember 2.5+.

The problem is that Ember's acceptance helpers fired jquery events (not native events) until this PR.
This is fundamentally wrong, since jquery event's do not trigger events added with addEventListener.
Events added as element properties onclick={{action "foo"}} are also busted since, unless you call preventDefault on them, they are considered unhandled and will fire twice.

Using Ember 2.5-beta should also be fine. If you are using the helpers provided by the addon (p.e selectChoose) you're fine because I already take care of the details of how events are fired, although there is no test-helper for removing events in multiple selects.

I'd accept one test helper for that tho.

In integration tests I use a couple helpers to fire native. I don't advertise them because I don't think most people need them, but if you find them useful, take a look to them: https://github.com/cibernox/ember-power-select/blob/master/test-support/helpers/ember-power-select.js#L13-L35

@snewcomer
Copy link
Contributor Author

#400

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants