test(web): guard against the removed over-promise card copy

Extend the card copy guard so "Try now", "Summarize now", "Fetching soon", and
"the next run" can't silently return to any card state (UX review honesty pass).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-08 14:03:08 +02:00
co-authored by Claude Opus 4.8
parent 51aa5d940c
commit f29927f50d
+9 -4
View File
@@ -135,8 +135,11 @@ func TestVideoCard_State5_Pending(t *testing.T) {
} }
} }
// TestVideoCard_TryNowAbsent — "Try now" must not appear in any rendered card. // TestVideoCard_ForbiddenCopyAbsent — the over-promising / jargon phrases the
func TestVideoCard_TryNowAbsent(t *testing.T) { // honesty pass removed must not reappear in any rendered card state (UX review
// A3/A4/A6): "Try now", "Summarize now", "Fetching soon", "the next run".
func TestVideoCard_ForbiddenCopyAbsent(t *testing.T) {
forbidden := []string{"Try now", "Summarize now", "Fetching soon", "the next run"}
cases := []store.SummaryRow{ cases := []store.SummaryRow{
{VideoID: "a", Summarized: true, Summary: "s", AIProvider: "local"}, {VideoID: "a", Summarized: true, Summary: "s", AIProvider: "local"},
{VideoID: "b", TranscriptStatus: "none"}, {VideoID: "b", TranscriptStatus: "none"},
@@ -146,8 +149,10 @@ func TestVideoCard_TryNowAbsent(t *testing.T) {
} }
for _, r := range cases { for _, r := range cases {
html := renderVideoCard(t, r) html := renderVideoCard(t, r)
if strings.Contains(html, "Try now") { for _, phrase := range forbidden {
t.Errorf("'Try now' must not appear in any card state; video %q got:\n%s", r.VideoID, html) if strings.Contains(html, phrase) {
t.Errorf("forbidden copy %q reappeared in card %q:\n%s", phrase, r.VideoID, html)
}
} }
} }
} }