From 706513e828747ff835d561ec105c7a6ca9180bd6 Mon Sep 17 00:00:00 2001 From: Alessandro Mazzoli Date: Sat, 25 Nov 2023 10:27:48 +0100 Subject: [PATCH] chore: removed unused console log in tests and fixed cookie string replace --- services/users/test/auth.test.ts | 9 ++++----- services/users/test/users.test.ts | 1 - 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/services/users/test/auth.test.ts b/services/users/test/auth.test.ts index 128ef9c2..c02fccc0 100644 --- a/services/users/test/auth.test.ts +++ b/services/users/test/auth.test.ts @@ -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) diff --git a/services/users/test/users.test.ts b/services/users/test/users.test.ts index dd4783a0..60540bb4 100644 --- a/services/users/test/users.test.ts +++ b/services/users/test/users.test.ts @@ -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) }) })