This commit is contained in:
2026-08-16 17:38:15 +02:00
parent d161b28a10
commit b19373e2a4
9 changed files with 365 additions and 15 deletions
@@ -181,6 +181,19 @@ func TestCoerceCategoryToCompanyUniqueID_nameToUID(t *testing.T) {
}
}
func TestResolveCompanyCategoryUniqueID_usedByV1Projection(t *testing.T) {
t.Parallel()
names := map[string]string{"50": "Štedilniki"}
valid := map[string]struct{}{"50": {}}
// Poll/projection path: mapped name-only token must resolve like processOne.
if got := resolveCompanyCategoryUniqueID("Štedilniki", names, valid); got != "50" {
t.Fatalf("got %q want 50", got)
}
if got := resolveCompanyCategoryUniqueID("50", names, valid); got != "50" {
t.Fatalf("uid passthrough got %q", got)
}
}
func TestCategoryUniqueIDFromAny_nestedNameOnly(t *testing.T) {
t.Parallel()
got := categoryUniqueIDFromAny(map[string]any{"name": "Štedilniki"})