The remove dialog shows the older sentence about the nightly snapshots only where no end date is shown (felhom.eu decision 316, R-1374)
gates / gates (push) Successful in 45s

Household-facing, built and NOT published. No string changed; layout.html only.
The 144 i18n_parity fixtures are patched on the dialog's lines only.

Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
This commit is contained in:
admin committed 2026-11-15 16:39:13 +01:00
1 parent c5acb91a44
commit 10df99b89f
148 files changed
+352 -581

No files matched your search

@@ -287,3 +287,43 @@ func TestD72_TheRemoveDialogNamesTheDate(t *testing.T) {
}
}
}
// THE OLDER SENTENCE IS NOT SHOWN BESIDE THE NEW LINE (felhom.eu `09` §3 decision 316). „The nightly snapshots cannot
// be deleted one by one — they age out by the retention rules” is no longer true on a box that shows „the off-site
// copies … are deleted on <date>”. The dialog's script shows exactly ONE of the two: the new line when the API gave
// a date (a box with the hub's off-site tier), the older sentence on every other box.
//
// What this test reads: the dialog is built by a script in the browser, and no script engine runs in this suite. So
// it reads the script's two branches from the rendered page — the text after `offsite_end_date ?` up to the `:`, and
// the text after it up to the closing `)` — and checks each branch's content. No browser has run it.
// RED-PROOF: felhom.eu documentation/audits/build-release-4b-2026-11-15/B/redproof-texts-controller.txt.
func TestD72_TheRemoveDialogShowsTheOlderSentenceOnlyWithoutTheDate(t *testing.T) {
for lang, s := range map[string]struct{ newLine, older string }{
"hu": {"A távoli másolatok még 30 napig megmaradnak. Törlésük napja: {date}", "Az éjszakai restic pillanatképek nem törölhetők egyenként"},
"en": {"The off-site copies stay for 30 more days. They are deleted on: {date}.", "The nightly restic snapshots cannot be deleted one by one"},
} {
html := renderBackupPageLang(t, lang, "backups_restore", endsRestoreData(nil))
const cond = "(backupResp.data.offsite_end_date ? "
i := strings.Index(html, cond)
if i < 0 || strings.Count(html, cond) != 1 {
t.Fatalf("[%s] the dialog's script has no single `offsite_end_date ?` choice (found %d)", lang, strings.Count(html, cond))
}
rest := html[i+len(cond):]
colon := strings.Index(rest, "'</div>' : '")
end := strings.Index(rest, "'</div>') +")
if colon < 0 || end < colon {
t.Fatalf("[%s] the choice has not the shape `date ? … '</div>' : … '</div>')`:\n%.400s", lang, rest)
}
withDate, without := rest[:colon], rest[colon:end]
if !strings.Contains(withDate, s.newLine) || strings.Contains(withDate, s.older) {
t.Errorf("[%s] WITH a date the dialog must show the new line and not the older sentence:\n%s", lang, withDate)
}
if !strings.Contains(without, s.older) || strings.Contains(without, s.newLine) {
t.Errorf("[%s] WITHOUT a date the dialog must show the older sentence and not the new line:\n%s", lang, without)
}
// … and the older sentence is nowhere else in the dialog's script: it cannot show beside the new line.
if n := strings.Count(html, s.older); n != 1 {
t.Errorf("[%s] the older sentence is on the page %d times, want once (inside the no-date branch)", lang, n)
}
}
}