File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ Examples of **correct** code for this rule:
2929
3030``` js
3131expect (screen .queryByText (" foo" )).toBeInTheDocument ();
32- expect (screen .queryByText (" foo" )).toBeInTheDocument ();
32+ expect (await screen .findByText (" foo" )).toBeInTheDocument ();
3333expect (queryByText (" foo" )).toBeInTheDocument ();
3434expect (wrapper .queryAllByTestId (" foo" )).toBeInTheDocument ();
3535expect (screen .getAllByLabel (" foo-bar" )).toHaveLength (2 );
@@ -39,7 +39,10 @@ const foo = screen.getAllByText("foo");
3939expect (foo).toHaveLength (3 );
4040
4141const 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
You can’t perform that action at this time.
0 commit comments