From ae64a4d226359d9b8bafb11ff2a00d6feaa33abf Mon Sep 17 00:00:00 2001 From: Half-Shot Date: Thu, 7 Nov 2024 17:05:29 +0000 Subject: [PATCH] remove act --- src/Modal.test.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Modal.test.tsx b/src/Modal.test.tsx index ad06049a..41bd7bbe 100644 --- a/src/Modal.test.tsx +++ b/src/Modal.test.tsx @@ -7,7 +7,7 @@ Please see LICENSE in the repository root for full details. import { expect, test } from "vitest"; import { render } from "@testing-library/react"; -import { act, ReactNode, useState } from "react"; +import { ReactNode, useState } from "react"; import { afterEach } from "node:test"; import userEvent from "@testing-library/user-event"; @@ -47,9 +47,7 @@ test("the modal can be closed by clicking the close button", async () => { } const user = userEvent.setup(); const { queryByRole, getByRole } = render(); - await act(async () => { - await user.click(getByRole("button", { name: "action.close" })); - }); + await user.click(getByRole("button", { name: "action.close" })); expect(queryByRole("dialog")).toBeNull(); });