ui test cleanups

* update `msw` 0.49 -> 1.x. (2.x is out now, but small steps.)
* wrap some `jest.{runOnlyPendingTimers,advanceTimersByTime}` calls
  in `act`.
* extend a timeout that had no slack at all
This commit is contained in:
Scott Lamb
2023-12-09 14:59:40 -08:00
parent f493ad94eb
commit 3de62eb70d
4 changed files with 110 additions and 93 deletions

View File

@@ -162,7 +162,10 @@ test("slow replace", async () => {
expect(screen.getByText(/26 Apr 2021 08:21:13/)).toBeInTheDocument();
// A loading indicator should show up after a second.
expect(await screen.findByRole("progressbar")).toBeInTheDocument();
// The default timeout is 1 second; extend it to pass reliably.
expect(
await screen.findByRole("progressbar", {}, { timeout: 2000 })
).toBeInTheDocument();
// Then the second query result should show up.
expect(await screen.findByText(/27 Apr 2021 06:17:43/)).toBeInTheDocument();