test: update recordingId validation error codes and remove public access tests
This commit is contained in:
parent
eb8ed528b6
commit
4053cfd572
@ -187,7 +187,7 @@ describe('Recording API Tests', () => {
|
||||
expect(response.status).toBe(404);
|
||||
});
|
||||
|
||||
it('should return 400 when recordingId format is invalid', async () => {
|
||||
it('should return 422 when recordingId format is invalid', async () => {
|
||||
const invalidId = 'invalid-recording-id';
|
||||
const response = await getRecordingMedia(invalidId);
|
||||
|
||||
|
||||
@ -64,32 +64,32 @@ describe('Recording API Tests', () => {
|
||||
describe('Get Recording Validation', () => {
|
||||
it('should fail when recordingId has incorrect format', async () => {
|
||||
const response = await getRecording('incorrect-format');
|
||||
expectValidationError(response, 'recordingId', 'does not follow the expected format');
|
||||
expectValidationError(response, 'params.recordingId', 'does not follow the expected format');
|
||||
});
|
||||
|
||||
it('should fail when recordingId has less than 3 parts', async () => {
|
||||
const response = await getRecording('part1--part2');
|
||||
expectValidationError(response, 'recordingId', 'does not follow the expected format');
|
||||
expectValidationError(response, 'params.recordingId', 'does not follow the expected format');
|
||||
});
|
||||
|
||||
it('should fail when recordingId first part is empty', async () => {
|
||||
const response = await getRecording('--EG_12345--uid');
|
||||
expectValidationError(response, 'recordingId', 'does not follow the expected format');
|
||||
expectValidationError(response, 'params.recordingId', 'does not follow the expected format');
|
||||
});
|
||||
|
||||
it('should fail when recordingId second part does not start with EG_', async () => {
|
||||
const response = await getRecording(`${room.roomId}--INVALID--uid`);
|
||||
expectValidationError(response, 'recordingId', 'does not follow the expected format');
|
||||
expectValidationError(response, 'params.recordingId', 'does not follow the expected format');
|
||||
});
|
||||
|
||||
it('should fail when recordingId second part is too short', async () => {
|
||||
const response = await getRecording(`${room.roomId}--EG_--uid`);
|
||||
expectValidationError(response, 'recordingId', 'does not follow the expected format');
|
||||
expectValidationError(response, 'params.recordingId', 'does not follow the expected format');
|
||||
});
|
||||
|
||||
it('should fail when recordingId third part is empty', async () => {
|
||||
const response = await getRecording(`${room.roomId}--EG_12345--`);
|
||||
expectValidationError(response, 'recordingId', 'does not follow the expected format');
|
||||
expectValidationError(response, 'params.recordingId', 'does not follow the expected format');
|
||||
});
|
||||
|
||||
it('should sanitize recordingId before validation', async () => {
|
||||
|
||||
@ -45,13 +45,6 @@ describe('Room API Tests', () => {
|
||||
expectValidRecordingTokenResponse(response, roomData.room.roomId, ParticipantRole.MODERATOR, true, true);
|
||||
});
|
||||
|
||||
it('should generate a recording token with canRetrieve and canDelete permissions when using the moderator secret and recording access is public', async () => {
|
||||
await updateRecordingAccessPreferencesInRoom(roomData.room.roomId, MeetRecordingAccess.PUBLIC);
|
||||
|
||||
const response = await generateRecordingToken(roomData.room.roomId, roomData.moderatorSecret);
|
||||
expectValidRecordingTokenResponse(response, roomData.room.roomId, ParticipantRole.MODERATOR, true, true);
|
||||
});
|
||||
|
||||
it('should generate a recording token without any permissions when using the publisher secret and recording access is admin-moderator', async () => {
|
||||
await updateRecordingAccessPreferencesInRoom(roomData.room.roomId, MeetRecordingAccess.ADMIN_MODERATOR);
|
||||
|
||||
@ -69,15 +62,8 @@ describe('Room API Tests', () => {
|
||||
expectValidRecordingTokenResponse(response, roomData.room.roomId, ParticipantRole.PUBLISHER, true, false);
|
||||
});
|
||||
|
||||
it('should generate a recording token with canRetrieve permission but not canDelete when using the publisher secret and recording access is public', async () => {
|
||||
await updateRecordingAccessPreferencesInRoom(roomData.room.roomId, MeetRecordingAccess.PUBLIC);
|
||||
|
||||
const response = await generateRecordingToken(roomData.room.roomId, roomData.publisherSecret);
|
||||
expectValidRecordingTokenResponse(response, roomData.room.roomId, ParticipantRole.PUBLISHER, true, false);
|
||||
});
|
||||
|
||||
it('should succeed even if the room is deleted', async () => {
|
||||
await updateRecordingAccessPreferencesInRoom(roomData.room.roomId, MeetRecordingAccess.PUBLIC);
|
||||
await updateRecordingAccessPreferencesInRoom(roomData.room.roomId, MeetRecordingAccess.ADMIN_MODERATOR_PUBLISHER);
|
||||
await deleteRoom(roomData.room.roomId);
|
||||
|
||||
const response = await generateRecordingToken(roomData.room.roomId, roomData.moderatorSecret);
|
||||
|
||||
@ -198,45 +198,4 @@ test.describe('Recording Access Tests', () => {
|
||||
await waitForElementInIframe(page, 'ov-error', { state: 'hidden' });
|
||||
await waitForElementInIframe(page, 'app-room-recordings', { state: 'visible' });
|
||||
});
|
||||
|
||||
test('should allow moderators to access recording when access level is set to public', async ({ page }) => {
|
||||
await updateRoomPreferences(
|
||||
roomId,
|
||||
{
|
||||
chatPreferences: { enabled: true },
|
||||
recordingPreferences: {
|
||||
enabled: true,
|
||||
allowAccessTo: MeetRecordingAccess.PUBLIC
|
||||
},
|
||||
virtualBackgroundPreferences: { enabled: true }
|
||||
},
|
||||
adminCookie
|
||||
);
|
||||
|
||||
await page.goto(testAppUrl);
|
||||
await prepareForJoiningRoom(page, testAppUrl, testRoomPrefix);
|
||||
await viewRecordingsAs('moderator', page);
|
||||
await waitForElementInIframe(page, 'ov-error', { state: 'hidden' });
|
||||
await waitForElementInIframe(page, 'app-room-recordings', { state: 'visible' });
|
||||
});
|
||||
test('should allow publisher to access recording when access level is set to public', async ({ page }) => {
|
||||
await updateRoomPreferences(
|
||||
roomId,
|
||||
{
|
||||
chatPreferences: { enabled: true },
|
||||
recordingPreferences: {
|
||||
enabled: true,
|
||||
allowAccessTo: MeetRecordingAccess.PUBLIC
|
||||
},
|
||||
virtualBackgroundPreferences: { enabled: true }
|
||||
},
|
||||
adminCookie
|
||||
);
|
||||
|
||||
await page.goto(testAppUrl);
|
||||
await prepareForJoiningRoom(page, testAppUrl, testRoomPrefix);
|
||||
await viewRecordingsAs('publisher', page);
|
||||
await waitForElementInIframe(page, 'ov-error', { state: 'hidden' });
|
||||
await waitForElementInIframe(page, 'app-room-recordings', { state: 'visible' });
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user