Files
felhom-controller/controller/internal/web/r_partd_hollow_page_test.go
T

30 lines
1.1 KiB
Go

package web
import (
"strings"
"testing"
"time"
"gitea.dooplex.hu/admin/felhom-controller/internal/backup"
)
// Part D (v0.279.0) — the household sees the sentence on the REAL backup page (ServeHTTP → template), in
// Hungarian by default, and the page is silent when nothing is flagged (negative control).
// COMPANION RED-PROOF: drop `data["HollowCopyLines"]` from backupsAppsHandler → the sentence is absent.
func TestPartD_TheBackupPageSaysARunningAppHasNoData(t *testing.T) {
s := newDashboardServer(t, time.Time{})
if s.backupMgr == nil {
t.Fatal("fixture has no backup manager")
}
quiet := getPage(t, s, "/backups/apps")
if quiet.Code != 200 || strings.Contains(quiet.Body.String(), "nem tartalmaz adatot") {
t.Fatalf("with nothing flagged the page must be silent (code %d)", quiet.Code)
}
s.backupMgr.FlagHollowCopyForTest("cloudapp", backup.HollowTierOffsite)
rec := getPage(t, s, "/backups/apps")
body := rec.Body.String()
if rec.Code != 200 || !strings.Contains(body, "A(z) cloudapp fut, de a legutóbbi távoli mentése nem tartalmaz adatot") {
t.Fatalf("the flagged app's sentence is not on the page (code %d)", rec.Code)
}
}