feat: upload audio, get a private Swedish transcript, discuss it (#33, ADR-033) #39

Merged
mathias merged 299 commits from feat/33-audio-upload-transcript into main 2026-10-03 14:13:37 +00:00
Showing only changes of commit e38ea3175d - Show all commits
+15 -6
View File
@@ -229,16 +229,25 @@ func TestUploadProgress_ADoneJobKeepsItsRecordOfWhatWasDoneAndHowLongEachTook(t
assert.NotContains(t, b, "spinner")
}
func TestUploadProgress_TheFullPageRendersTheSameDisplayAsTheFragment(t *testing.T) {
// stepsBlock is the progress list of a page: from its opening tag to its closing one.
func stepsBlock(t *testing.T, html string) string {
t.Helper()
start := strings.Index(html, `<ol class="steps"`)
require.GreaterOrEqual(t, start, 0, "no progress list in:\n%s", html)
end := strings.Index(html[start:], "</ol>")
require.GreaterOrEqual(t, end, 0)
return html[start : start+end+len("</ol>")]
}
func TestUploadProgress_TheFullPageCarriesTheVerySameProgressListAsTheFragment(t *testing.T) {
app, _ := newUploadApp(t, audioOK, 200<<20)
fixedClock(app)
id := seedUpload(t, userID, "m", "transcribing", "")
seedProgress(t, id, twoEngineRun(), progressNow.Add(-10*time.Second), progressNow.Add(-4*time.Second))
rec := do(t, app, get("/uploads/"+id))
full := body(t, do(t, app, get("/uploads/"+id)))
fragment := statusBody(t, app, id)
require.Equal(t, 200, rec.Code)
b := body(t, rec)
assert.Contains(t, b, "Transcribing with iguana/kb-whisper", "the page a user opens, not only the polled fragment, shows the phases")
assert.Contains(t, b, "3m 12s")
assert.Equal(t, stepsBlock(t, fragment), stepsBlock(t, full),
"the page a user opens and the fragment HTMX swaps in must show the same list, or the display jumps on the first poll")
}