test(coach): pin the answered-clarification line on the local path

The line that resolves an answered clarifying question was already
appended to the system prompt on both paths; nothing proved it for the
no-tools (local model) path. Three route-level cases now do: the local
prompt and the tool-mode prompt both carry the server-resolved line, and
a turn without an answer carries neither. Removing the line from the
local prompt fails the first case.

The golden harness gains a coachMessage.findMany mock for this; it
defaults to no rows, so no existing transcript changes and the golden
snapshots are untouched.

The result-table caption test used the regex dotAll flag, which the
TypeScript target rejects (TS1501); it matches across lines with
[\s\S] instead.
This commit is contained in:
Marc-André Bombeck committed 2026-09-27 12:11:55 +02:00
1 parent b40de3a4d9
commit db10ba714e
3 files changed
+108 -1

No files matched your search

@@ -73,7 +73,7 @@ describe("CoachResultTable", () => {
<CoachResultTable result={table(3)} method="30 readings, daily means" />,
);
expect(html).toMatch(
/<caption[^>]*>.*Blood pressure by day.*30 readings, daily means.*<\/caption>/s,
/<caption[^>]*>[\s\S]*Blood pressure by day[\s\S]*30 readings, daily means[\s\S]*<\/caption>/,
);
});