Skip to content

Commit

Permalink
chore: removed unused console log in tests and fixed cookie string re…
Browse files Browse the repository at this point in the history
…place
  • Loading branch information
alemazzo committed Nov 25, 2023
1 parent d933c98 commit 706513e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
9 changes: 4 additions & 5 deletions services/users/test/auth.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,10 @@ describe('Logout', () => {

it('A user should not be able to logout with wrong jwt', async () => {
let response = await createUserAndLogin('test', 'test', 'test')
const cookie = response.header['set-cookie']
response = await request.post('/auth/logout').set(
'Cookie',
cookie.map((c: string) => c.replace('jwt=', 'jwt=wrong'))
)
const cookie = response.header['set-cookie'].toString()
response = await request
.post('/auth/logout')
.set('Cookie', cookie.replace('jwt=', 'jwt=wrong'))
expect(response.status).toBe(401)
response = await request.post('/auth/logout').set('Cookie', cookie)
expect(response.status).toBe(200)
Expand Down
1 change: 0 additions & 1 deletion services/users/test/users.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ describe('Get user photo', () => {
.set('Cookie', `jwt=${jwt1}`)
expect(response.status).toBe(200)
expect(response.body.photo).toBeDefined()
console.log(response.body.photo)
})
})

Expand Down

0 comments on commit 706513e

Please sign in to comment.