UI verbessert

This commit is contained in:
concierge committed 2026-11-19 08:14:13 +01:00
1 parent cc2e85c111
commit a5d4251868
10 files changed
+136 -83

No files matched your search

+29
View File
@@ -279,3 +279,32 @@ func TestCompactPlan(t *testing.T) {
t.Fatalf("unexpected PDF output (%d bytes)", buf.Len())
}
}
func TestCompactPlanPaginatesWithoutContinuationTitle(t *testing.T) {
r, rows, _, people := multiPageRows()
var buf bytes.Buffer
if err := CompactPlan(&buf, r, rows, people, Options{TenantName: "Bad Godesberg"}); err != nil {
t.Fatalf("render: %v", err)
}
content := string(pdfContentStreams(t, buf.Bytes()))
if strings.Contains(content, "Fortsetzung") {
t.Fatal("continuation title must not appear on later pages")
}
if strings.Contains(content, "A4 hoch") {
t.Fatal("paper hint must not appear in the compact header")
}
match := regexp.MustCompile(`Seite 1 von (\d+)`).FindStringSubmatch(content)
if match == nil {
t.Fatalf("first page footer is missing the total page count:\n%s", content)
}
total, err := strconv.Atoi(match[1])
if err != nil || total < 2 {
t.Fatalf("total pages = %q, want at least 2", match[1])
}
if !strings.Contains(content, fmt.Sprintf("Seite %d von %d", total, total)) {
t.Fatalf("last page footer is missing: want Seite %d von %d", total, total)
}
if got := strings.Count(content, "Seite "); got != total {
t.Fatalf("footer count = %d, want %d", got, total)
}
}