From eeb49e9375f34fc1a757719ee4a659978c141e93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=A4=95=E0=A4=BE=E0=A4=B0=E0=A4=A4=E0=A5=8B=E0=A4=AB?= =?UTF-8?q?=E0=A5=8D=E0=A4=AB=E0=A5=87=E0=A4=B2=E0=A4=B8=E0=A5=8D=E0=A4=95?= =?UTF-8?q?=E0=A5=8D=E0=A4=B0=E0=A4=BF=E0=A4=AA=E0=A5=8D=E0=A4=9F=E2=84=A2?= Date: Tue, 25 Jul 2023 00:11:33 +0200 Subject: [PATCH] ci: Fix tests on postgres (no-changelog) --- .../cli/test/integration/passwordReset.api.test.ts | 2 +- .../cli/test/integration/publicApi/credentials.test.ts | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/packages/cli/test/integration/passwordReset.api.test.ts b/packages/cli/test/integration/passwordReset.api.test.ts index 61a7c891f5..5140820b30 100644 --- a/packages/cli/test/integration/passwordReset.api.test.ts +++ b/packages/cli/test/integration/passwordReset.api.test.ts @@ -157,7 +157,7 @@ describe('GET /resolve-password-token', () => { }); test('should fail if user is not found', async () => { - const token = jwtService.signData({ sub: 'test' }); + const token = jwtService.signData({ sub: uuid() }); const response = await testServer.authlessAgent .get('/resolve-password-token') diff --git a/packages/cli/test/integration/publicApi/credentials.test.ts b/packages/cli/test/integration/publicApi/credentials.test.ts index 30ea0dbf2d..aa611d0d78 100644 --- a/packages/cli/test/integration/publicApi/credentials.test.ts +++ b/packages/cli/test/integration/publicApi/credentials.test.ts @@ -82,12 +82,10 @@ describe('POST /credentials', () => { }); test('should fail with invalid inputs', async () => { - await Promise.all( - INVALID_PAYLOADS.map(async (invalidPayload) => { - const response = await authOwnerAgent.post('/credentials').send(invalidPayload); - expect(response.statusCode === 400 || response.statusCode === 415).toBe(true); - }), - ); + for (const invalidPayload of INVALID_PAYLOADS) { + const response = await authOwnerAgent.post('/credentials').send(invalidPayload); + expect(response.statusCode === 400 || response.statusCode === 415).toBe(true); + } }); test('should fail with missing encryption key', async () => {