From bc29e8b23c4fa62b48126def219998b72189815f Mon Sep 17 00:00:00 2001 From: Scott Lamb Date: Thu, 3 Mar 2022 12:37:39 -0800 Subject: [PATCH] fix eslint 8 complaints I'm working on this upgrade now. https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/rules/prefer-presence-queries.md --- ui/src/snackbars.test.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ui/src/snackbars.test.tsx b/ui/src/snackbars.test.tsx index ff14d56..d5b79da 100644 --- a/ui/src/snackbars.test.tsx +++ b/ui/src/snackbars.test.tsx @@ -30,23 +30,23 @@ test("notifications that time out", async () => { ); // message A should be present immediately. - expect(screen.queryByText(/message A/)).toBeInTheDocument(); + expect(screen.getByText(/message A/)).toBeInTheDocument(); expect(screen.queryByText(/message B/)).not.toBeInTheDocument(); // ...then start to close... jest.advanceTimersByTime(5000); - expect(screen.queryByText(/message A/)).toBeInTheDocument(); + expect(screen.getByText(/message A/)).toBeInTheDocument(); expect(screen.queryByText(/message B/)).not.toBeInTheDocument(); // ...then it should close and message B should open... jest.runOnlyPendingTimers(); expect(screen.queryByText(/message A/)).not.toBeInTheDocument(); - expect(screen.queryByText(/message B/)).toBeInTheDocument(); + expect(screen.getByText(/message B/)).toBeInTheDocument(); // ...then message B should start to close... jest.advanceTimersByTime(5000); expect(screen.queryByText(/message A/)).not.toBeInTheDocument(); - expect(screen.queryByText(/message B/)).toBeInTheDocument(); + expect(screen.getByText(/message B/)).toBeInTheDocument(); // ...then message B should fully close. jest.runOnlyPendingTimers();