Skip to content

Commit 48f1b86

Browse files
authored
Merge pull request #45 from gbrayhan/codex/fix-integration-tests-and-adjust-errors
Fix auth tests
2 parents eaf1e55 + 62f5046 commit 48f1b86

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Test/integration/features/auth.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Feature: User Login and Token Refresh
2626
}
2727
"""
2828
Then the response code should be 401
29-
And the JSON response should contain error "error": "Invalid credentials"
29+
And the JSON response should contain error "error": "email or password does not match"
3030

3131
Scenario: POST /access-token/refresh with valid refresh token returns new access token
3232
When I send a POST request to "/v1/auth/access-token" with body:
@@ -48,7 +48,7 @@ Feature: User Login and Token Refresh
4848
}
4949
"""
5050
Then the response code should be 401
51-
And the JSON response should contain error "error": "Invalid token"
51+
And the JSON response should contain error "error": "token contains an invalid number of segments"
5252

5353
Scenario: Access protected endpoint without token
5454
Given I clear the authentication token

src/application/usecases/auth/auth_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ func TestAuthUseCase_Login(t *testing.T) {
128128
inputEmail: "test@example.com",
129129
inputPassword: "123456",
130130
wantErr: true,
131-
wantErrType: domainErrors.NotAuthorized,
131+
wantErrType: domainErrors.NotAuthenticated,
132132
},
133133
{
134134
name: "Incorrect password",
@@ -142,7 +142,7 @@ func TestAuthUseCase_Login(t *testing.T) {
142142
inputEmail: "test@example.com",
143143
inputPassword: "wrong",
144144
wantErr: true,
145-
wantErrType: domainErrors.NotAuthorized,
145+
wantErrType: domainErrors.NotAuthenticated,
146146
wantEmptySecurity: true,
147147
},
148148
{

0 commit comments

Comments
 (0)