-
Notifications
You must be signed in to change notification settings - Fork 56
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
await-interactions false positive in case of userEvent.setup function suggested by v14 api #132
Comments
Hey @boonya thanks a lot for flagging this! Would you be open to making a PR that fixes it? Thanks! |
With pleasure... When I have a time and inspiration ;) |
I tried to work on this issue, but I was frustrated because I am new to eslint plugin development. |
This is what I have so far #142 |
Looks like this is something related testing-library/eslint-plugin-testing-library#817 |
Describe the bug
Latest version of user-event lib recommends to use a little bit different API. Instead of using
userEvent.click
they suggest to createuser-event
instance first by invokingconst events = userEvent.setup()
. And then use any event available e.g.await events.click()
.userEvent.setup
returns an object directly without promise, so it shouldn't be awaiten. But the rule "storybook/await-interactions" reports an issue there.To Reproduce
@storybook/testing-library
(0.2.0 in my case)userEvent
constructor.userEvent.setup();
statement as it recommended in latest user-event section.Expected behavior
Validation error should not be triggered on
setup
method.Screenshots
The text was updated successfully, but these errors were encountered: