Skip to content

Commit

Permalink
feat(MeetingsAdapter): add createMeeting() definition
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 617f17e commit d83df0e
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/MeetingsAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,20 @@ export default class MeetingsAdapter extends WebexAdapter {
this.meetingControls = {};
}

/**
* Creates a meeting for the given destination. Returns an observable
* that emits a Meeting object with the data from the newly created meeting.
* Observable should complete after emitting data.
* If there is an issue creating the meeting, the observable will error.
*
* @param {string} destination Virtual location where the meeting should take place
* @returns {Observable.<Meeting>}
* @memberof MeetingsAdapter
*/
createMeeting(destination) {
return throwError(new Error('createMeeting(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
16 changes: 16 additions & 0 deletions src/MeetingsAdapter.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,22 @@ describe('Meetings Adapter Interface', () => {
});
});

describe('createMeeting()', () => {
test('returns an observable', () => {
expect(isObservable(meetingsAdapter.createMeeting())).toBeTruthy();
});

test('errors because it needs to be defined', (done) => {
meetingsAdapter.createMeeting('sipURI@webex.com').subscribe(
() => {},
(error) => {
expect(error.message).toBe('createMeeting(ID) must be defined in MeetingsAdapter');
done();
}
);
});
});

describe('addLocalMedia()', () => {
test('errors because it needs to be defined', () => {
try {
Expand Down

0 comments on commit d83df0e

Please sign in to comment.