fix(assessment): return confirmed categories with their basis and label demonstration categories

This commit is contained in:
shira committed 2026-10-09 21:24:24 +03:00
1 parent 623d41b969
commit d4903a3796
77 files changed
+1441 -288

No files matched your search

@@ -130,6 +130,7 @@ type matchEntryBody struct {
Category *struct {
Specialization string `json:"specialization"`
Grade string `json:"grade"`
Basis string `json:"basis"`
} `json:"category"`
Strength *string `json:"strength"`
PublicContext struct {
@@ -545,6 +546,13 @@ func TestMatchSearchOverHTTP(t *testing.T) {
t.Fatalf("organization A confirmed bank = %d main, %d near, %d unconfirmed; want exactly the eleven visible confirmed candidates",
len(bankA.Groups.Main), len(bankA.Groups.Near), len(bankA.Groups.Unconfirmed))
}
// Every confirmed category names its basis, so a demonstration grade is
// never presented as a standard confirmation.
for _, entry := range bankA.Groups.Main {
if entry.Category == nil || entry.Category.Basis != "synthetic_demo" {
t.Fatalf("confirmed entry %s category = %+v, want the synthetic_demo basis", entry.CandidateHandle, entry.Category)
}
}
if slices.Contains(handlesOf(bankA.Groups.Main), aliasIn(orgA.ID(), hiddenFromA.id)) {
t.Fatal("organization A received a candidate that hides it")
}