test(api/v2): defer license reset in admin webtest

This commit is contained in:
kolaente 2026-05-31 21:06:34 +02:00 committed by kolaente
parent 730932be13
commit 17bef4f599
1 changed files with 5 additions and 1 deletions

View File

@ -54,7 +54,11 @@ func TestHumaAdminProjects(t *testing.T) {
t.Run("admin without the feature gets 404", func(t *testing.T) {
e, err := setupTestEnv()
require.NoError(t, err)
license.ResetForTests()
// A valid license that lacks the admin panel feature still gates the
// route. Match the sibling subtests' set/defer-reset pattern so the
// license state never bleeds into other tests.
license.SetForTests([]license.Feature{})
defer license.ResetForTests()
admin := promoteToAdmin(t, 1)