diff --git a/server/server_test.go b/server/server_test.go index 0814f21..c93dfdb 100644 --- a/server/server_test.go +++ b/server/server_test.go @@ -33,6 +33,11 @@ type TestSuite struct { tx *gorm.DB } +type Fixtures struct { + Tenants []db.Tenant + Users []db.User +} + // SetupTest runs before every test function func (ts *TestSuite) SetupTest() { ts.Assertions = require.New(ts.T()) @@ -68,21 +73,10 @@ func (ts *TestSuite) createUserFixture() Fixtures { createdUser, err := db.CreateUser(ts.ctx, fakeUserCreate) ts.NoError(err) - newToken, err := db.CreateToken(ts.ctx, app.TokenCreateInput{ - UserID: createdUser.ID, - AuthID: createdUser.ID, - ExpiresAt: time.Now().Add(time.Hour * 24), - }) - ts.NoError(err) - if err != nil { - return Fixtures{} - } - ts.createTokenFixture(createdUser.Email, createdUser.ID) return Fixtures{ - Users: []db.User{createdUser}, - Tokens: []db.Token{newToken}, + Users: []db.User{createdUser}, } } @@ -98,12 +92,6 @@ func (ts *TestSuite) createTenantFixture() Fixtures { } } -type Fixtures struct { - Tenants []db.Tenant - Tokens []db.Token - Users []db.User -} - func deleteAll(c echo.Context, i any) { result := db.Tx(c).Where("TRUE").Delete(i) if result.Error != nil {