From 849e25038e0c4648aa790b12b9138c0baf86d85f Mon Sep 17 00:00:00 2001 From: Priya Date: Thu, 2 May 2024 18:03:15 +0530 Subject: [PATCH] fix(meetings): added ut --- src/MeetingsSDKAdapter.test.js | 50 ++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/src/MeetingsSDKAdapter.test.js b/src/MeetingsSDKAdapter.test.js index 5984e52d..7367eaf6 100644 --- a/src/MeetingsSDKAdapter.test.js +++ b/src/MeetingsSDKAdapter.test.js @@ -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}"`;