Skip to content

Shouldn't prefer-screen-queries takes into account querySelector? #149

Closed
@lourenci

Description

@lourenci

prefer-screen-queries is not taken into account that the user can do this:

const utils = render(<Component />);
utils.container.querySelector('div');

This kind of selector can lead the user to a bad pattern of tests according to the testing-library.

I don't understand eslint under the hood, but I propose to change the prefer-screen-queries to take the snippet above into account as a bad pattern.

What do you guys think about that?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingreleased

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions