We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 64c976f commit e68646bCopy full SHA for e68646b
docs/rules/prefer-find-by.md
@@ -41,6 +41,12 @@ const submitButton = await waitFor(() =>
41
const submitButton = await waitFor(() =>
42
expect(queryByLabel('button', { name: /submit/i })).not.toBeFalsy()
43
);
44
+
45
+// unnecessary usage of waitFor with findBy*, which already includes waiting logic
46
+await waitFor(async () => {
47
+ const button = await findByRole('button', { name: 'Submit' });
48
+ expect(button).toBeInTheDocument();
49
+});
50
```
51
52
Examples of **correct** code for this rule:
0 commit comments