@@ -21,14 +21,14 @@ test('some test', () => {
21
21
// check element is present with `queryBy*`
22
22
expect (screen .queryByText (' button' )).toBeInTheDocument ();
23
23
expect (screen .queryAllByText (' button' )[0 ]).toBeTruthy ();
24
- expect (screen .queryByText (' button' )).toBeNull ();
24
+ expect (screen .queryByText (' button' )).not . toBeNull ();
25
25
expect (screen .queryAllByText (' button' )[2 ]).not .toBeNull ();
26
26
expect (screen .queryByText (' button' )).not .toBeFalsy ();
27
27
28
28
// check element is NOT present with `getBy*`
29
29
expect (screen .getByText (' loading' )).not .toBeInTheDocument ();
30
30
expect (screen .getAllByText (' loading' )[1 ]).not .toBeTruthy ();
31
- expect (screen .getByText (' loading' )).not . toBeNull ();
31
+ expect (screen .getByText (' loading' )).toBeNull ();
32
32
expect (screen .getAllByText (' loading' )[3 ]).toBeNull ();
33
33
expect (screen .getByText (' loading' )).toBeFalsy ();
34
34
});
@@ -42,14 +42,14 @@ test('some test', async () => {
42
42
// check element is present with `getBy*`
43
43
expect (screen .getByText (' button' )).toBeInTheDocument ();
44
44
expect (screen .getAllByText (' button' )[9 ]).toBeTruthy ();
45
- expect (screen .getByText (' button' )).toBeNull ();
45
+ expect (screen .getByText (' button' )).not . toBeNull ();
46
46
expect (screen .getAllByText (' button' )[7 ]).not .toBeNull ();
47
47
expect (screen .getByText (' button' )).not .toBeFalsy ();
48
48
49
49
// check element is NOT present with `queryBy*`
50
50
expect (screen .queryByText (' loading' )).not .toBeInTheDocument ();
51
51
expect (screen .queryAllByText (' loading' )[8 ]).not .toBeTruthy ();
52
- expect (screen .queryByText (' loading' )).not . toBeNull ();
52
+ expect (screen .queryByText (' loading' )).toBeNull ();
53
53
expect (screen .queryAllByText (' loading' )[6 ]).toBeNull ();
54
54
expect (screen .queryByText (' loading' )).toBeFalsy ();
55
55
0 commit comments