From b98d4d0cd94a7986c80072cd556b425783aa1f6d Mon Sep 17 00:00:00 2001 From: Carlos Santos <4a.santos@gmail.com> Date: Tue, 29 Apr 2025 13:48:45 +0200 Subject: [PATCH] tests: Renamed utils directory to helpers --- backend/tests/{utils => helpers}/assertion-helpers.ts | 0 backend/tests/{utils => helpers}/event-controller.ts | 0 .../tests/{utils/helpers.ts => helpers/request-helpers.ts} | 0 backend/tests/{utils => helpers}/test-scenarios.ts | 2 +- .../api/recordings/bulk-delete-recording.test.ts | 6 +++--- .../integration/api/recordings/delete-recording.test.ts | 6 +++--- .../integration/api/recordings/get-media-recording.test.ts | 6 +++--- .../tests/integration/api/recordings/get-recording.test.ts | 6 +++--- .../tests/integration/api/recordings/get-recordings.test.ts | 6 +++--- .../integration/api/recordings/start-recording.test.ts | 6 +++--- .../tests/integration/api/recordings/stop-recording.test.ts | 6 +++--- .../tests/integration/api/rooms/bulk-delete-rooms.test.ts | 2 +- backend/tests/integration/api/rooms/create-room.test.ts | 4 ++-- backend/tests/integration/api/rooms/delete-room.test.ts | 4 ++-- .../tests/integration/api/rooms/garbage-collector.test.ts | 2 +- backend/tests/integration/api/rooms/get-room.test.ts | 4 ++-- backend/tests/integration/api/rooms/get-rooms.test.ts | 4 ++-- backend/tests/integration/api/rooms/update-room.test.ts | 2 +- backend/tests/integration/api/security/auth.test.ts | 2 +- .../tests/integration/api/security/meeting-security.test.ts | 2 +- .../integration/api/security/participant-security.test.ts | 2 +- .../integration/api/security/recording-security.test.ts | 2 +- .../tests/integration/api/security/room-security.test.ts | 2 +- 23 files changed, 38 insertions(+), 38 deletions(-) rename backend/tests/{utils => helpers}/assertion-helpers.ts (100%) rename backend/tests/{utils => helpers}/event-controller.ts (100%) rename backend/tests/{utils/helpers.ts => helpers/request-helpers.ts} (100%) rename backend/tests/{utils => helpers}/test-scenarios.ts (99%) diff --git a/backend/tests/utils/assertion-helpers.ts b/backend/tests/helpers/assertion-helpers.ts similarity index 100% rename from backend/tests/utils/assertion-helpers.ts rename to backend/tests/helpers/assertion-helpers.ts diff --git a/backend/tests/utils/event-controller.ts b/backend/tests/helpers/event-controller.ts similarity index 100% rename from backend/tests/utils/event-controller.ts rename to backend/tests/helpers/event-controller.ts diff --git a/backend/tests/utils/helpers.ts b/backend/tests/helpers/request-helpers.ts similarity index 100% rename from backend/tests/utils/helpers.ts rename to backend/tests/helpers/request-helpers.ts diff --git a/backend/tests/utils/test-scenarios.ts b/backend/tests/helpers/test-scenarios.ts similarity index 99% rename from backend/tests/utils/test-scenarios.ts rename to backend/tests/helpers/test-scenarios.ts index a39d8bde..786b7cf0 100644 --- a/backend/tests/utils/test-scenarios.ts +++ b/backend/tests/helpers/test-scenarios.ts @@ -7,7 +7,7 @@ import { sleep, startRecording, stopRecording -} from './helpers'; +} from './request-helpers'; import ms, { StringValue } from 'ms'; import { MeetRoom, UserRole } from '../../src/typings/ce'; diff --git a/backend/tests/integration/api/recordings/bulk-delete-recording.test.ts b/backend/tests/integration/api/recordings/bulk-delete-recording.test.ts index ff8bd550..472ee9ee 100644 --- a/backend/tests/integration/api/recordings/bulk-delete-recording.test.ts +++ b/backend/tests/integration/api/recordings/bulk-delete-recording.test.ts @@ -1,7 +1,7 @@ import { afterAll, beforeAll, describe, expect, it } from '@jest/globals'; import { container } from '../../../../src/config'; import { MeetStorageService } from '../../../../src/services'; -import { expectValidationError, expectValidStartRecordingResponse } from '../../../utils/assertion-helpers'; +import { expectValidationError, expectValidStartRecordingResponse } from '../../../helpers/assertion-helpers'; import { bulkDeleteRecordings, deleteAllRecordings, @@ -9,8 +9,8 @@ import { startRecording, startTestServer, stopRecording -} from '../../../utils/helpers'; -import { setupMultiRecordingsTestContext } from '../../../utils/test-scenarios'; +} from '../../../helpers/request-helpers'; +import { setupMultiRecordingsTestContext } from '../../../helpers/test-scenarios'; describe('Recording API Tests', () => { beforeAll(() => { diff --git a/backend/tests/integration/api/recordings/delete-recording.test.ts b/backend/tests/integration/api/recordings/delete-recording.test.ts index 879db8d2..9c719bb1 100644 --- a/backend/tests/integration/api/recordings/delete-recording.test.ts +++ b/backend/tests/integration/api/recordings/delete-recording.test.ts @@ -1,7 +1,7 @@ import { afterAll, beforeAll, beforeEach, describe, expect, it } from '@jest/globals'; import { container } from '../../../../src/config'; import { MeetStorageService } from '../../../../src/services'; -import { expectValidationError, expectValidStartRecordingResponse } from '../../../utils/assertion-helpers'; +import { expectValidationError, expectValidStartRecordingResponse } from '../../../helpers/assertion-helpers'; import { deleteAllRecordings, deleteAllRooms, @@ -10,8 +10,8 @@ import { startTestServer, stopAllRecordings, stopRecording -} from '../../../utils/helpers'; -import { setupMultiRecordingsTestContext } from '../../../utils/test-scenarios'; +} from '../../../helpers/request-helpers'; +import { setupMultiRecordingsTestContext } from '../../../helpers/test-scenarios'; import { MeetRoom } from '../../../../src/typings/ce'; describe('Recording API Tests', () => { diff --git a/backend/tests/integration/api/recordings/get-media-recording.test.ts b/backend/tests/integration/api/recordings/get-media-recording.test.ts index 7f856e8c..03027096 100644 --- a/backend/tests/integration/api/recordings/get-media-recording.test.ts +++ b/backend/tests/integration/api/recordings/get-media-recording.test.ts @@ -1,5 +1,5 @@ import { afterAll, beforeAll, describe, expect, it } from '@jest/globals'; -import { expectSuccessRecordingMediaResponse, expectValidationError } from '../../../utils/assertion-helpers'; +import { expectSuccessRecordingMediaResponse, expectValidationError } from '../../../helpers/assertion-helpers'; import { deleteAllRecordings, deleteAllRooms, @@ -7,8 +7,8 @@ import { startTestServer, stopAllRecordings, stopRecording -} from '../../../utils/helpers'; -import { setupMultiRecordingsTestContext } from '../../../utils/test-scenarios'; +} from '../../../helpers/request-helpers'; +import { setupMultiRecordingsTestContext } from '../../../helpers/test-scenarios'; import { MeetRoom } from '../../../../src/typings/ce'; describe('Recording API Tests', () => { diff --git a/backend/tests/integration/api/recordings/get-recording.test.ts b/backend/tests/integration/api/recordings/get-recording.test.ts index 35a86901..34cafd47 100644 --- a/backend/tests/integration/api/recordings/get-recording.test.ts +++ b/backend/tests/integration/api/recordings/get-recording.test.ts @@ -6,13 +6,13 @@ import { getRecording, startTestServer, stopAllRecordings -} from '../../../utils/helpers.js'; +} from '../../../helpers/request-helpers.js'; import { errorRecordingNotFound } from '../../../../src/models/error.model.js'; import { MeetRecordingStatus } from '../../../../src/typings/ce/recording.model.js'; import { MeetRoom } from '../../../../src/typings/ce/room.js'; -import { expectValidationError, expectValidGetRecordingResponse } from '../../../utils/assertion-helpers.js'; -import { setupMultiRecordingsTestContext, TestContext } from '../../../utils/test-scenarios.js'; +import { expectValidationError, expectValidGetRecordingResponse } from '../../../helpers/assertion-helpers.js'; +import { setupMultiRecordingsTestContext, TestContext } from '../../../helpers/test-scenarios.js'; describe('Recording API Tests', () => { let context: TestContext | null = null; diff --git a/backend/tests/integration/api/recordings/get-recordings.test.ts b/backend/tests/integration/api/recordings/get-recordings.test.ts index 61de976f..8be44b8a 100644 --- a/backend/tests/integration/api/recordings/get-recordings.test.ts +++ b/backend/tests/integration/api/recordings/get-recordings.test.ts @@ -5,15 +5,15 @@ import { disconnectFakeParticipants, getAllRecordings, startTestServer -} from '../../../utils/helpers.js'; +} from '../../../helpers/request-helpers.js'; import { expectValidationError, expectSuccessListRecordingResponse, expectValidRecordingWithFields, expectValidRecording -} from '../../../utils/assertion-helpers.js'; -import { RoomData, setupMultiRecordingsTestContext, TestContext } from '../../../utils/test-scenarios.js'; +} from '../../../helpers/assertion-helpers.js'; +import { RoomData, setupMultiRecordingsTestContext, TestContext } from '../../../helpers/test-scenarios.js'; import { MeetRoom } from '../../../../src/typings/ce/room.js'; import { MeetRecordingInfo, MeetRecordingStatus } from '../../../../src/typings/ce/recording.model.js'; diff --git a/backend/tests/integration/api/recordings/start-recording.test.ts b/backend/tests/integration/api/recordings/start-recording.test.ts index 4e9ea628..b0117db7 100644 --- a/backend/tests/integration/api/recordings/start-recording.test.ts +++ b/backend/tests/integration/api/recordings/start-recording.test.ts @@ -9,7 +9,7 @@ import { startTestServer, stopAllRecordings, stopRecording -} from '../../../utils/helpers.js'; +} from '../../../helpers/request-helpers.js'; import { errorRoomNotFound } from '../../../../src/models/error.model.js'; import { MeetRoom } from '../../../../src/typings/ce/room.js'; @@ -18,8 +18,8 @@ import { expectValidRecordingLocationHeader, expectValidStartRecordingResponse, expectValidStopRecordingResponse -} from '../../../utils/assertion-helpers.js'; -import { setupMultiRoomTestContext, TestContext } from '../../../utils/test-scenarios.js'; +} from '../../../helpers/assertion-helpers.js'; +import { setupMultiRoomTestContext, TestContext } from '../../../helpers/test-scenarios.js'; describe('Recording API Tests', () => { let context: TestContext | null = null; diff --git a/backend/tests/integration/api/recordings/stop-recording.test.ts b/backend/tests/integration/api/recordings/stop-recording.test.ts index 34766167..05576b8a 100644 --- a/backend/tests/integration/api/recordings/stop-recording.test.ts +++ b/backend/tests/integration/api/recordings/stop-recording.test.ts @@ -1,5 +1,5 @@ import { describe, it, expect, beforeAll, afterAll } from '@jest/globals'; -import { expectValidStopRecordingResponse, expectErrorResponse } from '../../../utils/assertion-helpers'; +import { expectValidStopRecordingResponse, expectErrorResponse } from '../../../helpers/assertion-helpers'; import { startRecording, disconnectFakeParticipants, @@ -8,9 +8,9 @@ import { deleteAllRecordings, deleteAllRooms, startTestServer -} from '../../../utils/helpers'; +} from '../../../helpers/request-helpers'; import { MeetRoom } from '../../../../src/typings/ce'; -import { setupMultiRoomTestContext, TestContext } from '../../../utils/test-scenarios'; +import { setupMultiRoomTestContext, TestContext } from '../../../helpers/test-scenarios'; describe('Recording API Tests', () => { let context: TestContext | null = null; diff --git a/backend/tests/integration/api/rooms/bulk-delete-rooms.test.ts b/backend/tests/integration/api/rooms/bulk-delete-rooms.test.ts index 234e6789..fda77022 100644 --- a/backend/tests/integration/api/rooms/bulk-delete-rooms.test.ts +++ b/backend/tests/integration/api/rooms/bulk-delete-rooms.test.ts @@ -7,7 +7,7 @@ import { getRoom, joinFakeParticipant, startTestServer -} from '../../../utils/helpers.js'; +} from '../../../helpers/request-helpers.js'; describe('Room API Tests', () => { beforeAll(() => { diff --git a/backend/tests/integration/api/rooms/create-room.test.ts b/backend/tests/integration/api/rooms/create-room.test.ts index 5af4e865..7f982e28 100644 --- a/backend/tests/integration/api/rooms/create-room.test.ts +++ b/backend/tests/integration/api/rooms/create-room.test.ts @@ -4,8 +4,8 @@ import ms from 'ms'; import request from 'supertest'; import INTERNAL_CONFIG from '../../../../src/config/internal-config.js'; import { MeetRecordingAccess, UserRole } from '../../../../src/typings/ce/index.js'; -import { expectValidRoom } from '../../../utils/assertion-helpers.js'; -import { createRoom, deleteAllRooms, loginUserAsRole, startTestServer } from '../../../utils/helpers.js'; +import { expectValidRoom } from '../../../helpers/assertion-helpers.js'; +import { createRoom, deleteAllRooms, loginUserAsRole, startTestServer } from '../../../helpers/request-helpers.js'; const ROOMS_PATH = `${INTERNAL_CONFIG.API_BASE_PATH_V1}/rooms`; diff --git a/backend/tests/integration/api/rooms/delete-room.test.ts b/backend/tests/integration/api/rooms/delete-room.test.ts index 8df2b1a6..297ba244 100644 --- a/backend/tests/integration/api/rooms/delete-room.test.ts +++ b/backend/tests/integration/api/rooms/delete-room.test.ts @@ -1,6 +1,6 @@ import { afterEach, beforeAll, describe, expect, it } from '@jest/globals'; import ms from 'ms'; -import { expectValidRoom } from '../../../utils/assertion-helpers.js'; +import { expectValidRoom } from '../../../helpers/assertion-helpers.js'; import { createRoom, deleteAllRooms, @@ -10,7 +10,7 @@ import { joinFakeParticipant, sleep, startTestServer -} from '../../../utils/helpers.js'; +} from '../../../helpers/request-helpers.js'; describe('Room API Tests', () => { beforeAll(() => { diff --git a/backend/tests/integration/api/rooms/garbage-collector.test.ts b/backend/tests/integration/api/rooms/garbage-collector.test.ts index cc6b17a0..c760aaab 100644 --- a/backend/tests/integration/api/rooms/garbage-collector.test.ts +++ b/backend/tests/integration/api/rooms/garbage-collector.test.ts @@ -11,7 +11,7 @@ import { runRoomGarbageCollector, sleep, startTestServer -} from '../../../utils/helpers.js'; +} from '../../../helpers/request-helpers.js'; describe('Room Garbage Collector Tests', () => { beforeAll(() => { diff --git a/backend/tests/integration/api/rooms/get-room.test.ts b/backend/tests/integration/api/rooms/get-room.test.ts index 0e8ba6f6..5da48658 100644 --- a/backend/tests/integration/api/rooms/get-room.test.ts +++ b/backend/tests/integration/api/rooms/get-room.test.ts @@ -6,8 +6,8 @@ import { expectValidationError, expectValidRoom, expectValidRoomWithFields -} from '../../../utils/assertion-helpers.js'; -import { createRoom, deleteAllRooms, getRoom, startTestServer } from '../../../utils/helpers.js'; +} from '../../../helpers/assertion-helpers.js'; +import { createRoom, deleteAllRooms, getRoom, startTestServer } from '../../../helpers/request-helpers.js'; describe('Room API Tests', () => { beforeAll(() => { diff --git a/backend/tests/integration/api/rooms/get-rooms.test.ts b/backend/tests/integration/api/rooms/get-rooms.test.ts index d37148de..142a69f2 100644 --- a/backend/tests/integration/api/rooms/get-rooms.test.ts +++ b/backend/tests/integration/api/rooms/get-rooms.test.ts @@ -6,8 +6,8 @@ import { expectValidationError, expectValidRoom, expectValidRoomWithFields -} from '../../../utils/assertion-helpers.js'; -import { createRoom, deleteAllRooms, getRooms, startTestServer } from '../../../utils/helpers.js'; +} from '../../../helpers/assertion-helpers.js'; +import { createRoom, deleteAllRooms, getRooms, startTestServer } from '../../../helpers/request-helpers.js'; describe('Room API Tests', () => { const validAutoDeletionDate = Date.now() + ms('2h'); diff --git a/backend/tests/integration/api/rooms/update-room.test.ts b/backend/tests/integration/api/rooms/update-room.test.ts index 1782edd1..b2701fc5 100644 --- a/backend/tests/integration/api/rooms/update-room.test.ts +++ b/backend/tests/integration/api/rooms/update-room.test.ts @@ -1,6 +1,6 @@ import { afterEach, beforeAll, describe, expect, it } from '@jest/globals'; import { MeetRecordingAccess } from '../../../../src/typings/ce/index.js'; -import { createRoom, deleteAllRooms, getRoom, startTestServer, updateRoomPreferences } from '../../../utils/helpers.js'; +import { createRoom, deleteAllRooms, getRoom, startTestServer, updateRoomPreferences } from '../../../helpers/request-helpers.js'; describe('Room API Tests', () => { beforeAll(() => { diff --git a/backend/tests/integration/api/security/auth.test.ts b/backend/tests/integration/api/security/auth.test.ts index ef9442ec..ed911895 100644 --- a/backend/tests/integration/api/security/auth.test.ts +++ b/backend/tests/integration/api/security/auth.test.ts @@ -3,7 +3,7 @@ import { Express } from 'express'; import request from 'supertest'; import INTERNAL_CONFIG from '../../../../src/config/internal-config.js'; import { UserRole } from '../../../../src/typings/ce/index.js'; -import { loginUserAsRole, startTestServer } from '../../../utils/helpers.js'; +import { loginUserAsRole, startTestServer } from '../../../helpers/request-helpers.js'; const AUTH_PATH = `${INTERNAL_CONFIG.INTERNAL_API_BASE_PATH_V1}/auth`; diff --git a/backend/tests/integration/api/security/meeting-security.test.ts b/backend/tests/integration/api/security/meeting-security.test.ts index 4f0c7783..ce132d7d 100644 --- a/backend/tests/integration/api/security/meeting-security.test.ts +++ b/backend/tests/integration/api/security/meeting-security.test.ts @@ -10,7 +10,7 @@ import { generateParticipantToken, loginUserAsRole, startTestServer -} from '../../../utils/helpers.js'; +} from '../../../helpers/request-helpers.js'; const MEETINGS_PATH = `${INTERNAL_CONFIG.INTERNAL_API_BASE_PATH_V1}/meetings`; diff --git a/backend/tests/integration/api/security/participant-security.test.ts b/backend/tests/integration/api/security/participant-security.test.ts index 6b3a84c7..5b654d8f 100644 --- a/backend/tests/integration/api/security/participant-security.test.ts +++ b/backend/tests/integration/api/security/participant-security.test.ts @@ -10,7 +10,7 @@ import { deleteAllRooms, loginUserAsRole, startTestServer -} from '../../../utils/helpers.js'; +} from '../../../helpers/request-helpers.js'; const PARTICIPANTS_PATH = `${INTERNAL_CONFIG.INTERNAL_API_BASE_PATH_V1}/participants`; diff --git a/backend/tests/integration/api/security/recording-security.test.ts b/backend/tests/integration/api/security/recording-security.test.ts index 3e37e128..7a6c414e 100644 --- a/backend/tests/integration/api/security/recording-security.test.ts +++ b/backend/tests/integration/api/security/recording-security.test.ts @@ -11,7 +11,7 @@ import { generateParticipantToken, loginUserAsRole, startTestServer -} from '../../../utils/helpers.js'; +} from '../../../helpers/request-helpers.js'; const RECORDINGS_PATH = `${INTERNAL_CONFIG.API_BASE_PATH_V1}/recordings`; const INTERNAL_RECORDINGS_PATH = `${INTERNAL_CONFIG.INTERNAL_API_BASE_PATH_V1}/recordings`; diff --git a/backend/tests/integration/api/security/room-security.test.ts b/backend/tests/integration/api/security/room-security.test.ts index 129f6431..dd211aea 100644 --- a/backend/tests/integration/api/security/room-security.test.ts +++ b/backend/tests/integration/api/security/room-security.test.ts @@ -12,7 +12,7 @@ import { generateParticipantToken, loginUserAsRole, startTestServer -} from '../../../utils/helpers.js'; +} from '../../../helpers/request-helpers.js'; const ROOMS_PATH = `${INTERNAL_CONFIG.API_BASE_PATH_V1}/rooms`; const INTERNAL_ROOMS_PATH = `${INTERNAL_CONFIG.INTERNAL_API_BASE_PATH_V1}/rooms`;