Mobile-Update + Bericht
release-tag / release-image (push) Successful in 2m6s

This commit is contained in:
2026-08-14 18:17:38 +02:00
parent 2d384046dd
commit 57f7470310
9 changed files with 608 additions and 16 deletions
+27
View File
@@ -26,3 +26,30 @@ func TestCSVCompactOmitsActivity(t *testing.T) {
t.Fatal("compact CSV contains activity")
}
}
func TestServiceReportPDFContainsSignatureFields(t *testing.T) {
end := int64(3_600_000)
pdf := makeServiceReportPDF(
[]Entry{{ID: "x", Client: "ACME", Activity: "Router geprüft und Firmware aktualisiert", StartMS: 0, EndMS: &end}},
Settings{RoundingMinutes: 1, TimeFormat: "24", Timezone: "UTC"},
User{DisplayName: "Max Techniker", Username: "max"},
serviceReportMeta{Client: "ACME", Contact: "Erika Kunde", OrderNumber: "SR-42", ReportDate: "14.08.2026"},
)
for _, want := range [][]byte{[]byte("%PDF-1.4"), []byte("SERVICE-BERICHT"), []byte("ACME"), []byte("Gesamtdauer"), []byte("Unterschrift Kunde"), []byte("Unterschrift Techniker")} {
if !bytes.Contains(pdf, want) {
t.Fatalf("service report missing %q", want)
}
}
}
func TestWrapPDFText(t *testing.T) {
lines := wrapPDFText("eins zwei drei vier", 9)
if len(lines) < 2 {
t.Fatalf("expected wrapped lines, got %#v", lines)
}
for _, line := range lines {
if len([]rune(line)) > 9 {
t.Fatalf("line too long: %q", line)
}
}
}