Skip to content

Commit

Permalink
chore: add test for restricting call access (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
szuperaz authored Dec 11, 2023
1 parent e79f53c commit 438a6fa
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion __tests__/call-types.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ describe('call types CRUD API', () => {
VideoOwnCapability.SEND_VIDEO,
VideoOwnCapability.MUTE_USERS,
],
user: [VideoOwnCapability.SEND_AUDIO, VideoOwnCapability.SEND_VIDEO],
},
});

Expand Down Expand Up @@ -82,6 +81,33 @@ describe('call types CRUD API', () => {
expect(readResponse.call_types[callTypeName].name).toBe(callTypeName);
});

// TODO: fix backend error
// it('restrict call access', async () => {
// let callType = (await client.video.listCallTypes()).call_types[
// callTypeName
// ];
// const userGrants = callType.grants['user'].filter(
// (c) => c !== VideoOwnCapability.JOIN_CALL,
// );
// const callMemberGrants = callType.grants['call_member'];
// if (!callMemberGrants.includes(VideoOwnCapability.JOIN_CALL)) {
// callMemberGrants.push(VideoOwnCapability.JOIN_CALL);
// }

// await client.video.updateCallType(callTypeName, {
// grants: { call_member: callMemberGrants },
// });

// callType = (await client.video.listCallTypes()).call_types[callTypeName];

// expect(callType.grants.user.includes(VideoOwnCapability.JOIN_CALL)).toBe(
// false,
// );
// expect(
// callType.grants.call_member.includes(VideoOwnCapability.JOIN_CALL),
// ).toBe(true);
// });

it('update', async () => {
const updateResponse = await client.video.updateCallType(callTypeName, {
settings: {
Expand Down

0 comments on commit 438a6fa

Please sign in to comment.