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
This commit is contained in:
Scott Lamb 2022-03-03 12:37:39 -08:00
parent d40715c210
commit bc29e8b23c
1 changed files with 4 additions and 4 deletions

View File

@ -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();