From 5640d95f409bef1949f24f0063ae2ad7ae32cdb9 Mon Sep 17 00:00:00 2001 From: Mathias Date: Fri, 2 Oct 2026 16:43:46 +0200 Subject: [PATCH] test: the duration limit is checked against what is converted, not what the header claims (red; adversarial review F2) Co-Authored-By: Claude Sonnet 5.5 --- internal/web/uploads_handler_test.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/internal/web/uploads_handler_test.go b/internal/web/uploads_handler_test.go index 158eafd..bc0ca3c 100644 --- a/internal/web/uploads_handler_test.go +++ b/internal/web/uploads_handler_test.go @@ -460,3 +460,21 @@ func TestUploadStatus_AVeryLongListOfContestedSpotsIsShortenedWithItsTrueCount(t assert.NotContains(t, b, ">b119<", "the page does not render every one") assert.Contains(t, b, "70 more", "120 stored, 50 shown") } + +func TestUploadStatus_ALengthFailureIsExplainedInWordsAndNotAsAGenericError(t *testing.T) { + app, _ := newUploadApp(t, audioOK, 200<<20) + tests := []struct{ kind, want string }{ + {"audio_too_long", "longer than the limit"}, + {"audio_incomplete", "ends much earlier than"}, + } + for _, tt := range tests { + t.Run(tt.kind, func(t *testing.T) { + id := seedUpload(t, userID, "m-"+tt.kind, "failed", tt.kind) + + b := body(t, do(t, app, get("/uploads/"+id+"/status"))) + + assert.Contains(t, b, tt.want) + assert.NotContains(t, b, "This upload failed. Please upload it again.") + }) + } +}