Skip to content

Commit e55deab

Browse files
authored
Apply suggestions from code review
1 parent 91c9f01 commit e55deab

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

docs/rules/prefer-in-document.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Examples of **correct** code for this rule:
2929

3030
```js
3131
expect(screen.queryByText("foo")).toBeInTheDocument();
32-
expect(screen.queryByText("foo")).toBeInTheDocument();
32+
expect(await screen.findByText("foo")).toBeInTheDocument();
3333
expect(queryByText("foo")).toBeInTheDocument();
3434
expect(wrapper.queryAllByTestId("foo")).toBeInTheDocument();
3535
expect(screen.getAllByLabel("foo-bar")).toHaveLength(2);
@@ -39,7 +39,10 @@ const foo = screen.getAllByText("foo");
3939
expect(foo).toHaveLength(3);
4040

4141
const bar = screen.queryByText("bar");
42-
expect(bar).not.toBeInTheDocument();
42+
expect(bar).not.toBeDefined();
43+
44+
const baz = await screen.findByText("baz");
45+
expect(baz).toBeDefined()
4346
```
4447

4548
## When Not To Use It

0 commit comments

Comments
 (0)