import { act, cleanup, fireEvent, render, screen, waitFor, within } from "@testing-library/react"; import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; import type { Window as HappyWindow } from "happy-dom"; import type { InboundEvent, Outbound } from "@/lib/types"; (window as unknown as HappyWindow).happyDOM.settings.disableIframePageLoading = true; vi.mock("@/lib/bootstrap", async (original) => ({ ...await original(), fetchBootstrap: vi.fn(async () => ({ token: "test", api_token: "test", ws_path: "/" })), deriveWsUrl: () => "ws://test", })); // Keep this suite focused on App's remote boundary rather than the chat implementation. vi.mock("@/components/thread/ThreadShell", () => ({ ThreadShell: () =>