import { renderToStaticMarkup } from "react-dom/server"; import { describe, expect, it } from "vitest"; import { AgentLogPanel, buildAgentLogExportText } from "./AgentLogPanel"; describe("AgentLogPanel", () => { it("renders logs in chronological order so scrolling upward reveals older activity", () => { const html = renderToStaticMarkup( , ); expect(html.indexOf("First event")).toBeLessThan(html.indexOf("Second event")); }); it("exports thinking lines in the plain-text log export", () => { const content = buildAgentLogExportText({ busy: true, logs: [ { id: "log-1", title: "Thinking", detail: "Resolved scope to System Requirements Specification.", level: "info", createdAt: "2026-01-01T10:00:00.000Z", }, ], }); expect(content).toContain("Agent Log Export"); expect(content).toContain("Status: Running"); expect(content).toContain("Thinking"); expect(content).toContain("Resolved scope to System Requirements Specification."); }); });