controller v0.268.0: the undo finds volumes by definition; a held app names only a whole copy; one press = one tested step (R-658, R-659, R-660, R-651; 09 §6.4 part 5)
gates / gates (push) Successful in 27s
gates / gates (push) Successful in 27s
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
package web
|
||||
|
||||
import (
|
||||
"regexp"
|
||||
"testing"
|
||||
|
||||
"gitea.dooplex.hu/admin/felhom-controller/internal/stacks"
|
||||
)
|
||||
|
||||
// R-659 (v0.268.0) — a hold that names NO whole copy gets no restore button beside its sentence, on
|
||||
// either page; a hold that names one keeps it. A render test PER BRANCH of the gate (seam-wiring rule).
|
||||
//
|
||||
// COMPANION RED-PROOF (REPORT.md): drop `{{if not .HoldNoWholeCopy}}` from stacks.html — the
|
||||
// "no whole copy" branch fails with the button present.
|
||||
|
||||
var heldButton = regexp.MustCompile(`data-held="true">[^<]*<a href="/backups/apps"`)
|
||||
|
||||
func TestR659_HeldPage_NoWholeCopyOffersNoRestoreButton(t *testing.T) {
|
||||
for _, noWhole := range []bool{true, false} {
|
||||
st := ubStack(nil, map[string]string{"web": "nginx:1.27"}, "2026-07-18")
|
||||
st.State = stacks.StateStopped
|
||||
st.HoldReason = "HOLD SENTENCE"
|
||||
st.HoldNoWholeCopy = noWhole
|
||||
for _, page := range []string{"stacks", "app_info"} {
|
||||
var h string
|
||||
if page == "stacks" {
|
||||
h = renderBackupPage(t, "stacks", ubStacksData(st))
|
||||
} else {
|
||||
h = renderBackupPage(t, "app_info", appInfoData(st))
|
||||
}
|
||||
got := heldButton.MatchString(h)
|
||||
if noWhole && got {
|
||||
t.Errorf("%s: a hold naming no whole copy still offers the Mentések button — the restore there would refuse", page)
|
||||
}
|
||||
if !noWhole && !got {
|
||||
t.Errorf("%s: positive control — a hold naming a whole copy must keep its way back", page)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user