From 2fa250ea7b3495750b0247c3855730aafaf0e60f Mon Sep 17 00:00:00 2001 From: Arash Koushkebaghi Date: Thu, 5 Dec 2019 16:54:34 -0800 Subject: [PATCH] feat(MeetingAdapter): declare addLocalMedia method --- src/MeetingsAdapter.js | 13 +++++++++++++ src/MeetingsAdapter.test.js | 11 ++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/MeetingsAdapter.js b/src/MeetingsAdapter.js index fa0fbf2..31d74a9 100644 --- a/src/MeetingsAdapter.js +++ b/src/MeetingsAdapter.js @@ -93,6 +93,19 @@ export default class MeetingsAdapter extends WebexAdapter { this.meetingControls = {}; } + /** + * Returns a promise that resolves once the local media has + * been successfully added. The promise will reject if there + * is an issue adding local media. + * + * @param {string} ID ID of the meeting to add the local media to. + * @returns {Promise.} + * @memberof MeetingsAdapter + */ + addLocalMedia(ID) { + return Promise.reject(new Error('addMediaLocal(ID) must be defined in MeetingsAdapter')); + } + /** * Returns an observable that emits a Meeting object. * Whenever there is an update to the meeting, the observable diff --git a/src/MeetingsAdapter.test.js b/src/MeetingsAdapter.test.js index a9548c5..40ab6ac 100644 --- a/src/MeetingsAdapter.test.js +++ b/src/MeetingsAdapter.test.js @@ -18,7 +18,7 @@ describe('Meetings Adapter Interface', () => { }); test('getMeeting() errors because it needs to be defined', (done) => { - meetingsAdapter.getMeeting('msgID').subscribe( + meetingsAdapter.getMeeting('meetingID').subscribe( () => {}, (error) => { expect(error.message).toBe('getMeeting(ID) must be defined in MeetingsAdapter'); @@ -27,6 +27,15 @@ describe('Meetings Adapter Interface', () => { ); }); + test('addLocalMedia() errors because it needs to be defined', () => { + meetingsAdapter + .addLocalMedia('meetingID') + .then(() => {}) + .catch((error) => { + expect(error.message).toBe('addMediaLocal(ID) must be defined in MeetingsAdapter'); + }); + }); + test('meetingControls property exists', () => { expect(meetingsAdapter).toHaveProperty('meetingControls'); });