ember-power-select
ember-power-select copied to clipboard
Regression: select-choose doesn't wait for async tasks to finish anymore
I found out that our tests started to fail after a patch version upgrade (4.1.2
-> 4.1.3
). The source of the issue is in this commit.
We have a custom logic for loading options, and these tests were depending on that settled
call. What was the intention to remove it? Which linter rule is in charge here?
@stfnio
Which linter rule is in charge here?
https://github.com/ember-cli/eslint-plugin-ember/blob/master/docs/rules/no-settled-after-test-helper.md
I suspect, in your case, the action that binds on click contains the promise that is not resolved before the next step in the test. Try to rewrite action with a task, like a:
Before:
@action
onClick() {
new RSVP.Promise((resolve) => resolve());
}
After:
@dropTask
*onClick() {
yield new RSVP.Promise((resolve) => resolve());;
}
because in case of use concurrency-task the click from '@ember/test-helpers'
will wait for promise til resolve to proceed.
@Mifrill I'll try, thanks!