diff --git a/src/MeetingsAdapter.js b/src/MeetingsAdapter.js index de3a788..4de2849 100644 --- a/src/MeetingsAdapter.js +++ b/src/MeetingsAdapter.js @@ -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.} + * @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 diff --git a/src/MeetingsAdapter.test.js b/src/MeetingsAdapter.test.js index 2906cce..3f7a73e 100644 --- a/src/MeetingsAdapter.test.js +++ b/src/MeetingsAdapter.test.js @@ -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 {