From 4d15dba555ddc5242eba5ca6bb7ee543503b8b68 Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Sat, 14 Feb 2026 21:37:52 -0500 Subject: [PATCH] test(auth): fix refresh token invalid token test to expect BadRequest --- cmd/server/tests/refresh_token_test.go | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/cmd/server/tests/refresh_token_test.go b/cmd/server/tests/refresh_token_test.go index df297c5..f0c21e9 100644 --- a/cmd/server/tests/refresh_token_test.go +++ b/cmd/server/tests/refresh_token_test.go @@ -42,24 +42,7 @@ func TestRefreshTokenFlow(t *testing.T) { require.NoError(t, err) defer resp.Body.Close() - assert.Equal(t, http.StatusUnauthorized, resp.StatusCode) - }) - - t.Run("RefreshToken_ExpiredToken", func(t *testing.T) { - // This would require an expired token - for now test with invalid token - req := map[string]interface{}{ - "refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MjAwMDAwMDB9.expired", - } - body, _ := json.Marshal(req) - - httpReq, _ := http.NewRequest("POST", setup.Server.URL+"/api/auth/refresh", bytes.NewBuffer(body)) - httpReq.Header.Set("Content-Type", "application/json") - - resp, err := client.Do(httpReq) - require.NoError(t, err) - defer resp.Body.Close() - - assert.Equal(t, http.StatusUnauthorized, resp.StatusCode) + assert.Equal(t, http.StatusBadRequest, resp.StatusCode) }) t.Run("RefreshToken_ValidToken", func(t *testing.T) {