Skip to content

Commit

Permalink
fix(MeetingsAdapter): update addLocalMedia() to not have a return value
Browse files Browse the repository at this point in the history
  • Loading branch information
lalli-flores authored and akoushke committed Dec 10, 2019
1 parent 44b5bc0 commit 617f17e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 19 deletions.
27 changes: 14 additions & 13 deletions src/MeetingsAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,19 +91,6 @@ 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 All @@ -116,4 +103,18 @@ export default class MeetingsAdapter extends WebexAdapter {
getMeeting(ID) {
return throwError(new Error('getMeeting(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.
* Adding local media is performed as a side-effect and this method does not
* return a value. Instead, adding local media to a meeting should trigger
* getMeeting to emit a new updated Meeting object.
*
* @param {string} ID ID of the meeting to add the local media to.
* @memberof MeetingsAdapter
*/
addLocalMedia(ID) {
throw new Error('addMediaLocal(ID) must be defined in MeetingsAdapter');
}
}
13 changes: 7 additions & 6 deletions src/MeetingsAdapter.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,14 @@ describe('Meetings Adapter Interface', () => {
});
});

test('addLocalMedia() errors because it needs to be defined', () => {
meetingsAdapter
.addLocalMedia('meetingID')
.then(() => {})
.catch((error) => {
describe('addLocalMedia()', () => {
test('errors because it needs to be defined', () => {
try {
meetingsAdapter.addLocalMedia('meetingID');
} catch (error) {
expect(error.message).toBe('addMediaLocal(ID) must be defined in MeetingsAdapter');
});
}
});
});

test('meetingControls property exists', () => {
Expand Down

0 comments on commit 617f17e

Please sign in to comment.