test: drive the phase-2 verbs end to end under a pty

The fake API server grows the routes the dashboard now calls (terminal tail,
input, approvals answer, search, away digest, plan usage on status), and the
new cases assert on what the server RECEIVED rather than on the frame: the
prompt arrives as one line ending in a carriage return, and the answers as
the exact action and option digit.

Also covered: the tail refreshing in place, the search overlay selecting a
live session, the digest rendering, one bell for an item announced twice,
and the 409 path reported as "no longer on screen".

The plan-usage chip is punctuated with the glyph tier's separator, so an
ASCII terminal no longer gets a stray middle dot in the header.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Codeman maintainer
2026-08-16 21:35:31 +02:00
parent f644ce3af9
commit 4696c381dd
4 changed files with 348 additions and 14 deletions
+5
View File
@@ -564,6 +564,11 @@ describe('formatPlanUsage', () => {
expect(formatPlanUsage({ sevenDay: { usedPercentage: 90, resetAt: 1 } })).toBe('wk 90%');
});
it('punctuates with the separator it is given, so an ASCII terminal gets none', () => {
const usage = { fiveHour: { usedPercentage: 32, resetAt: 1 }, sevenDay: { usedPercentage: 61, resetAt: 2 } };
expect(formatPlanUsage(usage, ' - ')).toBe('5h 32% - wk 61%');
});
it('is empty when there is nothing to report, so the header shows no placeholder', () => {
expect(formatPlanUsage(null)).toBe('');
expect(formatPlanUsage(undefined)).toBe('');