Skip to content

Commit

Permalink
fix(meetings): added ut
Browse files Browse the repository at this point in the history
  • Loading branch information
Kesari3008 committed May 6, 2024
1 parent fabcc45 commit 849e250
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions src/MeetingsSDKAdapter.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,56 @@ describe('Meetings SDK Adapter', () => {
});
});

it('returns a new meeting in a proper shape with no passwordStatus', (done) => {
meetingsSDKAdapter.fetchMeetingTitle = jest.fn(() => Promise.resolve('my meeting'));
meetingsSDKAdapter.getLocalMedia = jest.fn(() => rxjs.of({
localAudio: {
stream: mockSDKMediaStreams.localAudio,
permission: 'ALLOWED',
},
localVideo: {
stream: mockSDKMediaStreams.localVideo,
permission: 'ALLOWED',
},
}));

mockSDKMeeting.passwordStatus = 'NOT_REQUIRED';

meetingsSDKAdapter.createMeeting(target).pipe(last()).subscribe((newMeeting) => {
expect(newMeeting).toMatchObject({
title: 'my meeting',
localAudio: {
stream: mockSDKMediaStreams.localAudio,
permission: 'ALLOWED',
},
localVideo: {
stream: mockSDKMediaStreams.localVideo,
permission: 'ALLOWED',
},
localShare: {
stream: null,
},
passwordRequired: false,
remoteAudio: null,
remoteVideo: null,
remoteShare: null,
showRoster: null,
settings: {
visible: false,
preview: {
audio: null,
video: null,
},
},
state: 'NOT_JOINED',
cameraID: null,
microphoneID: null,
speakerID: '',
});
done();
});
});

it('throws error on failed meeting push request', (done) => {
const wrongTarget = 'wrongTarget';
const errorMessage = `Unable to create a meeting "${wrongTarget}"`;
Expand Down

0 comments on commit 849e250

Please sign in to comment.