From 4308b030f563e25add01bd3072b5f6efddc9670e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Beltr=C3=A1n=20Alarc=C3=B3n?= Date: Fri, 3 Apr 2020 12:55:03 +0200 Subject: [PATCH] docs(prefer-presence-queries): fix examples --- docs/rules/prefer-presence-queries.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/rules/prefer-presence-queries.md b/docs/rules/prefer-presence-queries.md index c178ea8a..f66dff91 100644 --- a/docs/rules/prefer-presence-queries.md +++ b/docs/rules/prefer-presence-queries.md @@ -21,14 +21,14 @@ test('some test', () => { // check element is present with `queryBy*` expect(screen.queryByText('button')).toBeInTheDocument(); expect(screen.queryAllByText('button')[0]).toBeTruthy(); - expect(screen.queryByText('button')).toBeNull(); + expect(screen.queryByText('button')).not.toBeNull(); expect(screen.queryAllByText('button')[2]).not.toBeNull(); expect(screen.queryByText('button')).not.toBeFalsy(); // check element is NOT present with `getBy*` expect(screen.getByText('loading')).not.toBeInTheDocument(); expect(screen.getAllByText('loading')[1]).not.toBeTruthy(); - expect(screen.getByText('loading')).not.toBeNull(); + expect(screen.getByText('loading')).toBeNull(); expect(screen.getAllByText('loading')[3]).toBeNull(); expect(screen.getByText('loading')).toBeFalsy(); }); @@ -42,14 +42,14 @@ test('some test', async () => { // check element is present with `getBy*` expect(screen.getByText('button')).toBeInTheDocument(); expect(screen.getAllByText('button')[9]).toBeTruthy(); - expect(screen.getByText('button')).toBeNull(); + expect(screen.getByText('button')).not.toBeNull(); expect(screen.getAllByText('button')[7]).not.toBeNull(); expect(screen.getByText('button')).not.toBeFalsy(); // check element is NOT present with `queryBy*` expect(screen.queryByText('loading')).not.toBeInTheDocument(); expect(screen.queryAllByText('loading')[8]).not.toBeTruthy(); - expect(screen.queryByText('loading')).not.toBeNull(); + expect(screen.queryByText('loading')).toBeNull(); expect(screen.queryAllByText('loading')[6]).toBeNull(); expect(screen.queryByText('loading')).toBeFalsy();