This commit is contained in:
2026-08-16 12:00:28 +02:00
parent 52f27e30fc
commit 52fb129957
7 changed files with 105 additions and 23 deletions
+16
View File
@@ -38,3 +38,19 @@ func TestBuildMappedDataFromV1Item(t *testing.T) {
t.Fatalf("more=%s", b)
}
}
func TestBuildMappedDataFromV1ItemOmitsEmptyNulls(t *testing.T) {
mapped := BuildMappedDataFromV1Item(V1ProcessItem{EAN: "123"})
if _, ok := mapped["title"]; ok {
t.Fatalf("empty title must be omitted, got %v", mapped)
}
if _, ok := mapped["description"]; ok {
t.Fatalf("empty description must be omitted, got %v", mapped)
}
if !v1ItemHasContent(V1ProcessItem{EAN: "1", Title: "x"}) {
t.Fatal("title should count as content")
}
if v1ItemHasContent(V1ProcessItem{EAN: "1"}) {
t.Fatal("EAN-only must not count as content")
}
}