test(07-07): cover already-activated activate and 22-ported corpus counts

Unit tests now expect Winter 500 HTML when the target user is already
active, and the inventory assertions match 169/22/147.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Jakub Zych
2026-09-22 23:57:10 +02:00
parent d94634d5d8
commit d4066a8c3f
2 changed files with 34 additions and 3 deletions

View File

@@ -92,8 +92,20 @@ func TestCodes(t *testing.T) {
if err != nil {
t.Fatal(err)
}
before, err := IsAlreadyActivated(t.Context(), db, pending.ID)
if err != nil || before {
t.Fatalf("pending already-activated = %t err=%v", before, err)
}
activated, ok := VerifyActivationCode(t.Context(), db, pending.ID, activation)
if !ok || activated == nil || !activated.IsActivated {
t.Fatalf("activate = %v %#v", ok, activated)
}
after, err := IsAlreadyActivated(t.Context(), db, pending.ID)
if err != nil || !after {
t.Fatalf("activated already-activated = %t err=%v", after, err)
}
missing, err := IsAlreadyActivated(t.Context(), db, 999999)
if err != nil || missing {
t.Fatalf("missing already-activated = %t err=%v", missing, err)
}
}