test(widget): pin the pill's content width instead of bounding it

CodeRabbit: the max-width assertion used `<=`, so a future cap of 200px
would pass while silently narrowing the pill and clipping more of the label
— the truncation #1884 is about. Assert equality with the real content box
(WINDOW_WIDTH - GUTTER * 2) so the required width is pinned, not just
bounded.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
psiberfunk
2026-09-07 10:00:58 -04:00
co-authored by Claude Opus 5
parent 12b398b662
commit e014d63253
@@ -77,7 +77,11 @@ describe('index.css: widget-scoped .capture-pill shadow fits the 8px gutter', ()
const maxWidthMatch = rule.match(/max-width:\s*(\d+(?:\.\d+)?)px/);
expect(maxWidthMatch).not.toBeNull();
expect(parseFloat(maxWidthMatch[1])).toBeLessThanOrEqual(WINDOW_WIDTH - GUTTER * 2);
// Equality, not `<=`: the pill must fill the content box exactly. A
// smaller cap would also "fit the gutter" while silently narrowing the
// pill and clipping more of the label — the very truncation #1884 is
// about. Pin the required width so a future tightening can't pass here.
expect(parseFloat(maxWidthMatch[1])).toBe(WINDOW_WIDTH - GUTTER * 2);
});
// .capture-pill--recording / --transcribing fully override box-shadow