diff --git a/controller/internal/web/backups_split_test.go b/controller/internal/web/backups_split_test.go index e513238..b26fc15 100644 --- a/controller/internal/web/backups_split_test.go +++ b/controller/internal/web/backups_split_test.go @@ -85,6 +85,59 @@ func TestBackupsSplit_CrossPageAnchors(t *testing.T) { } } +// Felhom-offsite status card (v0.124.0, decision 2): three honest states, display-only — +// the card itself must never carry a form or button (no state change from the card, ever). +func TestBackupsRemote_OffsiteStatusCardStates(t *testing.T) { + cardOf := func(html string) string { + i := strings.Index(html, `id="felhom-offsite-card"`) + if i < 0 { + return "" + } + j := strings.Index(html[i:], "") + return html[i : i+j] + } + + // State 1: no target configured → the opt-in pitch (and no "Aktív" headline). + data := splitTestData() + data["OffboxConfigured"] = false + data["Offbox"] = nil + data["OffboxToggledCount"] = 0 + html := renderBackupPage(t, "backups_remote", data) + if !strings.Contains(html, "Felhom offsite tárhely — igényelhető szolgáltatás. Titkosított, házon kívüli másolat a mentéseidről. Érdeklődj az üzemeltetőnél.") { + t.Error("state 1: the opt-in pitch is missing") + } + if strings.Contains(html, "Aktív — nincs kijelölt alkalmazás") { + t.Error("state 1 must not render the state-2 headline") + } + if card := cardOf(html); strings.Contains(card, "