Files
felhom-controller/controller/internal/web/r518_backup_downtime_copy_test.go

44 lines
1.6 KiB
Go

package web
import (
"strings"
"testing"
)
// R-518 — the whole-system backup button promised a short stop; measured 2026-09-14 on a 12-app box,
// every app was down for about 7 m 45 s. The copy now states that measurement, in both languages, on
// the page and in the confirm dialog. ASCII fragments only (ui-hungarian rule), each with a control.
func TestR518_BackupButtonStatesTheMeasuredDowntime(t *testing.T) {
s := i18nTestServer(t)
var c i18nCase
for _, x := range i18nCases() {
if x.name == "backups_full" {
c = x
}
}
if c.name == "" {
t.Fatal("no backups_full case — the test would pass by looking at nothing")
}
for _, lang := range []string{"hu", "en"} {
body := renderI18nCase(t, s, lang, c)
// v0.296.0: BOTH measurements — 2026-09-14 (12 apps, ≈8 min) and 2026-10-05 on demo-hp (9 apps, 5 min 47 s,
// audits/hub-safety-2026-10-05/partE/r518-measure.txt) — and that it is minutes, not seconds.
measured := []string{"kb. 6 perc", "kb. 8 perc", "nem másodperceket"}
vague := ""
if lang == "en" {
measured, vague = []string{"about 6 minutes", "about 8 minutes", "not seconds"}, "usually for a few minutes"
}
for _, m := range measured {
if n := strings.Count(body, m); n < 2 {
t.Errorf("%s: %q appears %d times, want it on the page AND in the confirm", lang, m, n)
}
}
if lang == "en" && strings.Contains(body, vague) {
t.Errorf("en: the old vague promise %q is still on the page", vague)
}
if lang == "hu" && strings.Contains(body, "ltalában néhány perc, nagyobb") {
t.Errorf("hu: the old vague promise is still on the page")
}
}
}