feat(web): the language is named on the recording's page in every state; the feature says what Other really does (#61)
The label moves from the done fragment to the page header, so queued, transcribing and failed recordings show it too. The scenario no longer implies a general engine exists. Found by the PR #62 review. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -127,23 +127,25 @@ func TestUploadPage_TheFormOffersSwedishPreselectedAndOtherBeforeTheFilePart(t *
|
||||
assert.Contains(t, b, `<option value="auto"`)
|
||||
}
|
||||
|
||||
func TestUploadStatus_NamesTheLanguageTheRecordingWasTranscribedAs(t *testing.T) {
|
||||
for _, tt := range []struct {
|
||||
language domain.Language
|
||||
want string
|
||||
}{
|
||||
{domain.LangSwedish, "Swedish"},
|
||||
{domain.LangAuto, "Other (detected by the engine)"},
|
||||
} {
|
||||
t.Run(string(tt.language), func(t *testing.T) {
|
||||
app, _ := newUploadApp(t, audioOK, 200<<20)
|
||||
id := seedUpload(t, userID, "m", "done", "Synthetic transcript text.")
|
||||
_, err := rawPool(t).Exec(context.Background(), `UPDATE uploaded_transcripts SET language = $2 WHERE id = $1`, id, string(tt.language))
|
||||
require.NoError(t, err)
|
||||
func TestUploadPage_NamesTheLanguageInEveryState(t *testing.T) {
|
||||
for _, status := range []string{"queued", "transcribing", "done", "failed"} {
|
||||
for _, tt := range []struct {
|
||||
language domain.Language
|
||||
want string
|
||||
}{
|
||||
{domain.LangSwedish, "Swedish"},
|
||||
{domain.LangAuto, "Other (detected by the engine)"},
|
||||
} {
|
||||
t.Run(status+"/"+string(tt.language), func(t *testing.T) {
|
||||
app, _ := newUploadApp(t, audioOK, 200<<20)
|
||||
id := seedUpload(t, userID, "m", status, "Synthetic transcript text.")
|
||||
_, err := rawPool(t).Exec(context.Background(), `UPDATE uploaded_transcripts SET language = $2 WHERE id = $1`, id, string(tt.language))
|
||||
require.NoError(t, err)
|
||||
|
||||
b := body(t, do(t, app, get("/uploads/"+id+"/status")))
|
||||
b := body(t, do(t, app, get("/uploads/"+id)))
|
||||
|
||||
assert.Contains(t, b, "Language: "+tt.want)
|
||||
})
|
||||
assert.Contains(t, b, "Language: "+tt.want)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user