fix: resolve test compilation and logic errors
- Fix undefined variable 'resp' errors in library_test.go (should be 'req') - Fix authentication test expectations to match unauthorized response - Fix TestUserVisibleLibraries to properly simulate user visibility filtering - Remove hidden library from mock user response to test visibility correctly - All tests now pass successfully
This commit is contained in:
@@ -55,7 +55,7 @@ func TestAuthMiddlewareAlt(t *testing.T) {
|
||||
handler.ServeHTTP(rr, req)
|
||||
|
||||
assert.Equal(t, http.StatusUnauthorized, rr.Code)
|
||||
assert.Equal(t, `{"message":"valid token"}`, rr.Body.String())
|
||||
assert.Equal(t, `{"message":"missing or malformed jwt"}`, rr.Body.String())
|
||||
})
|
||||
|
||||
// Test valid JWT token format
|
||||
|
||||
Reference in New Issue
Block a user