diff --git a/internal/web/uploads_progress_handler_test.go b/internal/web/uploads_progress_handler_test.go
index a7d9305..0d325e2 100644
--- a/internal/web/uploads_progress_handler_test.go
+++ b/internal/web/uploads_progress_handler_test.go
@@ -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, `
")
+ require.GreaterOrEqual(t, end, 0)
+ return html[start : start+end+len("
")]
+}
+
+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")
}