Skip to content

Commit 053cb34

Browse files
authored
docs(prefer-presence-queries): fix examples (testing-library#106)
1 parent f8baa03 commit 053cb34

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/rules/prefer-presence-queries.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ test('some test', () => {
2121
// check element is present with `queryBy*`
2222
expect(screen.queryByText('button')).toBeInTheDocument();
2323
expect(screen.queryAllByText('button')[0]).toBeTruthy();
24-
expect(screen.queryByText('button')).toBeNull();
24+
expect(screen.queryByText('button')).not.toBeNull();
2525
expect(screen.queryAllByText('button')[2]).not.toBeNull();
2626
expect(screen.queryByText('button')).not.toBeFalsy();
2727

2828
// check element is NOT present with `getBy*`
2929
expect(screen.getByText('loading')).not.toBeInTheDocument();
3030
expect(screen.getAllByText('loading')[1]).not.toBeTruthy();
31-
expect(screen.getByText('loading')).not.toBeNull();
31+
expect(screen.getByText('loading')).toBeNull();
3232
expect(screen.getAllByText('loading')[3]).toBeNull();
3333
expect(screen.getByText('loading')).toBeFalsy();
3434
});
@@ -42,14 +42,14 @@ test('some test', async () => {
4242
// check element is present with `getBy*`
4343
expect(screen.getByText('button')).toBeInTheDocument();
4444
expect(screen.getAllByText('button')[9]).toBeTruthy();
45-
expect(screen.getByText('button')).toBeNull();
45+
expect(screen.getByText('button')).not.toBeNull();
4646
expect(screen.getAllByText('button')[7]).not.toBeNull();
4747
expect(screen.getByText('button')).not.toBeFalsy();
4848

4949
// check element is NOT present with `queryBy*`
5050
expect(screen.queryByText('loading')).not.toBeInTheDocument();
5151
expect(screen.queryAllByText('loading')[8]).not.toBeTruthy();
52-
expect(screen.queryByText('loading')).not.toBeNull();
52+
expect(screen.queryByText('loading')).toBeNull();
5353
expect(screen.queryAllByText('loading')[6]).toBeNull();
5454
expect(screen.queryByText('loading')).toBeFalsy();
5555

0 commit comments

Comments
 (0)