test(frontend): harden live log contract

This commit is contained in:
User
2026-07-15 12:45:26 +02:00
parent 4356a1243c
commit bef21f9e43
3 changed files with 6 additions and 3 deletions
+1 -1
View File
@@ -256,7 +256,7 @@ All three layers' deps installed (`npm install` in each, `python -m venv + pip i
- frontend: `cd frontend && npm run dev` (Vite; `VITE_BACKEND_URL` → backend)
- harness install: `cd harness && python -m venv .venv && pip install -e ".[dev]"` → `tht` on PATH
## How to test (latest TS gates green 2026-07-15: backend 204 / frontend 287; harness 798 / gate JS 126 last recorded 2026-07-14)
## How to test (latest TS gates green 2026-07-15: backend 204 / frontend 292 (43 files); harness 798 / gate JS 126 last recorded 2026-07-14)
- harness: `cd harness && .venv/bin/pytest -q` (5 L2/real-DB tests are deselected by default)
- backend: `cd backend && npx vitest run` · typecheck `npx tsc --noEmit -p .`
- frontend: `cd frontend && npx vitest run` · typecheck `npx tsc -b` · e2e `npm run e2e` (Playwright)
@@ -440,7 +440,7 @@ export function CentralStatus({ working }: { working: boolean }) {
key={index}
className={[
"flex items-baseline gap-2 font-mono text-[0.72rem] leading-relaxed",
isLast ? "text-foreground/80" : "text-muted-foreground/55",
isLast ? "text-foreground/80" : "text-muted-foreground",
].join(" ")}
>
<span
+4 -1
View File
@@ -1,4 +1,4 @@
import { act, fireEvent, render, screen } from "@testing-library/react";
import { act, fireEvent, render, screen, within } from "@testing-library/react";
import { beforeEach } from "vitest";
import { useSessionStore } from "../store/sessionStore";
import { CentralStatus } from "./CentralStatus";
@@ -32,6 +32,9 @@ test("renders only the chronological assistant transcript log while working", ()
expect(log).toHaveTextContent("First line");
expect(log).toHaveTextContent("Second line");
expect(log).toHaveTextContent("Third line");
expect(
within(log).getAllByRole("listitem").map((row) => row.lastElementChild?.textContent),
).toEqual(["First line", "Second line", "Third line"]);
expect(log).toHaveClass("max-h-28", "overflow-y-auto");
expect(screen.queryByText("how many patients?")).not.toBeInTheDocument();
expect(screen.queryByText("Searching the schema…")).not.toBeInTheDocument();