package web import ( "strings" "testing" ) // R-518 — the whole-system backup button's copy, in both languages, on the page AND in the confirm. // // History: the button first promised a short stop; measured 2026-09-14 (12 apps) every app was down for // about 7 m 45 s, and v0.296.0 stated the measurements (≈6 min / 9 apps, ≈8 min / 12 apps). Since // `09` §3 decision 156 (R-518 option A) the press backs up the LOCAL copy only and resumes the apps at // its snapshot, so the stop is short again (≈80 s inferred on demo-hp: stop 21 s + snapshot ≤12 s + // restart 46 s) and the off-site copy follows at the next night run. The copy says exactly that, and // the old minutes — now untrue for a press — must be gone. // // ASCII fragments only (ui-hungarian rule). The positive fragments double as the control for the // negative ones: they prove the body searched actually carries the button's copy. func TestR518_BackupButtonStatesTheShortLocalOnlyStop(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) want := []string{"1,5 perc", "A gomb a helyi m", "jszakai ment"} gone := []string{"6 perc", "8 perc", "ugyanekkor k"} if lang == "en" { want = []string{"1.5 minutes", "This button makes the local copy", "next nightly backup"} gone = []string{"6 minutes", "8 minutes", "in the same run"} } for _, m := range want { 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) } } for _, m := range gone { if strings.Contains(body, m) { t.Errorf("%s: the old copy %q is still on the page — a press no longer stops the apps for minutes or makes the off-site copy", lang, m) } } } }