Skip to content

Commit

Permalink
add real data in expectedAuthReply
Browse files Browse the repository at this point in the history
  • Loading branch information
Danspb77 committed Nov 1, 2023
1 parent 0bb2c74 commit 8814436
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ path: /auth
summary: check, access, remove, refresh token
requestBody:
required: true
content:
content
application/json:
schema:
$ref: '#/components/schemas/session'
Expand Down
9 changes: 5 additions & 4 deletions src/presentation/http/router/auth.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('Note API', () => {

const response = await global.api?.fakeRequest({
method: 'POST',
url: '/auth/' // write not authorised data
url: '/auth' // write not authorised data
})

expect(response?.statusCode).toBe(expectedStatus)
Expand All @@ -20,13 +20,14 @@ describe('Note API', () => {
const expectedStatus = 200

const expectedAuthReply = {
accessToken: '123',
refreshToken: '4567'
refreshToken: "pv-jIqfPj1",
accessToken: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MTksImlhdCI6MTY5ODc1NzQyMSwiZXhwIjoxNjk5NjU3NDIxfQ.g0PzlWpGkw4VQrMRulNrnnAFa3KxtF4buCjqxKV-wq4"

};

const response = await global.api?.fakeRequest({
method: 'POST',
url: ""//write authorised data
url: "/auth"//write authorised data
})

expect(response?.statusCode).toBe(expectedStatus)
Expand Down
1 change: 0 additions & 1 deletion src/tests/test-data/tokens.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
{
"refreshToken": "pv-jIqfPj1",
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MTksImlhdCI6MTY5ODc1NzQyMSwiZXhwIjoxNjk5NjU3NDIxfQ.g0PzlWpGkw4VQrMRulNrnnAFa3KxtF4buCjqxKV-wq4",

"refresh_token_expires_at": "2023-10-31 10:23:54+02",
"user_Id": "134",
"Id":"1"
Expand Down

0 comments on commit 8814436

Please sign in to comment.