@webex/plugin-meetings 1.151.3 → 1.151.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,7 +9,8 @@ import Device from '@webex/internal-plugin-device';
9
9
  import Mercury from '@webex/internal-plugin-mercury';
10
10
  import Meetings from '@webex/plugin-meetings/src/meetings';
11
11
  import {
12
- _MEETING_ID_
12
+ _MEETING_ID_,
13
+ _PERSONAL_ROOM_
13
14
  } from '@webex/plugin-meetings/src/constants';
14
15
  import MeetingInfo from '@webex/plugin-meetings/src/meeting-info/meeting-info-v2';
15
16
  import MeetingInfoUtil from '@webex/plugin-meetings/src/meeting-info/utilv2';
@@ -32,7 +33,8 @@ describe('plugin-meetings', () => {
32
33
  device: {
33
34
  deviceType: 'FAKE_DEVICE',
34
35
  register: sinon.stub().returns(Promise.resolve()),
35
- unregister: sinon.stub().returns(Promise.resolve())
36
+ unregister: sinon.stub().returns(Promise.resolve()),
37
+ userId: '01824b9b-adef-4b10-b5c1-8a2fe2fb7c0e'
36
38
  },
37
39
  mercury: {
38
40
  connect: sinon.stub().returns(Promise.resolve()),
@@ -60,6 +62,21 @@ describe('plugin-meetings', () => {
60
62
  method: 'POST', service: 'webex-appapi-service', resource: 'meetingInfo', body: {meetingKey: '1234323'}
61
63
  });
62
64
 
65
+ MeetingInfoUtil.getDestinationType.restore();
66
+ MeetingInfoUtil.getRequestBody.restore();
67
+ });
68
+ it('should fetch meeting info for the personal meeting room type', async () => {
69
+ sinon.stub(MeetingInfoUtil, 'getDestinationType').returns(Promise.resolve({type: 'MEETING_ID', destination: '123456'}));
70
+ sinon.stub(MeetingInfoUtil, 'getRequestBody').returns(Promise.resolve({meetingKey: '1234323'}));
71
+
72
+ await meetingInfo.fetchMeetingInfo({
73
+ type: _PERSONAL_ROOM_
74
+ });
75
+
76
+ assert.calledWith(webex.request, {
77
+ method: 'POST', service: 'webex-appapi-service', resource: 'meetingInfo', body: {meetingKey: '1234323'}
78
+ });
79
+
63
80
  MeetingInfoUtil.getDestinationType.restore();
64
81
  MeetingInfoUtil.getRequestBody.restore();
65
82
  });
@@ -14,8 +14,23 @@ import {
14
14
  _MEETING_UUID_
15
15
  } from '@webex/plugin-meetings/src/constants';
16
16
  import MeetingInfoUtil from '@webex/plugin-meetings/src/meeting-info/utilv2';
17
+ import LoggerProxy from '@webex/plugin-meetings/src/common/logs/logger-proxy';
18
+ import LoggerConfig from '@webex/plugin-meetings/src/common/logs/logger-config';
17
19
 
18
20
  describe('plugin-meetings', () => {
21
+ const logger = {
22
+ log: () => {},
23
+ error: () => {},
24
+ warn: () => {},
25
+ trace: () => {},
26
+ debug: () => {}
27
+ };
28
+
29
+ beforeEach(() => {
30
+ LoggerConfig.set({verboseEvents: true, enable: false});
31
+ LoggerProxy.set(logger);
32
+ });
33
+
19
34
  describe('Meeting Info Utils V2', () => {
20
35
  beforeEach(() => {
21
36
  MeetingInfoUtil.getHydraId = sinon.stub().returns(false);
@@ -0,0 +1,33 @@
1
+ /*!
2
+ * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
3
+ */
4
+
5
+ import {assert} from '@webex/test-helper-chai';
6
+ import sinon from 'sinon';
7
+ import {
8
+ _PERSONAL_ROOM_
9
+ } from '@webex/plugin-meetings/src/constants';
10
+ import PersonalMeetingRoom from '@webex/plugin-meetings/src/personal-meeting-room';
11
+
12
+ describe('personal-meeting-room', () => {
13
+ let meetingInfo;
14
+ let pmr;
15
+
16
+ beforeEach(() => {
17
+ meetingInfo = {
18
+ fetchMeetingInfo: sinon.stub().returns(Promise.resolve(
19
+ {body: {isPmr: true}}
20
+ ))
21
+ };
22
+ pmr = new PersonalMeetingRoom({meetingInfo}, {parent: {}});
23
+ });
24
+
25
+
26
+ describe('#get()', () => {
27
+ it('returns personal meeting room info', async () => {
28
+ await pmr.get();
29
+ assert.calledOnce(meetingInfo.fetchMeetingInfo);
30
+ assert.calledWith(meetingInfo.fetchMeetingInfo, {type: _PERSONAL_ROOM_});
31
+ });
32
+ });
33
+ });