test: third review -- a real disconnect is not an error, a DB drop is not the client's, a note stays visible, every bidi character and the 80% boundary pinned (red)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -252,7 +252,7 @@ func TestUploadProgress_TheFullPageCarriesTheVerySameProgressListAsTheFragment(t
|
|||||||
"the page a user opens and the fragment HTMX swaps in must show the same list, or the display jumps on the first poll")
|
"the page a user opens and the fragment HTMX swaps in must show the same list, or the display jumps on the first poll")
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestUploadProgress_AStepNoteIsShownUnderItsStepAndEscaped(t *testing.T) {
|
func TestUploadProgress_AStepNoteIsShownDirectlyUnderItsStepAndEscaped(t *testing.T) {
|
||||||
app, _ := newUploadApp(t, audioOK, 200<<20)
|
app, _ := newUploadApp(t, audioOK, 200<<20)
|
||||||
fixedClock(app)
|
fixedClock(app)
|
||||||
id := seedUpload(t, userID, "m", "transcribing", "")
|
id := seedUpload(t, userID, "m", "transcribing", "")
|
||||||
@@ -262,7 +262,26 @@ func TestUploadProgress_AStepNoteIsShownUnderItsStepAndEscaped(t *testing.T) {
|
|||||||
|
|
||||||
b := statusBody(t, app, id)
|
b := statusBody(t, app, id)
|
||||||
|
|
||||||
assert.Contains(t, b, "The audio is 20 min long")
|
audio := strings.Index(b, "Preparing the audio")
|
||||||
|
note := strings.Index(b, "The audio is 20 min long")
|
||||||
|
next := strings.Index(b, "Transcribing with iguana/pianissimo")
|
||||||
|
require.True(t, audio >= 0 && note > audio && next > note, "the note must sit between its own step and the next one:\n%s", b)
|
||||||
assert.Contains(t, b, "step-note")
|
assert.Contains(t, b, "step-note")
|
||||||
assert.NotContains(t, b, "<b>cut off</b>", "a note is words, never markup")
|
assert.NotContains(t, b, "<b>cut off</b>", "a note is words, never markup")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestUploadProgress_ADonePageShowsItsRecordOpenWhenAStepHasANote(t *testing.T) {
|
||||||
|
// A truncated recording must not look like a clean one: the note that replaced the
|
||||||
|
// refusal is the only warning, so it cannot sit inside a collapsed list (third review).
|
||||||
|
app, _ := newUploadApp(t, audioOK, 200<<20)
|
||||||
|
fixedClock(app)
|
||||||
|
noted := seedUpload(t, userID, "noted", "done", "Synthetic transcript text.")
|
||||||
|
steps := []domain.ProgressStep{step("audio", "Preparing the audio", domain.StepDone, 20*time.Minute, 40*time.Second, 0, 0)}
|
||||||
|
steps[0].Note = "The audio is 20 min long; the file claimed 1 h 19 min."
|
||||||
|
seedProgress(t, noted, steps, progressNow.Add(-time.Minute), progressNow.Add(-time.Minute))
|
||||||
|
clean := seedUpload(t, userID, "clean", "done", "Synthetic transcript text.")
|
||||||
|
seedProgress(t, clean, []domain.ProgressStep{step("audio", "Preparing the audio", domain.StepDone, 20*time.Minute, 40*time.Second, 0, 0)}, progressNow.Add(-time.Minute), progressNow.Add(-time.Minute))
|
||||||
|
|
||||||
|
assert.Contains(t, statusBody(t, app, noted), `<details class="what-was-done" open>`)
|
||||||
|
assert.NotContains(t, statusBody(t, app, clean), `<details class="what-was-done" open>`, "a clean record stays collapsed")
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user