test: update room member token response tests to use participant identity prefix
This commit is contained in:
parent
6b3ef47f08
commit
99283ab63d
@ -570,7 +570,7 @@ export const expectValidRoomMemberTokenResponse = (
|
||||
role: MeetRoomMemberRole,
|
||||
addJoinPermission = false,
|
||||
participantName?: string,
|
||||
participantIdentity?: string,
|
||||
participantIdentityPrefix?: string,
|
||||
canRetrieveRecordings?: boolean,
|
||||
canDeleteRecordings?: boolean
|
||||
) => {
|
||||
@ -589,10 +589,8 @@ export const expectValidRoomMemberTokenResponse = (
|
||||
expect(decodedToken).toHaveProperty('name', participantName);
|
||||
expect(decodedToken).toHaveProperty('sub');
|
||||
|
||||
if (participantIdentity) {
|
||||
expect(decodedToken.sub).toBe(participantIdentity);
|
||||
} else {
|
||||
expect(decodedToken.sub).toBe(participantName);
|
||||
if (participantIdentityPrefix) {
|
||||
expect(decodedToken.sub?.startsWith(participantIdentityPrefix)).toBe(true);
|
||||
}
|
||||
} else {
|
||||
expect(decodedToken).not.toHaveProperty('name');
|
||||
|
||||
@ -61,7 +61,14 @@ describe('Room API Tests', () => {
|
||||
grantJoinMeetingPermission: true,
|
||||
participantName
|
||||
});
|
||||
expectValidRoomMemberTokenResponse(response, roomId, MeetRoomMemberRole.MODERATOR, true, participantName);
|
||||
expectValidRoomMemberTokenResponse(
|
||||
response,
|
||||
roomId,
|
||||
MeetRoomMemberRole.MODERATOR,
|
||||
true,
|
||||
participantName,
|
||||
'test_participant'
|
||||
);
|
||||
|
||||
// End the meeting for further tests
|
||||
await endMeeting(roomId, roomData.moderatorToken);
|
||||
@ -76,7 +83,14 @@ describe('Room API Tests', () => {
|
||||
grantJoinMeetingPermission: true,
|
||||
participantName
|
||||
});
|
||||
expectValidRoomMemberTokenResponse(response, roomId, MeetRoomMemberRole.MODERATOR, true, participantName);
|
||||
expectValidRoomMemberTokenResponse(
|
||||
response,
|
||||
roomId,
|
||||
MeetRoomMemberRole.MODERATOR,
|
||||
true,
|
||||
participantName,
|
||||
'test_participant'
|
||||
);
|
||||
|
||||
// Create token for the second participant with the same name
|
||||
response = await generateRoomMemberTokenRequest(roomId, {
|
||||
@ -89,7 +103,8 @@ describe('Room API Tests', () => {
|
||||
roomId,
|
||||
MeetRoomMemberRole.MODERATOR,
|
||||
true,
|
||||
participantName + '_1' // Participant name should be unique
|
||||
participantName + '_1', // Participant name should be unique
|
||||
'test_participant_1'
|
||||
);
|
||||
|
||||
// End the meeting for further tests
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user