Skip to content

Commit

Permalink
test: add missing act()
Browse files Browse the repository at this point in the history
Signed-off-by: rare-magma <[email protected]>
  • Loading branch information
rare-magma committed Jul 26, 2024
1 parent ae28220 commit be6c29d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/Budget/BudgetPage.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { cleanup, render, screen, waitFor } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { act } from "react-dom/test-utils";
import { describe, expect, it } from "vitest";
import { budgetsDB } from "../../db";
import {
Expand All @@ -25,7 +26,9 @@ describe("BudgetPage", () => {
it("renders initial state", 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();
});

Expand Down

0 comments on commit be6c29d

Please sign in to comment.