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

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

Open
stfnio opened this issue Mar 22, 2021 · 2 comments
Open

Comments

@stfnio
Copy link

stfnio commented Mar 22, 2021

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?

@Mifrill
Copy link
Contributor

Mifrill commented Oct 22, 2021

@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.

@stfnio
Copy link
Author

stfnio commented Oct 25, 2021

@Mifrill I'll try, thanks!

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