We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 91c9f01 commit e55deabCopy full SHA for e55deab
docs/rules/prefer-in-document.md
@@ -29,7 +29,7 @@ Examples of **correct** code for this rule:
29
30
```js
31
expect(screen.queryByText("foo")).toBeInTheDocument();
32
-expect(screen.queryByText("foo")).toBeInTheDocument();
+expect(await screen.findByText("foo")).toBeInTheDocument();
33
expect(queryByText("foo")).toBeInTheDocument();
34
expect(wrapper.queryAllByTestId("foo")).toBeInTheDocument();
35
expect(screen.getAllByLabel("foo-bar")).toHaveLength(2);
@@ -39,7 +39,10 @@ const foo = screen.getAllByText("foo");
39
expect(foo).toHaveLength(3);
40
41
const bar = screen.queryByText("bar");
42
-expect(bar).not.toBeInTheDocument();
+expect(bar).not.toBeDefined();
43
+
44
+const baz = await screen.findByText("baz");
45
+expect(baz).toBeDefined()
46
```
47
48
## When Not To Use It
0 commit comments