ember-power-select icon indicating copy to clipboard operation
ember-power-select copied to clipboard

Regression: select-choose doesn't wait for async tasks to finish anymore

Open stfnio opened this issue 3 years ago • 2 comments

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 avatar Mar 22 '21 16:03 stfnio

@stfnio

Which linter rule is in charge here?

Selection_896

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 avatar Oct 22 '21 06:10 Mifrill

@Mifrill I'll try, thanks!

stfnio avatar Oct 25 '21 19:10 stfnio