From f46defaecc6d05a53e36a32aaef5d1fdb470e1e4 Mon Sep 17 00:00:00 2001 From: Georg Bremer Date: Mon, 22 Jul 2024 11:36:57 +0200 Subject: [PATCH] chore: Fix test The test would close the database connection which made later calls fail. Moved it to afterAll. --- packages/server/__tests__/disableAnonymity.test.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/server/__tests__/disableAnonymity.test.ts b/packages/server/__tests__/disableAnonymity.test.ts index 1887c3357a0..2fe17015cbc 100644 --- a/packages/server/__tests__/disableAnonymity.test.ts +++ b/packages/server/__tests__/disableAnonymity.test.ts @@ -130,6 +130,10 @@ const addReflection = async (meetingId: string, promptId: string, authToken: str return reflection } +afterAll(async () => { + await closePg() +}) + test('By default all reflections are anonymous', async () => { const {userId, authToken} = await signUp() const teamId = (await getUserTeams(userId))[0].id @@ -182,7 +186,6 @@ test('Super user can always read creatorId of a reflection', async () => { const pg = getPg() await pg.query(`UPDATE "User" SET rol='su' WHERE id='${userId}'`) - await closePg() const login = await sendPublic({ query: `