Skip to content

Commit

Permalink
feat(MeetingsAdapter): add leaveMeeting() definition
Browse files Browse the repository at this point in the history
  • Loading branch information
akoushke committed Jan 15, 2020
1 parent 747c11b commit 4585ff9
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/MeetingsAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
10 changes: 10 additions & 0 deletions src/MeetingsAdapter.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 4585ff9

Please sign in to comment.