From 4585ff946bc89fb277ad038d69a859a9500ebb4a Mon Sep 17 00:00:00 2001 From: Arash Koushkebaghi Date: Mon, 13 Jan 2020 15:16:53 -0700 Subject: [PATCH] feat(MeetingsAdapter): add leaveMeeting() definition --- src/MeetingsAdapter.js | 13 +++++++++++++ src/MeetingsAdapter.test.js | 10 ++++++++++ 2 files changed, 23 insertions(+) diff --git a/src/MeetingsAdapter.js b/src/MeetingsAdapter.js index 40cd14f..fa6ccf7 100644 --- a/src/MeetingsAdapter.js +++ b/src/MeetingsAdapter.js @@ -131,6 +131,19 @@ export default class MeetingsAdapter extends WebexAdapter { throw new Error('joinMeeting(ID) must be defined in MeetingsAdapter'); } + /** + * Leaves from the meeting of the given ID. + * Leaving from a meeting is performed as a side-effect and this method does not + * return a value. Instead, leaving from a meeting should trigger getMeeting to + * emit a new updated Meeting object. + * + * @param {string} ID ID of the meeting to leave from. + * @memberof MeetingsAdapter + */ + leaveMeeting(ID) { + throw new Error('leaveMeeting(ID) must be defined in MeetingsAdapter'); + } + /** * Retrieves the local device media (video/audio) and adds them to the meeting * with the some default media settings. diff --git a/src/MeetingsAdapter.test.js b/src/MeetingsAdapter.test.js index 9ec6fb5..f9ee432 100644 --- a/src/MeetingsAdapter.test.js +++ b/src/MeetingsAdapter.test.js @@ -55,6 +55,16 @@ describe('Meetings Adapter Interface', () => { }); }); + describe('leaveMeeting()', () => { + test('errors because it needs to be defined', () => { + try { + meetingsAdapter.leaveMeeting('meetingID'); + } catch (error) { + expect(error.message).toBe('leaveMeeting(ID) must be defined in MeetingsAdapter'); + } + }); + }); + describe('addLocalMedia()', () => { test('errors because it needs to be defined', () => { try {