Closed
Description
Name for new rule
no-find-by-presence
Description of the new rule
The rule should avoid things like expect(await screen.findBy*()).toBeInTheDocument(), because that's functionally the same as await screen.findBy*().
Perhaps this is a new rule (I proposed a name) or maybe it should just be part of the existing find-by rule.
Testing Library feature
await findBy
Testing Library framework(s)
All, presumaly.
What category of rule is this?
Suggests an alternate way of doing something
Optional: other category of rule
No response
Code examples
expect(await screen.findByRole("button")).toBeInTheDocument();
expect(await screen.findByText("hello")).toBeDefined();
expect(await screen.findByLabel("zoop!")).toBeTruthy();
Anything else?
I am happy to contribute this rule - but if so, it may take me a month or two to do so, as things are busy. Please let me know if you'd like me to contribute or not.
Do you want to submit a pull request to make the new rule?
Yes