tests: Remove unnecessary parameter from setupMultiRecordingsTestContext calls in recording tests
This commit is contained in:
parent
e90fac28b5
commit
d42b9b0329
@ -23,7 +23,7 @@ describe('Recording API Tests', () => {
|
|||||||
|
|
||||||
describe('Bulk Delete Recording Tests', () => {
|
describe('Bulk Delete Recording Tests', () => {
|
||||||
it('"should return 200 when mixed valid and non-existent IDs are provided', async () => {
|
it('"should return 200 when mixed valid and non-existent IDs are provided', async () => {
|
||||||
const testContext = await setupMultiRecordingsTestContext(3, 3, 3, '0s');
|
const testContext = await setupMultiRecordingsTestContext(3, 3, 3);
|
||||||
const recordingIds = testContext.rooms.map((room) => room.recordingId);
|
const recordingIds = testContext.rooms.map((room) => room.recordingId);
|
||||||
const nonExistentIds = ['nonExistent--EG_000--1234', 'nonExistent--EG_111--5678'];
|
const nonExistentIds = ['nonExistent--EG_000--1234', 'nonExistent--EG_111--5678'];
|
||||||
const mixedIds = [...recordingIds, ...nonExistentIds];
|
const mixedIds = [...recordingIds, ...nonExistentIds];
|
||||||
@ -43,7 +43,7 @@ describe('Recording API Tests', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should return 200 with mixed results when some recordings are in active state', async () => {
|
it('should return 200 with mixed results when some recordings are in active state', async () => {
|
||||||
const testContext = await setupMultiRecordingsTestContext(3, 3, 2, '0s');
|
const testContext = await setupMultiRecordingsTestContext(3, 3, 2);
|
||||||
const activeRecordingRoom = testContext.getLastRoom();
|
const activeRecordingRoom = testContext.getLastRoom();
|
||||||
const recordingIds = testContext.rooms
|
const recordingIds = testContext.rooms
|
||||||
.map((room) => room.recordingId)
|
.map((room) => room.recordingId)
|
||||||
@ -72,7 +72,7 @@ describe('Recording API Tests', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should not delete any recordings and return 200', async () => {
|
it('should not delete any recordings and return 200', async () => {
|
||||||
const testContext = await setupMultiRecordingsTestContext(2, 2, 0, '0s');
|
const testContext = await setupMultiRecordingsTestContext(2, 2, 0);
|
||||||
const recordingIds = testContext.rooms.map((room) => room.recordingId);
|
const recordingIds = testContext.rooms.map((room) => room.recordingId);
|
||||||
const deleteResponse = await bulkDeleteRecordings(recordingIds);
|
const deleteResponse = await bulkDeleteRecordings(recordingIds);
|
||||||
expect(deleteResponse.status).toBe(200);
|
expect(deleteResponse.status).toBe(200);
|
||||||
@ -94,7 +94,7 @@ describe('Recording API Tests', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should delete all recordings and return 204 when all operations succeed', async () => {
|
it('should delete all recordings and return 204 when all operations succeed', async () => {
|
||||||
const response = await setupMultiRecordingsTestContext(5, 5, 5, '0s');
|
const response = await setupMultiRecordingsTestContext(5, 5, 5);
|
||||||
const recordingIds = response.rooms.map((room) => room.recordingId);
|
const recordingIds = response.rooms.map((room) => room.recordingId);
|
||||||
const deleteResponse = await bulkDeleteRecordings(recordingIds);
|
const deleteResponse = await bulkDeleteRecordings(recordingIds);
|
||||||
|
|
||||||
@ -102,7 +102,7 @@ describe('Recording API Tests', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should handle single recording deletion correctly', async () => {
|
it('should handle single recording deletion correctly', async () => {
|
||||||
const testContext = await setupMultiRecordingsTestContext(1, 1, 1, '0s');
|
const testContext = await setupMultiRecordingsTestContext(1, 1, 1);
|
||||||
const recordingId = testContext.rooms[0].recordingId;
|
const recordingId = testContext.rooms[0].recordingId;
|
||||||
const deleteResponse = await bulkDeleteRecordings([recordingId]);
|
const deleteResponse = await bulkDeleteRecordings([recordingId]);
|
||||||
|
|
||||||
@ -111,7 +111,7 @@ describe('Recording API Tests', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should handle duplicate recording IDs by treating them as a single delete', async () => {
|
it('should handle duplicate recording IDs by treating them as a single delete', async () => {
|
||||||
const testContext = await setupMultiRecordingsTestContext(1, 1, 1, '0s');
|
const testContext = await setupMultiRecordingsTestContext(1, 1, 1);
|
||||||
const recordingId = testContext.getRoomByIndex(0)!.recordingId;
|
const recordingId = testContext.getRoomByIndex(0)!.recordingId;
|
||||||
const deleteResponse = await bulkDeleteRecordings([recordingId, recordingId]);
|
const deleteResponse = await bulkDeleteRecordings([recordingId, recordingId]);
|
||||||
|
|
||||||
@ -122,7 +122,7 @@ describe('Recording API Tests', () => {
|
|||||||
it('should delete room metadata when deleting the last recording', async () => {
|
it('should delete room metadata when deleting the last recording', async () => {
|
||||||
const meetStorageService = container.get<MeetStorageService>(MeetStorageService);
|
const meetStorageService = container.get<MeetStorageService>(MeetStorageService);
|
||||||
// Create two recordings in the same room
|
// Create two recordings in the same room
|
||||||
const testContext = await setupMultiRecordingsTestContext(1, 1, 1, '0s');
|
const testContext = await setupMultiRecordingsTestContext(1, 1, 1);
|
||||||
const { room, recordingId: firstRecordingId, moderatorCookie } = testContext.rooms[0];
|
const { room, recordingId: firstRecordingId, moderatorCookie } = testContext.rooms[0];
|
||||||
|
|
||||||
let roomMetadata = await meetStorageService.getArchivedRoomMetadata(room.roomId);
|
let roomMetadata = await meetStorageService.getArchivedRoomMetadata(room.roomId);
|
||||||
|
|||||||
@ -23,7 +23,7 @@ describe('Recording API Tests', () => {
|
|||||||
let room: MeetRoom, recordingId: string, moderatorCookie: string;
|
let room: MeetRoom, recordingId: string, moderatorCookie: string;
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
const testContext = await setupMultiRecordingsTestContext(1, 1, 1, '0s');
|
const testContext = await setupMultiRecordingsTestContext(1, 1, 1);
|
||||||
const roomData = testContext.getRoomByIndex(0)!;
|
const roomData = testContext.getRoomByIndex(0)!;
|
||||||
|
|
||||||
({ room, recordingId = '', moderatorCookie } = roomData);
|
({ room, recordingId = '', moderatorCookie } = roomData);
|
||||||
@ -85,7 +85,7 @@ describe('Recording API Tests', () => {
|
|||||||
let room: MeetRoom, recordingId: string, moderatorCookie: string;
|
let room: MeetRoom, recordingId: string, moderatorCookie: string;
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
await deleteAllRecordings();
|
await deleteAllRecordings();
|
||||||
const testContext = await setupMultiRecordingsTestContext(1, 1, 1, '0s');
|
const testContext = await setupMultiRecordingsTestContext(1, 1, 1);
|
||||||
const roomData = testContext.getRoomByIndex(0)!;
|
const roomData = testContext.getRoomByIndex(0)!;
|
||||||
|
|
||||||
({ room, recordingId = '', moderatorCookie } = roomData);
|
({ room, recordingId = '', moderatorCookie } = roomData);
|
||||||
@ -132,7 +132,7 @@ describe('Recording API Tests', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should return 409 when attempting to delete an active recording', async () => {
|
it('should return 409 when attempting to delete an active recording', async () => {
|
||||||
const testContext = await setupMultiRecordingsTestContext(1, 1, 0, '0s');
|
const testContext = await setupMultiRecordingsTestContext(1, 1, 0);
|
||||||
const { recordingId: activeRecordingId = '', moderatorCookie } = testContext.rooms[0];
|
const { recordingId: activeRecordingId = '', moderatorCookie } = testContext.rooms[0];
|
||||||
|
|
||||||
// Attempt to delete the active recording
|
// Attempt to delete the active recording
|
||||||
|
|||||||
@ -165,7 +165,7 @@ describe('Recording API Tests', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should return a 409 when the recording is in progress', async () => {
|
it('should return a 409 when the recording is in progress', async () => {
|
||||||
const testContext = await setupMultiRecordingsTestContext(1, 1, 0, '0s');
|
const testContext = await setupMultiRecordingsTestContext(1, 1, 0);
|
||||||
const { recordingId: activeRecordingId = '', moderatorCookie } = testContext.rooms[0];
|
const { recordingId: activeRecordingId = '', moderatorCookie } = testContext.rooms[0];
|
||||||
|
|
||||||
// Attempt to get the media of an active recording
|
// Attempt to get the media of an active recording
|
||||||
|
|||||||
@ -19,7 +19,7 @@ describe('Recording API Tests', () => {
|
|||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
startTestServer();
|
startTestServer();
|
||||||
// Create a room and join a participant
|
// Create a room and join a participant
|
||||||
context = await setupMultiRecordingsTestContext(1, 1, 1, '0s');
|
context = await setupMultiRecordingsTestContext(1, 1, 1);
|
||||||
({ room, moderatorCookie, recordingId = '' } = context.getRoomByIndex(0)!);
|
({ room, moderatorCookie, recordingId = '' } = context.getRoomByIndex(0)!);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -39,7 +39,7 @@ describe('Recording API Tests', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should get an ACTIVE recording status', async () => {
|
it('should get an ACTIVE recording status', async () => {
|
||||||
const contextAux = await setupMultiRecordingsTestContext(1, 1, 0, '0s');
|
const contextAux = await setupMultiRecordingsTestContext(1, 1, 0);
|
||||||
const {
|
const {
|
||||||
room: roomAux,
|
room: roomAux,
|
||||||
recordingId: recordingIdAux = '',
|
recordingId: recordingIdAux = '',
|
||||||
|
|||||||
@ -42,14 +42,14 @@ describe('Recordings API Tests', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should return a list of recordings', async () => {
|
it('should return a list of recordings', async () => {
|
||||||
context = await setupMultiRecordingsTestContext(1, 1, 1, '0s');
|
context = await setupMultiRecordingsTestContext(1, 1, 1);
|
||||||
({ room } = context.getRoomByIndex(0)!);
|
({ room } = context.getRoomByIndex(0)!);
|
||||||
const response = await getAllRecordings();
|
const response = await getAllRecordings();
|
||||||
expectSuccessListRecordingResponse(response, 1, false, false);
|
expectSuccessListRecordingResponse(response, 1, false, false);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should filter recordings by roomId', async () => {
|
it('should filter recordings by roomId', async () => {
|
||||||
context = await setupMultiRecordingsTestContext(2, 2, 2, '0s');
|
context = await setupMultiRecordingsTestContext(2, 2, 2);
|
||||||
({ room } = context.getRoomByIndex(0)!);
|
({ room } = context.getRoomByIndex(0)!);
|
||||||
const response = await getAllRecordings({ roomId: room.roomId });
|
const response = await getAllRecordings({ roomId: room.roomId });
|
||||||
expectSuccessListRecordingResponse(response, 1, false, false);
|
expectSuccessListRecordingResponse(response, 1, false, false);
|
||||||
@ -57,7 +57,7 @@ describe('Recordings API Tests', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should return recordings with fields filter applied', async () => {
|
it('should return recordings with fields filter applied', async () => {
|
||||||
context = await setupMultiRecordingsTestContext(2, 2, 2, '0s');
|
context = await setupMultiRecordingsTestContext(2, 2, 2);
|
||||||
({ room } = context.getRoomByIndex(0)!);
|
({ room } = context.getRoomByIndex(0)!);
|
||||||
const response = await getAllRecordings({ fields: 'roomId,recordingId' });
|
const response = await getAllRecordings({ fields: 'roomId,recordingId' });
|
||||||
expectSuccessListRecordingResponse(response, 2, false, false);
|
expectSuccessListRecordingResponse(response, 2, false, false);
|
||||||
@ -75,7 +75,7 @@ describe('Recordings API Tests', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should return recordings with pagination', async () => {
|
it('should return recordings with pagination', async () => {
|
||||||
context = await setupMultiRecordingsTestContext(6, 6, 6, '0s');
|
context = await setupMultiRecordingsTestContext(6, 6, 6);
|
||||||
const rooms = context.rooms;
|
const rooms = context.rooms;
|
||||||
const response = await getAllRecordings({ maxItems: 3 });
|
const response = await getAllRecordings({ maxItems: 3 });
|
||||||
expectSuccessListRecordingResponse(response, 3, true, true, 3);
|
expectSuccessListRecordingResponse(response, 3, true, true, 3);
|
||||||
@ -103,13 +103,13 @@ describe('Recordings API Tests', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should cap maxItems to the maximum allowed (100)', async () => {
|
it('should cap maxItems to the maximum allowed (100)', async () => {
|
||||||
context = await setupMultiRecordingsTestContext(1, 1, 1, '0s');
|
context = await setupMultiRecordingsTestContext(1, 1, 1);
|
||||||
const response = await getAllRecordings({ maxItems: 101 });
|
const response = await getAllRecordings({ maxItems: 101 });
|
||||||
expectSuccessListRecordingResponse(response, 1, false, false, 100);
|
expectSuccessListRecordingResponse(response, 1, false, false, 100);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should coerce a floating point number to integer for maxItems', async () => {
|
it('should coerce a floating point number to integer for maxItems', async () => {
|
||||||
context = await setupMultiRecordingsTestContext(1, 1, 1, '0s');
|
context = await setupMultiRecordingsTestContext(1, 1, 1);
|
||||||
const response = await getAllRecordings({ maxItems: 3.5 });
|
const response = await getAllRecordings({ maxItems: 3.5 });
|
||||||
expectSuccessListRecordingResponse(response, 1, false, false, 3);
|
expectSuccessListRecordingResponse(response, 1, false, false, 3);
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user