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.") + }) + } +}