From 439f832dd9e66f1330d08e7eb4bd1019168194c9 Mon Sep 17 00:00:00 2001 From: juancarmore Date: Sat, 12 Apr 2025 14:17:42 +0200 Subject: [PATCH] tests: Add room roles and permissions tests --- .../api/security/room-security.test.ts | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/backend/tests/integration/api/security/room-security.test.ts b/backend/tests/integration/api/security/room-security.test.ts index 65eb760..1472c00 100644 --- a/backend/tests/integration/api/security/room-security.test.ts +++ b/backend/tests/integration/api/security/room-security.test.ts @@ -334,7 +334,21 @@ describe('Room API Security Tests', () => { }); }); - describe('Get Participant Role Tests', () => { + describe('Get Room Roles and Permissions Tests', () => { + let roomId: string; + + beforeAll(async () => { + const room = await createRoom(); + roomId = room.roomId; + }); + + it('should succeed if user is not authenticated', async () => { + const response = await request(app).get(`${INTERNAL_ROOMS_PATH}/${roomId}/roles`); + expect(response.status).toBe(200); + }); + }); + + describe('Get Room Role and Permissions Tests', () => { let roomId: string; let moderatorSecret: string; @@ -347,9 +361,7 @@ describe('Room API Security Tests', () => { }); it('should succeed if user is not authenticated', async () => { - const response = await request(app).get(`${INTERNAL_ROOMS_PATH}/${roomId}/participant-role`).query({ - secret: moderatorSecret - }); + const response = await request(app).get(`${INTERNAL_ROOMS_PATH}/${roomId}/roles/${moderatorSecret}`); expect(response.status).toBe(200); }); });