// CLI-backed chat surface tests (CLI Agent Executor, U12). // // Exercises the transcript ↔ terminal toggle, the terminal-owns-composer rule, // the generic-tier terminal-only rendering, and the composer queued indicator. // SessionTerminal is mocked (no xterm / no WS / no PTY / no port 4040) so these // are pure component-behavior assertions. import { describe, expect, it, vi } from "vitest"; import { fireEvent, render, screen } from "@testing-library/react"; // Mock SessionTerminal — it lazy-loads xterm and opens a WS; we only need to // assert presence/absence of the terminal surface. vi.mock("../SessionTerminal", () => ({ SessionTerminal: ({ sessionId }: { sessionId: string }) => (
terminal
), })); import { CliChatSurface } from "../CliChatSurface"; function renderSurface(overrides: Partial> = {}) { return render(
transcript-rows
} renderComposer={() =>