Skip to content

await-interactions false positive in case of userEvent.setup function suggested by v14 api #132

Open
@boonya

Description

@boonya

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 create user-event instance first by invoking const 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

  1. Install latest version of @storybook/testing-library (0.2.0 in my case)
  2. Import userEvent constructor.
  3. Define play function to any story you need.
  4. Declare userEvent.setup(); statement as it recommended in latest user-event section.
  5. See the validation error.

Expected behavior
Validation error should not be triggered on setup method.

Screenshots
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions