diff --git a/canvas/src/app/__tests__/orgs-page.test.tsx b/canvas/src/app/__tests__/orgs-page.test.tsx index db0adeb7..fb0a1f75 100644 --- a/canvas/src/app/__tests__/orgs-page.test.tsx +++ b/canvas/src/app/__tests__/orgs-page.test.tsx @@ -85,6 +85,11 @@ function setLocation(href: string) { } beforeEach(() => { + // Always reset to real timers first. If a previous polling test failed + // before its finally-block ran, fake timers would still be active and + // vi.useFakeTimers() in the polling tests would be a no-op — causing + // setTimeout(0) to hang and the test to time out. + vi.useRealTimers(); vi.clearAllMocks(); // Reset mock return values so each test starts fresh. // The mock functions (vi.fn) persist across tests; only their @@ -95,10 +100,9 @@ beforeEach(() => { }); afterEach(() => { - cleanup(); -}); - -afterEach(() => { + // Ensure fake timers are never left active after a test — even one that + // failed before reaching its own finally-block. + vi.useRealTimers(); cleanup(); }); diff --git a/canvas/src/components/ConsoleModal.tsx b/canvas/src/components/ConsoleModal.tsx index 55265837..1a43ca10 100644 --- a/canvas/src/components/ConsoleModal.tsx +++ b/canvas/src/components/ConsoleModal.tsx @@ -3,6 +3,7 @@ import { useEffect, useState } from "react"; import { createPortal } from "react-dom"; import { api } from "@/lib/api"; +import { showToast } from "@/components/Toaster"; interface Props { workspaceId: string; @@ -133,7 +134,13 @@ export function ConsoleModal({ workspaceId, workspaceName, open, onClose }: Prop