Files
felhom-controller/controller/internal/web/r518_backup_downtime_copy_test.go
T
admin d720495cd5 R-518: backup button copy says local copy, one short stop, off-site at night (hu+en)
The 'Mentes most' hint and its confirm stated the v0.296.0 measurements
(about 6 min / 9 apps, about 8 min / 12 apps) and that the off-site copy in
the same run makes it longer. Since decision 156 the press makes the local
copy only and resumes the apps at its snapshot, so the copy now says: a
short stop of about 1-1.5 minutes (longer with more apps), the apps run
again while the copy finishes, the off-site copy follows with the next
nightly backup. Parity fixtures updated in place;
TestR518_BackupButtonStatesTheMeasuredDowntime ->
TestR518_BackupButtonStatesTheShortLocalOnlyStop (new copy on page AND in
confirm, old minutes gone, ASCII fragments).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
2026-10-06 15:15:33 +02:00

50 lines
1.9 KiB
Go

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)
}
}
}
}