From 3005f9dde519a9ea7d6099403b3d08994a60db48 Mon Sep 17 00:00:00 2001 From: garrettladley Date: Thu, 15 Feb 2024 19:28:41 -0500 Subject: [PATCH] fix formatting | fix tests --- backend/tests/api/helpers/auth.go | 1 - backend/tests/api/user_test.go | 8 ++------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/backend/tests/api/helpers/auth.go b/backend/tests/api/helpers/auth.go index f08767905..eb65640e3 100644 --- a/backend/tests/api/helpers/auth.go +++ b/backend/tests/api/helpers/auth.go @@ -103,7 +103,6 @@ func (app *TestApp) authStudent() { "password": rawPassword, }, }) - if err != nil { panic(err) } diff --git a/backend/tests/api/user_test.go b/backend/tests/api/user_test.go index c6e1f7ead..0ca218286 100644 --- a/backend/tests/api/user_test.go +++ b/backend/tests/api/user_test.go @@ -209,8 +209,6 @@ func TestUpdateUserWorks(t *testing.T) { } func TestUpdateUserFailsOnInvalidBody(t *testing.T) { - appAssert := h.InitTest(t) - for _, invalidData := range []map[string]interface{}{ {"email": "not.northeastern@gmail.com"}, {"nuid": "1800-123-4567"}, @@ -219,7 +217,7 @@ func TestUpdateUserFailsOnInvalidBody(t *testing.T) { } { invalidData := invalidData - appAssert.TestOnErrorAndTester( + h.InitTest(t).TestOnErrorAndTester( h.TestRequest{ Method: fiber.MethodPatch, Path: "/api/v1/users/:userID", @@ -231,10 +229,8 @@ func TestUpdateUserFailsOnInvalidBody(t *testing.T) { Error: errors.FailedToValidateUser, Tester: TestNumUsersRemainsAt2, }, - ) + ).Close() } - - appAssert.Close() } func TestUpdateUserFailsBadRequest(t *testing.T) {