From 8e4466613170cdb65df0fa5d5e7d7dda53a45fe1 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Wed, 2 Dec 2026 10:56:44 -0500 Subject: [PATCH] test(api): the invite-only test starts from exactly one account (#8295) The deliberate break letting the second account in without an invite did not fail it: accounts earlier tests made through sign-up have no test prefix, survive dbtest's reset, and kept the count above one. The test now clears users first. The deliberate break stays for one more run. Co-Authored-By: Claude Opus 5.5 --- internal/api/auth_register_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/api/auth_register_test.go b/internal/api/auth_register_test.go index 1ae630a5..c32205a9 100644 --- a/internal/api/auth_register_test.go +++ b/internal/api/auth_register_test.go @@ -271,6 +271,11 @@ func TestRegister_OneInviteMakesOneAccountUnderARace(t *testing.T) { func TestRegister_AfterTheFirstAccountAnInviteIsTheOnlyWayIn(t *testing.T) { h, pool := testHandlers(t) resetInvites(t, h) + // Exactly one account, so the first sign-up below is the second account: + // accounts other tests made through sign-up survive dbtest's reset. + if _, err := pool.Exec(context.Background(), "DELETE FROM users"); err != nil { + t.Fatalf("reset users: %v", err) + } admin := seedUser(t, pool, "admin1", "pw", true) const token = "test-invite-abc123" if _, err := pool.Exec(context.Background(),