From ef45f4869ccd12823434e5baeaf8b307cbbfdc0a Mon Sep 17 00:00:00 2001 From: Carlos Santos <4a.santos@gmail.com> Date: Fri, 30 May 2025 17:28:23 +0200 Subject: [PATCH] test: enhance recording tests by validating room metadata deletion and response status --- .../integration/api/recordings/delete-recording.test.ts | 1 - .../tests/integration/api/recordings/get-recordings.test.ts | 6 +++++- backend/tests/integration/webhooks/webhook.test.ts | 4 +++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/backend/tests/integration/api/recordings/delete-recording.test.ts b/backend/tests/integration/api/recordings/delete-recording.test.ts index 169c6c1..b652ad8 100644 --- a/backend/tests/integration/api/recordings/delete-recording.test.ts +++ b/backend/tests/integration/api/recordings/delete-recording.test.ts @@ -46,7 +46,6 @@ describe('Recording API Tests', () => { it('should delete room metadata when deleting the last recording', async () => { const meetStorageService = container.get(MeetStorageService); - // Create two recordings in the same room // Check that the room metadata exists after starting the first recording let roomMetadata = await meetStorageService.getArchivedRoomMetadata(room.roomId); diff --git a/backend/tests/integration/api/recordings/get-recordings.test.ts b/backend/tests/integration/api/recordings/get-recordings.test.ts index f286826..d796a0e 100644 --- a/backend/tests/integration/api/recordings/get-recordings.test.ts +++ b/backend/tests/integration/api/recordings/get-recordings.test.ts @@ -34,6 +34,10 @@ describe('Recordings API Tests', () => { describe('List Recordings Tests', () => { afterEach(async () => { await deleteAllRecordings(); + const response = await getAllRecordings(); + expect(response.status).toBe(200); + expectSuccessListRecordingResponse(response, 0, false, false); + }); afterAll(async () => { @@ -118,7 +122,7 @@ describe('Recordings API Tests', () => { const nextResponse = await getAllRecordings({ maxItems: 3, nextPageToken }); expectSuccessListRecordingResponse(nextResponse, 3, false, false, 3); - nextResponse.body.recordings.forEach((recording: MeetRecordingInfo, i: number) => { + nextResponse.body.recordings.forEach((recording: MeetRecordingInfo) => { const associatedRoom = rooms.find((r) => r.room.roomId === recording.roomId); expectValidRecording( diff --git a/backend/tests/integration/webhooks/webhook.test.ts b/backend/tests/integration/webhooks/webhook.test.ts index 53fe2b3..a4b3c86 100644 --- a/backend/tests/integration/webhooks/webhook.test.ts +++ b/backend/tests/integration/webhooks/webhook.test.ts @@ -8,7 +8,8 @@ import { deleteAllRecordings, sleep, endMeeting, - updateWebbhookPreferences + updateWebbhookPreferences, + deleteAllRooms } from '../../helpers/request-helpers.js'; import { MeetWebhookEvent, MeetWebhookEventType } from '../../../src/typings/ce/webhook.model.js'; @@ -51,6 +52,7 @@ describe('Webhook Integration Tests', () => { const defaultPreferences = await storageService['getDefaultPreferences'](); await updateWebbhookPreferences(defaultPreferences.webhooksPreferences); await deleteAllRecordings(); + await deleteAllRooms(); }); it('should not send webhooks when disabled', async () => {