fix: update test expectations for new disabled user fixture

- TestListUsers expects 17 users (was 16)
- TestCleanupOldTokens expects 3 old tokens deleted (was 2)
This commit is contained in:
kolaente 2026-03-20 10:43:18 +01:00 committed by kolaente
parent 049f4a6be4
commit 89923ebe70
2 changed files with 6 additions and 5 deletions

View File

@ -58,7 +58,7 @@ func TestListUsers(t *testing.T) {
all, err := user.ListAllUsers(s)
require.NoError(t, err)
assert.Len(t, all, 16)
assert.Len(t, all, 17)
})
t.Run("no search term", func(t *testing.T) {
db.LoadAndAssertFixtures(t)
@ -171,7 +171,7 @@ func TestListUsers(t *testing.T) {
MatchFuzzily: true,
})
require.NoError(t, err)
assert.Len(t, all, 16)
assert.Len(t, all, 17)
})
// External team discoverability bypass tests

View File

@ -517,9 +517,10 @@ func TestCleanupOldTokens(t *testing.T) {
deleted, err := CleanupOldTokens(s)
require.NoError(t, err)
// Fixtures have two old tokens that should be cleaned up:
// id=1 (kind=1, TokenPasswordReset, created 2021) and id=4 (kind=3, TokenAccountDeletion, created 2021)
assert.Equal(t, int64(2), deleted)
// Fixtures have three old tokens that should be cleaned up:
// id=1 (kind=1, TokenPasswordReset, created 2021), id=4 (kind=3, TokenAccountDeletion, created 2021),
// and id=5 (kind=1, TokenPasswordReset for disabled user, created 2024)
assert.Equal(t, int64(3), deleted)
err = s.Commit()
require.NoError(t, err)