Skip to content

Rule no-get-by-for-checking-element-not-present is giving false positives #83

Closed
@Belco90

Description

@Belco90

The rule no-get-by-for-checking-element-not-present is giving false positives for some matchers when it shouldn't.

If you are getting an element with getBy query and asserting something with a negated matcher, it should not complain unless the matcher is toBeInTheDocument (or additional ones checking the element itself is not present).

But if you are asserting something like expect(getByText('Submit')).not.toBeDisabled() the rule should complain about as it's not checking element absence but something else from the element.

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