Skip to content

Commit

Permalink
feat(MeetingAdapter): declare addLocalMedia method
Browse files Browse the repository at this point in the history
  • Loading branch information
akoushke committed Dec 6, 2019
1 parent e67b2fd commit 2fa250e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
13 changes: 13 additions & 0 deletions src/MeetingsAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.<Meeting>}
* @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
Expand Down
11 changes: 10 additions & 1 deletion src/MeetingsAdapter.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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');
});
Expand Down

0 comments on commit 2fa250e

Please sign in to comment.