diff --git a/server/src/__tests__/tool-content-guards.test.ts b/server/src/__tests__/tool-content-guards.test.ts index 38c8c1555c7..12ab448cf7c 100644 --- a/server/src/__tests__/tool-content-guards.test.ts +++ b/server/src/__tests__/tool-content-guards.test.ts @@ -60,4 +60,3 @@ describe("tool content guards", () => { ).toThrow(ToolContentValidationError); }); }); - diff --git a/ui/src/components/actions/ActionCard.test.tsx b/ui/src/components/actions/ActionCard.test.tsx index 4e6846f45aa..917fd76f000 100644 --- a/ui/src/components/actions/ActionCard.test.tsx +++ b/ui/src/components/actions/ActionCard.test.tsx @@ -1,7 +1,7 @@ // @vitest-environment jsdom -import { act } from "react"; import { createRoot } from "react-dom/client"; +import { flushSync } from "react-dom"; import type { ReactElement } from "react"; import { afterEach, describe, expect, it, vi } from "vitest"; import { ActionCard, ActionCardMobile, BindingsTable, shortSha } from "./ActionCard"; @@ -24,7 +24,7 @@ let root: ReturnType | null = null; let container: HTMLDivElement | null = null; afterEach(() => { - if (root) act(() => root?.unmount()); + if (root) flushSync(() => root?.unmount()); root = null; container?.remove(); container = null; @@ -34,7 +34,7 @@ function render(element: ReactElement) { container = document.createElement("div"); document.body.appendChild(container); root = createRoot(container); - act(() => root?.render(element)); + flushSync(() => root?.render(element)); return container; } @@ -81,7 +81,7 @@ describe("ActionCard", () => { const c = render(); const btn = approveButton(c); expect(btn.disabled).toBe(false); - act(() => btn.dispatchEvent(new MouseEvent("click", { bubbles: true }))); + flushSync(() => btn.dispatchEvent(new MouseEvent("click", { bubbles: true }))); expect(onApprove).toHaveBeenCalledOnce(); });