From fd5b8c6a84f463ad9fca7b10cd9c077b441bf124 Mon Sep 17 00:00:00 2001 From: rare-magma Date: Fri, 26 Jul 2024 22:03:36 +0200 Subject: [PATCH] test: add missing act() Signed-off-by: rare-magma --- src/App.test.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/App.test.tsx b/src/App.test.tsx index a162092..a984ff7 100644 --- a/src/App.test.tsx +++ b/src/App.test.tsx @@ -34,7 +34,9 @@ describe("App", () => { it("shows new budget when clicking new button", async () => { render(comp); const newButton = screen.getAllByRole("button", { name: "new budget" }); - await userEvent.click(newButton[0]); + await act(async () => { + await userEvent.click(newButton[0]); + }); expect(screen.getByLabelText("delete budget")).toBeInTheDocument(); expect(screen.getByLabelText("clone budget")).toBeInTheDocument(); expect(await screen.findByText("Statistics")).toBeInTheDocument();