package report import ( "testing" "gitea.dooplex.hu/admin/felhom-controller/internal/config" ) // R-331 — the four dead BackupReport fields must STAY dead, and stay zero. // // They are declared and on the wire but nothing assigns them (disk-tier restic moved to the host // agent in slice 8C). The hub rendered them anyway and told every operator that every customer had // `Snapshots 0 · Repo Size 0 MB · Integrity Unknown` — over a box that really held 67 snapshots. // // This test exists because the failure mode is a FUTURE one: someone assigns one of these fields, // believes the hub will show it, and it will not — the hub reads `offsite` now. If a real producer is // ever wanted here, this test failing is the prompt to update the hub card in the SAME change rather // than shipping a field nothing renders. That is the "seam built but never wired" class, which this // project has hit five times. func TestBackupReport_DeadFieldsStayZero(t *testing.T) { // A real config with a nil manager takes the early return — the shape every live report has had // for these fields since 8C. br := buildBackupReport(&config.Config{}, nil) if br.SnapshotCount != 0 || br.RepoSizeMB != 0 || br.IntegrityOK || br.LastIntegrityCheck != nil { t.Fatalf("a producer appeared for a dead BackupReport field "+ "(snapshots=%d repo_mb=%d integrity_ok=%v last_check=%v). The hub's Backup card reads the "+ "`offsite` object, NOT these — update hub/internal/web/backup_card.go in this same change, "+ "or the value will never reach a screen.", br.SnapshotCount, br.RepoSizeMB, br.IntegrityOK, br.LastIntegrityCheck) } }