@webex/plugin-meetings 3.0.0-beta.14 → 3.0.0-beta.16

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.
Files changed (311) hide show
  1. package/UPGRADING.md +9 -9
  2. package/browsers.js +19 -24
  3. package/dist/common/browser-detection.js +1 -20
  4. package/dist/common/browser-detection.js.map +1 -1
  5. package/dist/common/collection.js +5 -20
  6. package/dist/common/collection.js.map +1 -1
  7. package/dist/common/config.js +0 -7
  8. package/dist/common/config.js.map +1 -1
  9. package/dist/common/errors/captcha-error.js +5 -26
  10. package/dist/common/errors/captcha-error.js.map +1 -1
  11. package/dist/common/errors/intent-to-join.js +5 -26
  12. package/dist/common/errors/intent-to-join.js.map +1 -1
  13. package/dist/common/errors/join-meeting.js +6 -27
  14. package/dist/common/errors/join-meeting.js.map +1 -1
  15. package/dist/common/errors/media.js +5 -26
  16. package/dist/common/errors/media.js.map +1 -1
  17. package/dist/common/errors/parameter.js +5 -33
  18. package/dist/common/errors/parameter.js.map +1 -1
  19. package/dist/common/errors/password-error.js +5 -26
  20. package/dist/common/errors/password-error.js.map +1 -1
  21. package/dist/common/errors/permission.js +4 -25
  22. package/dist/common/errors/permission.js.map +1 -1
  23. package/dist/common/errors/reconnection-in-progress.js +0 -17
  24. package/dist/common/errors/reconnection-in-progress.js.map +1 -1
  25. package/dist/common/errors/reconnection.js +5 -26
  26. package/dist/common/errors/reconnection.js.map +1 -1
  27. package/dist/common/errors/stats.js +5 -26
  28. package/dist/common/errors/stats.js.map +1 -1
  29. package/dist/common/errors/webex-errors.js +6 -41
  30. package/dist/common/errors/webex-errors.js.map +1 -1
  31. package/dist/common/errors/webex-meetings-error.js +1 -24
  32. package/dist/common/errors/webex-meetings-error.js.map +1 -1
  33. package/dist/common/events/events-scope.js +0 -22
  34. package/dist/common/events/events-scope.js.map +1 -1
  35. package/dist/common/events/events.js +0 -23
  36. package/dist/common/events/events.js.map +1 -1
  37. package/dist/common/events/trigger-proxy.js +0 -12
  38. package/dist/common/events/trigger-proxy.js.map +1 -1
  39. package/dist/common/events/util.js +0 -15
  40. package/dist/common/events/util.js.map +1 -1
  41. package/dist/common/logs/logger-config.js +0 -4
  42. package/dist/common/logs/logger-config.js.map +1 -1
  43. package/dist/common/logs/logger-proxy.js +1 -8
  44. package/dist/common/logs/logger-proxy.js.map +1 -1
  45. package/dist/common/logs/request.js +35 -61
  46. package/dist/common/logs/request.js.map +1 -1
  47. package/dist/common/queue.js +4 -14
  48. package/dist/common/queue.js.map +1 -1
  49. package/dist/config.js +1 -5
  50. package/dist/config.js.map +1 -1
  51. package/dist/constants.js +45 -40
  52. package/dist/constants.js.map +1 -1
  53. package/dist/index.js +1 -17
  54. package/dist/index.js.map +1 -1
  55. package/dist/locus-info/controlsUtils.js +10 -28
  56. package/dist/locus-info/controlsUtils.js.map +1 -1
  57. package/dist/locus-info/embeddedAppsUtils.js +3 -26
  58. package/dist/locus-info/embeddedAppsUtils.js.map +1 -1
  59. package/dist/locus-info/fullState.js +0 -15
  60. package/dist/locus-info/fullState.js.map +1 -1
  61. package/dist/locus-info/hostUtils.js +4 -12
  62. package/dist/locus-info/hostUtils.js.map +1 -1
  63. package/dist/locus-info/index.js +101 -193
  64. package/dist/locus-info/index.js.map +1 -1
  65. package/dist/locus-info/infoUtils.js +0 -38
  66. package/dist/locus-info/infoUtils.js.map +1 -1
  67. package/dist/locus-info/mediaSharesUtils.js +12 -38
  68. package/dist/locus-info/mediaSharesUtils.js.map +1 -1
  69. package/dist/locus-info/parser.js +87 -123
  70. package/dist/locus-info/parser.js.map +1 -1
  71. package/dist/locus-info/selfUtils.js +16 -81
  72. package/dist/locus-info/selfUtils.js.map +1 -1
  73. package/dist/media/index.js +43 -97
  74. package/dist/media/index.js.map +1 -1
  75. package/dist/media/internal-media-core-wrapper.js +0 -4
  76. package/dist/media/internal-media-core-wrapper.js.map +1 -1
  77. package/dist/media/properties.js +64 -110
  78. package/dist/media/properties.js.map +1 -1
  79. package/dist/media/util.js +2 -9
  80. package/dist/media/util.js.map +1 -1
  81. package/dist/mediaQualityMetrics/config.js +10 -12
  82. package/dist/mediaQualityMetrics/config.js.map +1 -1
  83. package/dist/meeting/effectsState.js +120 -192
  84. package/dist/meeting/effectsState.js.map +1 -1
  85. package/dist/meeting/in-meeting-actions.js +0 -13
  86. package/dist/meeting/in-meeting-actions.js.map +1 -1
  87. package/dist/meeting/index.js +819 -1591
  88. package/dist/meeting/index.js.map +1 -1
  89. package/dist/meeting/muteState.js +31 -78
  90. package/dist/meeting/muteState.js.map +1 -1
  91. package/dist/meeting/request.js +160 -230
  92. package/dist/meeting/request.js.map +1 -1
  93. package/dist/meeting/request.type.js +0 -1
  94. package/dist/meeting/request.type.js.map +1 -1
  95. package/dist/meeting/state.js +21 -31
  96. package/dist/meeting/state.js.map +1 -1
  97. package/dist/meeting/util.js +19 -158
  98. package/dist/meeting/util.js.map +1 -1
  99. package/dist/meeting-info/collection.js +3 -25
  100. package/dist/meeting-info/collection.js.map +1 -1
  101. package/dist/meeting-info/index.js +10 -33
  102. package/dist/meeting-info/index.js.map +1 -1
  103. package/dist/meeting-info/meeting-info-v2.js +179 -268
  104. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  105. package/dist/meeting-info/request.js +1 -16
  106. package/dist/meeting-info/request.js.map +1 -1
  107. package/dist/meeting-info/util.js +98 -183
  108. package/dist/meeting-info/util.js.map +1 -1
  109. package/dist/meeting-info/utilv2.js +137 -228
  110. package/dist/meeting-info/utilv2.js.map +1 -1
  111. package/dist/meetings/collection.js +3 -21
  112. package/dist/meetings/collection.js.map +1 -1
  113. package/dist/meetings/index.js +450 -582
  114. package/dist/meetings/index.js.map +1 -1
  115. package/dist/meetings/request.js +7 -30
  116. package/dist/meetings/request.js.map +1 -1
  117. package/dist/meetings/util.js +99 -155
  118. package/dist/meetings/util.js.map +1 -1
  119. package/dist/member/index.js +49 -89
  120. package/dist/member/index.js.map +1 -1
  121. package/dist/member/util.js +17 -68
  122. package/dist/member/util.js.map +1 -1
  123. package/dist/members/collection.js +2 -12
  124. package/dist/members/collection.js.map +1 -1
  125. package/dist/members/index.js +72 -194
  126. package/dist/members/index.js.map +1 -1
  127. package/dist/members/request.js +21 -56
  128. package/dist/members/request.js.map +1 -1
  129. package/dist/members/util.js +9 -38
  130. package/dist/members/util.js.map +1 -1
  131. package/dist/metrics/config.js +0 -2
  132. package/dist/metrics/config.js.map +1 -1
  133. package/dist/metrics/constants.js +1 -2
  134. package/dist/metrics/constants.js.map +1 -1
  135. package/dist/metrics/index.js +48 -136
  136. package/dist/metrics/index.js.map +1 -1
  137. package/dist/multistream/mediaRequestManager.js +12 -28
  138. package/dist/multistream/mediaRequestManager.js.map +1 -1
  139. package/dist/multistream/multistreamMedia.js +11 -21
  140. package/dist/multistream/multistreamMedia.js.map +1 -1
  141. package/dist/multistream/receiveSlot.js +7 -47
  142. package/dist/multistream/receiveSlot.js.map +1 -1
  143. package/dist/multistream/receiveSlotManager.js +38 -77
  144. package/dist/multistream/receiveSlotManager.js.map +1 -1
  145. package/dist/multistream/remoteMedia.js +11 -56
  146. package/dist/multistream/remoteMedia.js.map +1 -1
  147. package/dist/multistream/remoteMediaGroup.js +6 -40
  148. package/dist/multistream/remoteMediaGroup.js.map +1 -1
  149. package/dist/multistream/remoteMediaManager.js +221 -380
  150. package/dist/multistream/remoteMediaManager.js.map +1 -1
  151. package/dist/networkQualityMonitor/index.js +28 -57
  152. package/dist/networkQualityMonitor/index.js.map +1 -1
  153. package/dist/personal-meeting-room/index.js +10 -45
  154. package/dist/personal-meeting-room/index.js.map +1 -1
  155. package/dist/personal-meeting-room/request.js +2 -33
  156. package/dist/personal-meeting-room/request.js.map +1 -1
  157. package/dist/personal-meeting-room/util.js +0 -13
  158. package/dist/personal-meeting-room/util.js.map +1 -1
  159. package/dist/reachability/index.js +100 -166
  160. package/dist/reachability/index.js.map +1 -1
  161. package/dist/reachability/request.js +2 -18
  162. package/dist/reachability/request.js.map +1 -1
  163. package/dist/reactions/reactions.js +0 -2
  164. package/dist/reactions/reactions.js.map +1 -1
  165. package/dist/reactions/reactions.type.js +2 -6
  166. package/dist/reactions/reactions.type.js.map +1 -1
  167. package/dist/reconnection-manager/index.js +294 -459
  168. package/dist/reconnection-manager/index.js.map +1 -1
  169. package/dist/roap/index.js +18 -53
  170. package/dist/roap/index.js.map +1 -1
  171. package/dist/roap/request.js +13 -55
  172. package/dist/roap/request.js.map +1 -1
  173. package/dist/roap/turnDiscovery.js +10 -52
  174. package/dist/roap/turnDiscovery.js.map +1 -1
  175. package/dist/statsAnalyzer/global.js +0 -2
  176. package/dist/statsAnalyzer/global.js.map +1 -1
  177. package/dist/statsAnalyzer/index.js +66 -174
  178. package/dist/statsAnalyzer/index.js.map +1 -1
  179. package/dist/statsAnalyzer/mqaUtil.js +54 -53
  180. package/dist/statsAnalyzer/mqaUtil.js.map +1 -1
  181. package/dist/transcription/index.js +13 -45
  182. package/dist/transcription/index.js.map +1 -1
  183. package/internal-README.md +7 -6
  184. package/package.json +18 -18
  185. package/src/common/browser-detection.ts +9 -6
  186. package/src/common/collection.ts +3 -1
  187. package/src/common/errors/captcha-error.ts +6 -6
  188. package/src/common/errors/intent-to-join.ts +6 -6
  189. package/src/common/errors/join-meeting.ts +12 -8
  190. package/src/common/errors/media.ts +6 -6
  191. package/src/common/errors/parameter.ts +9 -6
  192. package/src/common/errors/password-error.ts +6 -6
  193. package/src/common/errors/permission.ts +5 -5
  194. package/src/common/errors/reconnection.ts +6 -6
  195. package/src/common/errors/stats.ts +6 -6
  196. package/src/common/errors/webex-errors.ts +7 -5
  197. package/src/common/errors/webex-meetings-error.ts +1 -1
  198. package/src/common/events/events-scope.ts +5 -1
  199. package/src/common/events/events.ts +5 -1
  200. package/src/common/events/trigger-proxy.ts +8 -3
  201. package/src/common/events/util.ts +1 -2
  202. package/src/common/logs/logger-proxy.ts +21 -10
  203. package/src/common/logs/request.ts +11 -8
  204. package/src/config.ts +11 -11
  205. package/src/constants.ts +1 -1
  206. package/src/index.js +1 -1
  207. package/src/locus-info/controlsUtils.ts +34 -24
  208. package/src/locus-info/fullState.ts +15 -11
  209. package/src/locus-info/hostUtils.ts +4 -3
  210. package/src/locus-info/index.ts +25 -34
  211. package/src/locus-info/infoUtils.ts +12 -4
  212. package/src/locus-info/mediaSharesUtils.ts +4 -4
  213. package/src/locus-info/parser.ts +45 -68
  214. package/src/locus-info/selfUtils.ts +106 -57
  215. package/src/media/index.ts +123 -135
  216. package/src/media/internal-media-core-wrapper.ts +2 -2
  217. package/src/media/properties.ts +30 -20
  218. package/src/media/util.ts +1 -1
  219. package/src/mediaQualityMetrics/config.ts +46 -46
  220. package/src/meeting/effectsState.ts +35 -35
  221. package/src/meeting/in-meeting-actions.ts +7 -3
  222. package/src/meeting/index.ts +1559 -1292
  223. package/src/meeting/muteState.ts +62 -31
  224. package/src/meeting/request.ts +155 -116
  225. package/src/meeting/request.type.ts +8 -8
  226. package/src/meeting/state.ts +45 -30
  227. package/src/meeting/util.ts +101 -70
  228. package/src/meeting-info/collection.ts +2 -1
  229. package/src/meeting-info/index.ts +32 -30
  230. package/src/meeting-info/meeting-info-v2.ts +106 -108
  231. package/src/meeting-info/request.ts +9 -3
  232. package/src/meeting-info/util.ts +54 -46
  233. package/src/meeting-info/utilv2.ts +59 -53
  234. package/src/meetings/collection.ts +1 -1
  235. package/src/meetings/index.ts +512 -440
  236. package/src/meetings/request.ts +26 -24
  237. package/src/meetings/util.ts +29 -29
  238. package/src/member/index.ts +55 -49
  239. package/src/member/util.ts +26 -13
  240. package/src/members/collection.ts +0 -1
  241. package/src/members/index.ts +182 -126
  242. package/src/members/request.ts +46 -14
  243. package/src/members/util.ts +44 -42
  244. package/src/metrics/config.ts +254 -81
  245. package/src/metrics/constants.ts +0 -2
  246. package/src/metrics/index.ts +84 -71
  247. package/src/multistream/multistreamMedia.ts +1 -0
  248. package/src/multistream/receiveSlot.ts +1 -0
  249. package/src/multistream/receiveSlotManager.ts +1 -0
  250. package/src/multistream/remoteMedia.ts +1 -1
  251. package/src/multistream/remoteMediaGroup.ts +2 -1
  252. package/src/multistream/remoteMediaManager.ts +3 -0
  253. package/src/networkQualityMonitor/index.ts +20 -23
  254. package/src/personal-meeting-room/index.ts +12 -16
  255. package/src/personal-meeting-room/request.ts +10 -3
  256. package/src/personal-meeting-room/util.ts +3 -3
  257. package/src/reachability/index.ts +61 -59
  258. package/src/reachability/request.ts +36 -32
  259. package/src/reactions/reactions.ts +4 -4
  260. package/src/reactions/reactions.type.ts +4 -3
  261. package/src/reconnection-manager/index.ts +139 -84
  262. package/src/roap/index.ts +46 -38
  263. package/src/roap/request.ts +44 -31
  264. package/src/roap/turnDiscovery.ts +59 -30
  265. package/src/statsAnalyzer/global.ts +30 -33
  266. package/src/statsAnalyzer/index.ts +432 -175
  267. package/src/statsAnalyzer/mqaUtil.ts +178 -72
  268. package/src/transcription/index.ts +34 -32
  269. package/test/integration/spec/journey.js +664 -463
  270. package/test/integration/spec/space-meeting.js +319 -204
  271. package/test/integration/spec/transcription.js +7 -8
  272. package/test/unit/spec/common/browser-detection.js +9 -28
  273. package/test/unit/spec/fixture/locus.js +92 -90
  274. package/test/unit/spec/locus-info/controlsUtils.js +5 -5
  275. package/test/unit/spec/locus-info/embeddedAppsUtils.js +8 -6
  276. package/test/unit/spec/locus-info/index.js +1 -2
  277. package/test/unit/spec/locus-info/infoUtils.js +26 -33
  278. package/test/unit/spec/locus-info/lib/BasicSeqCmp.json +88 -430
  279. package/test/unit/spec/locus-info/lib/SeqCmp.json +513 -685
  280. package/test/unit/spec/locus-info/parser.js +3 -9
  281. package/test/unit/spec/locus-info/selfConstant.js +72 -103
  282. package/test/unit/spec/locus-info/selfUtils.js +21 -12
  283. package/test/unit/spec/meeting/effectsState.js +36 -46
  284. package/test/unit/spec/meeting/in-meeting-actions.ts +2 -3
  285. package/test/unit/spec/meeting/index.js +1279 -685
  286. package/test/unit/spec/meeting/muteState.js +42 -33
  287. package/test/unit/spec/meeting/request.js +57 -46
  288. package/test/unit/spec/meeting/utils.js +78 -53
  289. package/test/unit/spec/meeting-info/meetinginfov2.js +100 -73
  290. package/test/unit/spec/meeting-info/request.js +7 -9
  291. package/test/unit/spec/meeting-info/util.js +11 -12
  292. package/test/unit/spec/meeting-info/utilv2.js +110 -74
  293. package/test/unit/spec/meetings/collection.js +1 -1
  294. package/test/unit/spec/meetings/index.js +438 -257
  295. package/test/unit/spec/meetings/utils.js +14 -12
  296. package/test/unit/spec/member/index.js +0 -1
  297. package/test/unit/spec/member/util.js +5 -6
  298. package/test/unit/spec/members/index.js +104 -54
  299. package/test/unit/spec/members/request.js +29 -20
  300. package/test/unit/spec/members/utils.js +8 -5
  301. package/test/unit/spec/metrics/index.js +16 -21
  302. package/test/unit/spec/networkQualityMonitor/index.js +21 -15
  303. package/test/unit/spec/personal-meeting-room/personal-meeting-room.js +2 -7
  304. package/test/unit/spec/reachability/index.ts +9 -11
  305. package/test/unit/spec/reconnection-manager/index.js +16 -18
  306. package/test/unit/spec/roap/turnDiscovery.ts +22 -19
  307. package/test/unit/spec/stats-analyzer/index.js +25 -20
  308. package/test/utils/cmr.js +44 -42
  309. package/test/utils/testUtils.js +83 -74
  310. package/test/utils/webex-config.js +18 -18
  311. package/test/utils/webex-test-users.js +53 -50
@@ -50,7 +50,7 @@ import {
50
50
  UserNotJoinedError,
51
51
  MeetingNotActiveError,
52
52
  UserInLobbyError,
53
- NoMediaEstablishedYetError
53
+ NoMediaEstablishedYetError,
54
54
  } from '../../../../src/common/errors/webex-errors';
55
55
  import WebExMeetingsErrors from '../../../../src/common/errors/webex-meetings-error';
56
56
  import ParameterError from '../../../../src/common/errors/parameter';
@@ -59,11 +59,12 @@ import CaptchaError from '../../../../src/common/errors/captcha-error';
59
59
  import IntentToJoinError from '../../../../src/common/errors/intent-to-join';
60
60
  import DefaultSDKConfig from '../../../../src/config';
61
61
  import testUtils from '../../../utils/testUtils';
62
- import {MeetingInfoV2CaptchaError, MeetingInfoV2PasswordError} from '../../../../src/meeting-info/meeting-info-v2';
62
+ import {
63
+ MeetingInfoV2CaptchaError,
64
+ MeetingInfoV2PasswordError,
65
+ } from '../../../../src/meeting-info/meeting-info-v2';
63
66
 
64
- const {
65
- getBrowserName
66
- } = BrowserDetection();
67
+ const {getBrowserName} = BrowserDetection();
67
68
 
68
69
  // Non-stubbed function
69
70
  const {getDisplayMedia} = Media;
@@ -75,7 +76,7 @@ describe('plugin-meetings', () => {
75
76
  error: () => {},
76
77
  warn: () => {},
77
78
  trace: () => {},
78
- debug: () => {}
79
+ debug: () => {},
79
80
  };
80
81
 
81
82
  beforeEach(() => {
@@ -87,44 +88,48 @@ describe('plugin-meetings', () => {
87
88
 
88
89
  before(() => {
89
90
  const MediaStream = {
90
- getVideoTracks: () => [{
91
- applyConstraints: () => { }
92
- }]
91
+ getVideoTracks: () => [
92
+ {
93
+ applyConstraints: () => {},
94
+ },
95
+ ],
93
96
  };
94
97
 
95
98
  Object.defineProperty(global.window.navigator, 'mediaDevices', {
96
99
  writable: true,
97
100
  value: {
98
101
  getDisplayMedia: sinon.stub().returns(Promise.resolve(MediaStream)),
99
- enumerateDevices: sinon.stub().returns(Promise.resolve([
100
- {
101
- deviceId: '',
102
- kind: 'audioinput',
103
- label: '',
104
- groupId: '29d9339cc77bffdd24cb69ee80f6d3200481099bcd0f29267558672de0430777',
105
- },
106
- {
107
- deviceId: '',
108
- kind: 'videoinput',
109
- label: '',
110
- groupId: '08d4f8200e7e4a3425ecf75b7edea9ae4acd934019f2a52217554bcc8e46604d',
111
- },
112
- {
113
- deviceId: '',
114
- kind: 'audiooutput',
115
- label: '',
116
- groupId: '29d9339cc77bffdd24cb69ee80f6d3200481099bcd0f29267558672de0430777',
117
- }
118
- ])),
102
+ enumerateDevices: sinon.stub().returns(
103
+ Promise.resolve([
104
+ {
105
+ deviceId: '',
106
+ kind: 'audioinput',
107
+ label: '',
108
+ groupId: '29d9339cc77bffdd24cb69ee80f6d3200481099bcd0f29267558672de0430777',
109
+ },
110
+ {
111
+ deviceId: '',
112
+ kind: 'videoinput',
113
+ label: '',
114
+ groupId: '08d4f8200e7e4a3425ecf75b7edea9ae4acd934019f2a52217554bcc8e46604d',
115
+ },
116
+ {
117
+ deviceId: '',
118
+ kind: 'audiooutput',
119
+ label: '',
120
+ groupId: '29d9339cc77bffdd24cb69ee80f6d3200481099bcd0f29267558672de0430777',
121
+ },
122
+ ])
123
+ ),
119
124
  getSupportedConstraints: sinon.stub().returns({
120
- sampleRate: true
121
- })
125
+ sampleRate: true,
126
+ }),
122
127
  },
123
128
  });
124
129
 
125
130
  Object.defineProperty(global.window, 'MediaStream', {
126
131
  writable: true,
127
- value: MediaStream
132
+ value: MediaStream,
128
133
  });
129
134
  LoggerConfig.set({verboseEvents: true, enable: false});
130
135
  LoggerProxy.set(logger);
@@ -149,25 +154,25 @@ describe('plugin-meetings', () => {
149
154
  children: {
150
155
  meetings: Meetings,
151
156
  credentials: Credentials,
152
- support: Support
157
+ support: Support,
153
158
  },
154
159
  config: {
155
160
  credentials: {
156
- client_id: 'mock-client-id'
161
+ client_id: 'mock-client-id',
157
162
  },
158
163
  meetings: {
159
164
  reconnection: {
160
- enabled: false
165
+ enabled: false,
161
166
  },
162
167
  mediaSettings: {},
163
168
  metrics: {},
164
169
  stats: {},
165
- experimental: {enableUnifiedMeetings: true}
170
+ experimental: {enableUnifiedMeetings: true},
166
171
  },
167
172
  metrics: {
168
- type: ['behavioral']
169
- }
170
- }
173
+ type: ['behavioral'],
174
+ },
175
+ },
171
176
  });
172
177
 
173
178
  webex.internal.support.submitLogs = sinon.stub().returns(Promise.resolve());
@@ -175,7 +180,6 @@ describe('plugin-meetings', () => {
175
180
  webex.internal.metrics.submitClientMetrics = sinon.stub().returns(Promise.resolve());
176
181
  webex.meetings.uploadLogs = sinon.stub().returns(Promise.resolve());
177
182
 
178
-
179
183
  TriggerProxy.trigger = sinon.stub().returns(true);
180
184
  Metrics.postEvent = sinon.stub();
181
185
  Metrics.initialSetup(null, webex);
@@ -203,7 +207,7 @@ describe('plugin-meetings', () => {
203
207
  destinationType: _MEETING_ID_,
204
208
  },
205
209
  {
206
- parent: webex
210
+ parent: webex,
207
211
  }
208
212
  );
209
213
 
@@ -432,7 +436,6 @@ describe('plugin-meetings', () => {
432
436
  it('should return a promise resolution', async () => {
433
437
  meeting.audio = {handleClientRequest};
434
438
 
435
-
436
439
  const audio = meeting.unmuteAudio();
437
440
 
438
441
  assert.exists(audio.then);
@@ -449,8 +452,8 @@ describe('plugin-meetings', () => {
449
452
  readyState: 'live',
450
453
  enabled: true,
451
454
  getSettings: () => ({
452
- sampleRate: 48000
453
- })
455
+ sampleRate: 48000,
456
+ }),
454
457
  });
455
458
 
456
459
  beforeEach(() => {
@@ -458,7 +461,7 @@ describe('plugin-meetings', () => {
458
461
  sinon.replace(meeting, 'addMedia', () => {
459
462
  sinon.stub(meeting.mediaProperties, 'audioTrack').value(fakeMediaTrack());
460
463
  sinon.stub(meeting.mediaProperties, 'mediaDirection').value({
461
- receiveAudio: true
464
+ receiveAudio: true,
462
465
  });
463
466
  });
464
467
  });
@@ -470,7 +473,7 @@ describe('plugin-meetings', () => {
470
473
  describe('before audio attached to meeting', () => {
471
474
  it('should throw no audio error', async () => {
472
475
  await meeting.enableBNR().catch((err) => {
473
- assert.equal(err.toString(), 'Error: Meeting doesn\'t have an audioTrack attached');
476
+ assert.equal(err.toString(), "Error: Meeting doesn't have an audioTrack attached");
474
477
  });
475
478
  });
476
479
  });
@@ -518,7 +521,7 @@ describe('plugin-meetings', () => {
518
521
 
519
522
  it('should throw no audio error', async () => {
520
523
  await meeting.disableBNR().catch((err) => {
521
- assert.equal(err.toString(), 'Error: Meeting doesn\'t have an audioTrack attached');
524
+ assert.equal(err.toString(), "Error: Meeting doesn't have an audioTrack attached");
522
525
  });
523
526
  });
524
527
  });
@@ -650,7 +653,11 @@ describe('plugin-meetings', () => {
650
653
  });
651
654
  describe('#getMediaStreams', () => {
652
655
  beforeEach(() => {
653
- sinon.stub(Media, 'getSupportedDevice').callsFake((options) => Promise.resolve({sendAudio: options.sendAudio, sendVideo: options.sendVideo}));
656
+ sinon
657
+ .stub(Media, 'getSupportedDevice')
658
+ .callsFake((options) =>
659
+ Promise.resolve({sendAudio: options.sendAudio, sendVideo: options.sendVideo})
660
+ );
654
661
  sinon.stub(Media, 'getUserMedia').returns(Promise.resolve(['stream1', 'stream2']));
655
662
  });
656
663
  afterEach(() => {
@@ -674,17 +681,20 @@ describe('plugin-meetings', () => {
674
681
  sinon.stub(meeting.mediaProperties, 'localQualityLevel').value('480p');
675
682
  await meeting.getMediaStreams(mediaDirection, audioVideoSettings);
676
683
 
677
- assert.calledWith(Media.getUserMedia, {
678
- ...mediaDirection,
679
- isSharing: false
680
- },
681
- {
682
- video: {
683
- width: {max: 640, ideal: 640},
684
- height: {max: 480, ideal: 480},
685
- deviceId: videoDevice
684
+ assert.calledWith(
685
+ Media.getUserMedia,
686
+ {
687
+ ...mediaDirection,
688
+ isSharing: false,
689
+ },
690
+ {
691
+ video: {
692
+ width: {max: 640, ideal: 640},
693
+ height: {max: 480, ideal: 480},
694
+ deviceId: videoDevice,
695
+ },
686
696
  }
687
- });
697
+ );
688
698
  });
689
699
  it('will set a new preferred video input device if passed in', async () => {
690
700
  // if audioVideo settings parameter specifies a new video device it
@@ -709,30 +719,33 @@ describe('plugin-meetings', () => {
709
719
  video: {
710
720
  width: {
711
721
  max: 400,
712
- ideal: 400
722
+ ideal: 400,
713
723
  },
714
724
  height: {
715
725
  max: 200,
716
- ideal: 200
726
+ ideal: 200,
717
727
  },
718
728
  frameRate: {
719
729
  ideal: 15,
720
- max: 30
730
+ max: 30,
721
731
  },
722
732
  facingMode: {
723
- ideal: 'user'
724
- }
725
- }
733
+ ideal: 'user',
734
+ },
735
+ },
726
736
  };
727
737
 
728
738
  sinon.stub(meeting.mediaProperties, 'localQualityLevel').value('200p');
729
739
  await meeting.getMediaStreams(mediaDirection, customAudioVideoSettings);
730
740
 
731
- assert.calledWith(Media.getUserMedia, {
732
- ...mediaDirection,
733
- isSharing: false
734
- },
735
- customAudioVideoSettings);
741
+ assert.calledWith(
742
+ Media.getUserMedia,
743
+ {
744
+ ...mediaDirection,
745
+ isSharing: false,
746
+ },
747
+ customAudioVideoSettings
748
+ );
736
749
  });
737
750
  it('should not access camera if sendVideo is false ', async () => {
738
751
  await meeting.getMediaStreams({sendAudio: true, sendVideo: false});
@@ -771,8 +784,7 @@ describe('plugin-meetings', () => {
771
784
 
772
785
  try {
773
786
  await meeting.receiveTranscription();
774
- }
775
- catch (err) {
787
+ } catch (err) {
776
788
  assert(err, {});
777
789
  }
778
790
  });
@@ -780,7 +792,7 @@ describe('plugin-meetings', () => {
780
792
  describe('#stopReceivingTranscription', () => {
781
793
  it('should get invoked', () => {
782
794
  meeting.transcription = {
783
- closeSocket: sinon.stub()
795
+ closeSocket: sinon.stub(),
784
796
  };
785
797
 
786
798
  meeting.stopReceivingTranscription();
@@ -817,7 +829,10 @@ describe('plugin-meetings', () => {
817
829
  it('should join the meeting and return promise', async () => {
818
830
  const join = meeting.join();
819
831
 
820
- assert.calledWithMatch(Metrics.postEvent, {event: eventType.CALL_INITIATED, data: {trigger: trigger.USER_INTERACTION, isRoapCallEnabled: true}});
832
+ assert.calledWithMatch(Metrics.postEvent, {
833
+ event: eventType.CALL_INITIATED,
834
+ data: {trigger: trigger.USER_INTERACTION, isRoapCallEnabled: true},
835
+ });
821
836
 
822
837
  assert.exists(join.then);
823
838
  const result = await join;
@@ -881,8 +896,7 @@ describe('plugin-meetings', () => {
881
896
  try {
882
897
  await meeting.join();
883
898
  joinSucceeded = true;
884
- }
885
- catch (e) {
899
+ } catch (e) {
886
900
  assert.instanceOf(e, IntentToJoinError);
887
901
  }
888
902
  assert.isFalse(joinSucceeded);
@@ -930,7 +944,7 @@ describe('plugin-meetings', () => {
930
944
  describe('#addMedia', () => {
931
945
  const muteStateStub = {
932
946
  handleClientRequest: sinon.stub().returns(Promise.resolve(true)),
933
- applyClientStateLocally: sinon.stub().returns(Promise.resolve(true))
947
+ applyClientStateLocally: sinon.stub().returns(Promise.resolve(true)),
934
948
  };
935
949
 
936
950
  let fakeMediaConnection;
@@ -951,7 +965,9 @@ describe('plugin-meetings', () => {
951
965
  meeting.setMercuryListener = sinon.stub().returns(true);
952
966
  meeting.setupMediaConnectionListeners = sinon.stub();
953
967
  meeting.setMercuryListener = sinon.stub();
954
- meeting.roap.doTurnDiscovery = sinon.stub().resolves({turnServerInfo: {}, turnDiscoverySkippedReason: undefined});
968
+ meeting.roap.doTurnDiscovery = sinon
969
+ .stub()
970
+ .resolves({turnServerInfo: {}, turnDiscoverySkippedReason: undefined});
955
971
  });
956
972
 
957
973
  it('should have #addMedia', () => {
@@ -980,8 +996,7 @@ describe('plugin-meetings', () => {
980
996
  try {
981
997
  await meeting.addMedia();
982
998
  assert.fail('addMedia should have thrown an exception.');
983
- }
984
- catch (err) {
999
+ } catch (err) {
985
1000
  assert.instanceOf(err, UserInLobbyError);
986
1001
  }
987
1002
  });
@@ -999,37 +1014,33 @@ describe('plugin-meetings', () => {
999
1014
 
1000
1015
  assert.isNull(meeting.statsAnalyzer);
1001
1016
  assert(Metrics.sendBehavioralMetric.calledOnce);
1002
- assert.calledWith(
1003
- Metrics.sendBehavioralMetric,
1004
- BEHAVIORAL_METRICS.ADD_MEDIA_FAILURE, {
1005
- correlation_id: meeting.correlationId,
1006
- locus_id: meeting.locusUrl.split('/').pop(),
1007
- reason: error.message,
1008
- stack: error.stack,
1009
- code: error.code,
1010
- turnDiscoverySkippedReason: undefined,
1011
- turnServerUsed: true
1012
- }
1013
- );
1017
+ assert.calledWith(Metrics.sendBehavioralMetric, BEHAVIORAL_METRICS.ADD_MEDIA_FAILURE, {
1018
+ correlation_id: meeting.correlationId,
1019
+ locus_id: meeting.locusUrl.split('/').pop(),
1020
+ reason: error.message,
1021
+ stack: error.stack,
1022
+ code: error.code,
1023
+ turnDiscoverySkippedReason: undefined,
1024
+ turnServerUsed: true,
1025
+ });
1014
1026
  });
1015
1027
 
1016
1028
  it('checks metrics called with skipped reason config', async () => {
1017
- meeting.roap.doTurnDiscovery = sinon.stub().resolves({turnServerInfo: undefined, turnDiscoverySkippedReason: 'config'});
1029
+ meeting.roap.doTurnDiscovery = sinon
1030
+ .stub()
1031
+ .resolves({turnServerInfo: undefined, turnDiscoverySkippedReason: 'config'});
1018
1032
  meeting.meetingState = 'ACTIVE';
1019
1033
  await meeting.addMedia().catch((err) => {
1020
1034
  assert.exists(err);
1021
1035
  assert(Metrics.sendBehavioralMetric.calledOnce);
1022
- assert.calledWith(
1023
- Metrics.sendBehavioralMetric,
1024
- BEHAVIORAL_METRICS.ADD_MEDIA_FAILURE, {
1025
- correlation_id: meeting.correlationId,
1026
- locus_id: meeting.locusUrl.split('/').pop(),
1027
- reason: err.message,
1028
- stack: err.stack,
1029
- turnDiscoverySkippedReason: 'config',
1030
- turnServerUsed: false
1031
- }
1032
- );
1036
+ assert.calledWith(Metrics.sendBehavioralMetric, BEHAVIORAL_METRICS.ADD_MEDIA_FAILURE, {
1037
+ correlation_id: meeting.correlationId,
1038
+ locus_id: meeting.locusUrl.split('/').pop(),
1039
+ reason: err.message,
1040
+ stack: err.stack,
1041
+ turnDiscoverySkippedReason: 'config',
1042
+ turnServerUsed: false,
1043
+ });
1033
1044
  });
1034
1045
  });
1035
1046
 
@@ -1048,12 +1059,13 @@ describe('plugin-meetings', () => {
1048
1059
  assert(Metrics.sendBehavioralMetric.calledOnce);
1049
1060
  assert.calledWith(
1050
1061
  Metrics.sendBehavioralMetric,
1051
- BEHAVIORAL_METRICS.ADD_MEDIA_FAILURE, sinon.match({
1062
+ BEHAVIORAL_METRICS.ADD_MEDIA_FAILURE,
1063
+ sinon.match({
1052
1064
  correlation_id: meeting.correlationId,
1053
1065
  locus_id: meeting.locusUrl.split('/').pop(),
1054
1066
  reason: result.message,
1055
1067
  turnDiscoverySkippedReason: undefined,
1056
- turnServerUsed: true
1068
+ turnServerUsed: true,
1057
1069
  })
1058
1070
  );
1059
1071
  });
@@ -1074,10 +1086,9 @@ describe('plugin-meetings', () => {
1074
1086
 
1075
1087
  try {
1076
1088
  await meeting.addMedia({
1077
- mediaSettings: {}
1089
+ mediaSettings: {},
1078
1090
  });
1079
- }
1080
- catch (err) {
1091
+ } catch (err) {
1081
1092
  assert.fail('should not throw an error');
1082
1093
  }
1083
1094
  });
@@ -1117,11 +1128,13 @@ describe('plugin-meetings', () => {
1117
1128
  });
1118
1129
 
1119
1130
  it('should attach the media and return promise', async () => {
1120
- meeting.roap.doTurnDiscovery = sinon.stub().resolves({turnServerInfo: undefined, turnDiscoverySkippedReason: undefined});
1131
+ meeting.roap.doTurnDiscovery = sinon
1132
+ .stub()
1133
+ .resolves({turnServerInfo: undefined, turnDiscoverySkippedReason: undefined});
1121
1134
 
1122
1135
  meeting.meetingState = 'ACTIVE';
1123
1136
  const media = meeting.addMedia({
1124
- mediaSettings: {}
1137
+ mediaSettings: {},
1125
1138
  });
1126
1139
 
1127
1140
  assert.exists(media);
@@ -1130,12 +1143,17 @@ describe('plugin-meetings', () => {
1130
1143
  assert.calledWith(meeting.roap.doTurnDiscovery, meeting, false);
1131
1144
  assert.calledOnce(meeting.mediaProperties.setMediaDirection);
1132
1145
  assert.calledOnce(Media.createMediaConnection);
1133
- assert.calledWith(Media.createMediaConnection, false, meeting.getMediaConnectionDebugId(), sinon.match({turnServerInfo: undefined}));
1146
+ assert.calledWith(
1147
+ Media.createMediaConnection,
1148
+ false,
1149
+ meeting.getMediaConnectionDebugId(),
1150
+ sinon.match({turnServerInfo: undefined})
1151
+ );
1134
1152
  assert.calledOnce(meeting.setMercuryListener);
1135
1153
  assert.calledOnce(fakeMediaConnection.initiateOffer);
1136
1154
  /* statsAnalyzer is initiated inside of addMedia so there isn't
1137
- * a good way to mock it without mocking the constructor
1138
- */
1155
+ * a good way to mock it without mocking the constructor
1156
+ */
1139
1157
  });
1140
1158
 
1141
1159
  it('should pass the turn server info to the peer connection', async () => {
@@ -1146,17 +1164,16 @@ describe('plugin-meetings', () => {
1146
1164
  meeting.meetingState = 'ACTIVE';
1147
1165
  Media.createMediaConnection.resetHistory();
1148
1166
 
1149
-
1150
1167
  meeting.roap.doTurnDiscovery = sinon.stub().resolves({
1151
1168
  turnServerInfo: {
1152
1169
  url: FAKE_TURN_URL,
1153
1170
  username: FAKE_TURN_USER,
1154
- password: FAKE_TURN_PASSWORD
1171
+ password: FAKE_TURN_PASSWORD,
1155
1172
  },
1156
- turnServerSkippedReason: undefined
1173
+ turnServerSkippedReason: undefined,
1157
1174
  });
1158
1175
  const media = meeting.addMedia({
1159
- mediaSettings: {}
1176
+ mediaSettings: {},
1160
1177
  });
1161
1178
 
1162
1179
  assert.exists(media);
@@ -1164,25 +1181,35 @@ describe('plugin-meetings', () => {
1164
1181
  assert.calledOnce(meeting.roap.doTurnDiscovery);
1165
1182
  assert.calledWith(meeting.roap.doTurnDiscovery, meeting, false);
1166
1183
  assert.calledOnce(Media.createMediaConnection);
1167
- assert.calledWith(Media.createMediaConnection, false, meeting.getMediaConnectionDebugId(), sinon.match({
1168
- turnServerInfo: {
1169
- url: FAKE_TURN_URL,
1170
- username: FAKE_TURN_USER,
1171
- password: FAKE_TURN_PASSWORD
1172
- }
1173
- }));
1184
+ assert.calledWith(
1185
+ Media.createMediaConnection,
1186
+ false,
1187
+ meeting.getMediaConnectionDebugId(),
1188
+ sinon.match({
1189
+ turnServerInfo: {
1190
+ url: FAKE_TURN_URL,
1191
+ username: FAKE_TURN_USER,
1192
+ password: FAKE_TURN_PASSWORD,
1193
+ },
1194
+ })
1195
+ );
1174
1196
  assert.calledOnce(fakeMediaConnection.initiateOffer);
1175
1197
  });
1176
1198
 
1177
1199
  it('should attach the media and return WebExMeetingsErrors when connection does not reach CONNECTED state', async () => {
1178
1200
  meeting.meetingState = 'ACTIVE';
1179
- fakeMediaConnection.getConnectionState = sinon.stub().returns(MC.ConnectionState.Connecting);
1201
+ fakeMediaConnection.getConnectionState = sinon
1202
+ .stub()
1203
+ .returns(MC.ConnectionState.Connecting);
1180
1204
  const clock = sinon.useFakeTimers();
1181
1205
  const media = meeting.addMedia({
1182
- mediaSettings: {}
1206
+ mediaSettings: {},
1183
1207
  });
1184
1208
 
1185
- await clock.tickAsync(4000 /* meetingState timer, hardcoded inside addMedia */ + PC_BAIL_TIMEOUT /* connection state timer */);
1209
+ await clock.tickAsync(
1210
+ 4000 /* meetingState timer, hardcoded inside addMedia */ +
1211
+ PC_BAIL_TIMEOUT /* connection state timer */
1212
+ );
1186
1213
  await testUtils.flushPromises();
1187
1214
 
1188
1215
  assert.exists(media);
@@ -1199,9 +1226,10 @@ describe('plugin-meetings', () => {
1199
1226
 
1200
1227
  let errorThrown = false;
1201
1228
 
1202
- await meeting.addMedia({
1203
- mediaSettings: {}
1204
- })
1229
+ await meeting
1230
+ .addMedia({
1231
+ mediaSettings: {},
1232
+ })
1205
1233
  .catch((error) => {
1206
1234
  assert.equal(error.code, IceGatheringFailed.CODE);
1207
1235
  errorThrown = true;
@@ -1213,19 +1241,15 @@ describe('plugin-meetings', () => {
1213
1241
  it('should send ADD_MEDIA_SUCCESS metrics', async () => {
1214
1242
  meeting.meetingState = 'ACTIVE';
1215
1243
  await meeting.addMedia({
1216
- mediaSettings: {}
1244
+ mediaSettings: {},
1217
1245
  });
1218
1246
 
1219
1247
  assert.calledOnce(Metrics.sendBehavioralMetric);
1220
- assert.calledWith(
1221
- Metrics.sendBehavioralMetric,
1222
- BEHAVIORAL_METRICS.ADD_MEDIA_SUCCESS,
1223
- {
1224
- correlation_id: meeting.correlationId,
1225
- locus_id: meeting.locusUrl.split('/').pop(),
1226
- connectionType: 'udp'
1227
- }
1228
- );
1248
+ assert.calledWith(Metrics.sendBehavioralMetric, BEHAVIORAL_METRICS.ADD_MEDIA_SUCCESS, {
1249
+ correlation_id: meeting.correlationId,
1250
+ locus_id: meeting.locusUrl.split('/').pop(),
1251
+ connectionType: 'udp',
1252
+ });
1229
1253
  });
1230
1254
 
1231
1255
  describe('handles StatsAnalyzer events', () => {
@@ -1243,7 +1267,7 @@ describe('plugin-meetings', () => {
1243
1267
  sinon.stub(StatsAnalyzerModule, 'StatsAnalyzer').returns(statsAnalyzerStub);
1244
1268
 
1245
1269
  await meeting.addMedia({
1246
- mediaSettings: {}
1270
+ mediaSettings: {},
1247
1271
  });
1248
1272
  });
1249
1273
 
@@ -1252,51 +1276,79 @@ describe('plugin-meetings', () => {
1252
1276
  });
1253
1277
 
1254
1278
  it('LOCAL_MEDIA_STARTED triggers "meeting:media:local:start" event and sends metrics', async () => {
1255
- statsAnalyzerStub.emit({file: 'test', function: 'test'}, StatsAnalyzerModule.EVENTS.LOCAL_MEDIA_STARTED, {type: 'audio'});
1279
+ statsAnalyzerStub.emit(
1280
+ {file: 'test', function: 'test'},
1281
+ StatsAnalyzerModule.EVENTS.LOCAL_MEDIA_STARTED,
1282
+ {type: 'audio'}
1283
+ );
1256
1284
 
1257
1285
  assert.calledWith(
1258
1286
  TriggerProxy.trigger,
1259
1287
  sinon.match.instanceOf(Meeting),
1260
1288
  {
1261
1289
  file: 'meeting/index',
1262
- function: 'addMedia'
1290
+ function: 'addMedia',
1263
1291
  },
1264
1292
  EVENT_TRIGGERS.MEETING_MEDIA_LOCAL_STARTED,
1265
1293
  {
1266
- type: 'audio'
1294
+ type: 'audio',
1267
1295
  }
1268
1296
  );
1269
- assert.calledWithMatch(Metrics.postEvent, {event: eventType.SENDING_MEDIA_START, data: {mediaType: 'audio'}});
1297
+ assert.calledWithMatch(Metrics.postEvent, {
1298
+ event: eventType.SENDING_MEDIA_START,
1299
+ data: {mediaType: 'audio'},
1300
+ });
1270
1301
  });
1271
1302
 
1272
1303
  it('LOCAL_MEDIA_STOPPED triggers the right metrics', async () => {
1273
- statsAnalyzerStub.emit({file: 'test', function: 'test'}, StatsAnalyzerModule.EVENTS.LOCAL_MEDIA_STOPPED, {type: 'video'});
1304
+ statsAnalyzerStub.emit(
1305
+ {file: 'test', function: 'test'},
1306
+ StatsAnalyzerModule.EVENTS.LOCAL_MEDIA_STOPPED,
1307
+ {type: 'video'}
1308
+ );
1274
1309
 
1275
- assert.calledWithMatch(Metrics.postEvent, {event: eventType.SENDING_MEDIA_STOP, data: {mediaType: 'video'}});
1310
+ assert.calledWithMatch(Metrics.postEvent, {
1311
+ event: eventType.SENDING_MEDIA_STOP,
1312
+ data: {mediaType: 'video'},
1313
+ });
1276
1314
  });
1277
1315
 
1278
1316
  it('REMOTE_MEDIA_STARTED triggers "meeting:media:remote:start" event and sends metrics', async () => {
1279
- statsAnalyzerStub.emit({file: 'test', function: 'test'}, StatsAnalyzerModule.EVENTS.REMOTE_MEDIA_STARTED, {type: 'video'});
1317
+ statsAnalyzerStub.emit(
1318
+ {file: 'test', function: 'test'},
1319
+ StatsAnalyzerModule.EVENTS.REMOTE_MEDIA_STARTED,
1320
+ {type: 'video'}
1321
+ );
1280
1322
 
1281
1323
  assert.calledWith(
1282
1324
  TriggerProxy.trigger,
1283
1325
  sinon.match.instanceOf(Meeting),
1284
1326
  {
1285
1327
  file: 'meeting/index',
1286
- function: 'addMedia'
1328
+ function: 'addMedia',
1287
1329
  },
1288
1330
  EVENT_TRIGGERS.MEETING_MEDIA_REMOTE_STARTED,
1289
1331
  {
1290
- type: 'video'
1332
+ type: 'video',
1291
1333
  }
1292
1334
  );
1293
- assert.calledWithMatch(Metrics.postEvent, {event: eventType.RECEIVING_MEDIA_START, data: {mediaType: 'video'}});
1335
+ assert.calledWithMatch(Metrics.postEvent, {
1336
+ event: eventType.RECEIVING_MEDIA_START,
1337
+ data: {mediaType: 'video'},
1338
+ });
1294
1339
  });
1295
1340
 
1296
1341
  it('REMOTE_MEDIA_STOPPED triggers the right metrics', async () => {
1297
- statsAnalyzerStub.emit({file: 'test', function: 'test'}, StatsAnalyzerModule.EVENTS.REMOTE_MEDIA_STOPPED, {type: 'audio'});
1342
+ statsAnalyzerStub.emit(
1343
+ {file: 'test', function: 'test'},
1344
+ StatsAnalyzerModule.EVENTS.REMOTE_MEDIA_STOPPED,
1345
+ {type: 'audio'}
1346
+ );
1298
1347
 
1299
- assert.calledWithMatch(Metrics.postEvent, {event: eventType.RECEIVING_MEDIA_STOP, data: {mediaType: 'audio'}});
1348
+ assert.calledWithMatch(Metrics.postEvent, {
1349
+ event: eventType.RECEIVING_MEDIA_STOP,
1350
+ data: {mediaType: 'audio'},
1351
+ });
1300
1352
  });
1301
1353
 
1302
1354
  it('MEDIA_QUALITY triggers the right metrics', async () => {
@@ -1308,7 +1360,10 @@ describe('plugin-meetings', () => {
1308
1360
  {data: fakeData, networkType: 'wifi'}
1309
1361
  );
1310
1362
 
1311
- assert.calledWithMatch(Metrics.postEvent, {event: eventType.MEDIA_QUALITY, data: {intervalData: fakeData, networkType: 'wifi'}});
1363
+ assert.calledWithMatch(Metrics.postEvent, {
1364
+ event: eventType.MEDIA_QUALITY,
1365
+ data: {intervalData: fakeData, networkType: 'wifi'},
1366
+ });
1312
1367
  });
1313
1368
  });
1314
1369
  });
@@ -1371,7 +1426,9 @@ describe('plugin-meetings', () => {
1371
1426
  sandbox = sinon.createSandbox();
1372
1427
  meeting.meetingFiniteStateMachine.ring();
1373
1428
  meeting.meetingFiniteStateMachine.join();
1374
- meeting.meetingRequest.leaveMeeting = sinon.stub().returns(Promise.resolve({body: 'test'}));
1429
+ meeting.meetingRequest.leaveMeeting = sinon
1430
+ .stub()
1431
+ .returns(Promise.resolve({body: 'test'}));
1375
1432
  meeting.locusInfo.onFullLocus = sinon.stub().returns(true);
1376
1433
  // the 3 need to be promises because we do closeLocalStream.then(closeLocalShare.then) etc in the src code
1377
1434
  meeting.closeLocalStream = sinon.stub().returns(Promise.resolve());
@@ -1441,7 +1498,7 @@ describe('plugin-meetings', () => {
1441
1498
  correlationId: meeting.correlationId,
1442
1499
  selfId: meeting.selfId,
1443
1500
  resourceId: null,
1444
- deviceUrl: meeting.deviceUrl
1501
+ deviceUrl: meeting.deviceUrl,
1445
1502
  });
1446
1503
  });
1447
1504
  it('should leave the meeting on the resource', async () => {
@@ -1454,7 +1511,7 @@ describe('plugin-meetings', () => {
1454
1511
  correlationId: meeting.correlationId,
1455
1512
  selfId: meeting.selfId,
1456
1513
  resourceId: meeting.resourceId,
1457
- deviceUrl: meeting.deviceUrl
1514
+ deviceUrl: meeting.deviceUrl,
1458
1515
  });
1459
1516
  });
1460
1517
  });
@@ -1481,7 +1538,9 @@ describe('plugin-meetings', () => {
1481
1538
 
1482
1539
  beforeEach(() => {
1483
1540
  _mediaDirection = meeting.mediaProperties.mediaDirection || {};
1484
- sinon.stub(meeting.mediaProperties, 'mediaDirection').value({sendAudio: true, sendVideo: true, sendShare: false});
1541
+ sinon
1542
+ .stub(meeting.mediaProperties, 'mediaDirection')
1543
+ .value({sendAudio: true, sendVideo: true, sendShare: false});
1485
1544
  });
1486
1545
 
1487
1546
  afterEach(() => {
@@ -1518,7 +1577,11 @@ describe('plugin-meetings', () => {
1518
1577
  it('properly assigns default values', async () => {
1519
1578
  await meeting.shareScreen({sharePreferences: {highFrameRate: true}});
1520
1579
 
1521
- assert.calledWith(Media.getDisplayMedia, {sendShare: true, sendAudio: false, sharePreferences: {highFrameRate: true}});
1580
+ assert.calledWith(Media.getDisplayMedia, {
1581
+ sendShare: true,
1582
+ sendAudio: false,
1583
+ sharePreferences: {highFrameRate: true},
1584
+ });
1522
1585
  });
1523
1586
  });
1524
1587
 
@@ -1548,18 +1611,17 @@ describe('plugin-meetings', () => {
1548
1611
  sendShare,
1549
1612
  receiveShare,
1550
1613
  stream,
1551
- skipSignalingCheck: true
1614
+ skipSignalingCheck: true,
1552
1615
  });
1553
1616
 
1554
1617
  assert.notCalled(meeting.canUpdateMedia);
1555
1618
  });
1556
1619
 
1557
-
1558
1620
  it('skips canUpdateMedia() check on contentTracks.onended', () => {
1559
1621
  const {mediaProperties} = meeting;
1560
1622
  const fakeTrack = {
1561
1623
  getSettings: sinon.stub().returns({}),
1562
- onended: sinon.stub()
1624
+ onended: sinon.stub(),
1563
1625
  };
1564
1626
 
1565
1627
  sandbox.stub(mediaProperties, 'setLocalShareTrack');
@@ -1573,12 +1635,11 @@ describe('plugin-meetings', () => {
1573
1635
  assert.calledWith(meeting.stopShare, {skipSignalingCheck: true});
1574
1636
  });
1575
1637
 
1576
-
1577
1638
  it('stopShare accepts and passes along optional parameters', () => {
1578
1639
  const args = {
1579
1640
  abc: 123,
1580
1641
  receiveShare: false,
1581
- sendShare: false
1642
+ sendShare: false,
1582
1643
  };
1583
1644
 
1584
1645
  sandbox.stub(meeting, 'updateShare').returns(Promise.resolve());
@@ -1615,12 +1676,12 @@ describe('plugin-meetings', () => {
1615
1676
  sinon.match.instanceOf(Meeting),
1616
1677
  {
1617
1678
  file: 'meeting/index',
1618
- function: 'handleShareTrackEnded'
1679
+ function: 'handleShareTrackEnded',
1619
1680
  },
1620
1681
  EVENT_TRIGGERS.MEETING_STOPPED_SHARING_LOCAL,
1621
1682
  {
1622
1683
  stream,
1623
- type: EVENT_TYPES.LOCAL_SHARE
1684
+ type: EVENT_TYPES.LOCAL_SHARE,
1624
1685
  }
1625
1686
  );
1626
1687
  });
@@ -1633,20 +1694,22 @@ describe('plugin-meetings', () => {
1633
1694
  const {resolution} = config;
1634
1695
  const shareOptions = {
1635
1696
  sendShare: true,
1636
- sendAudio: false
1697
+ sendAudio: false,
1637
1698
  };
1638
1699
  const fireFoxOptions = {
1639
1700
  audio: false,
1640
1701
  video: {
1641
1702
  audio: shareOptions.sendAudio,
1642
- video: shareOptions.sendShare
1643
- }
1703
+ video: shareOptions.sendShare,
1704
+ },
1644
1705
  };
1645
1706
 
1646
1707
  const MediaStream = {
1647
- getVideoTracks: () => [{
1648
- applyConstraints: () => {}
1649
- }]
1708
+ getVideoTracks: () => [
1709
+ {
1710
+ applyConstraints: () => {},
1711
+ },
1712
+ ],
1650
1713
  };
1651
1714
 
1652
1715
  const MediaConstraint = {
@@ -1654,7 +1717,7 @@ describe('plugin-meetings', () => {
1654
1717
  aspectRatio: config.aspectRatio,
1655
1718
  frameRate: config.screenFrameRate,
1656
1719
  width: null,
1657
- height: null
1720
+ height: null,
1658
1721
  };
1659
1722
 
1660
1723
  const browserConditionalValue = (value) => {
@@ -1670,31 +1733,23 @@ describe('plugin-meetings', () => {
1670
1733
  if (!global.navigator) {
1671
1734
  global.navigator = {
1672
1735
  mediaDevices: {
1673
- getDisplayMedia: null
1674
- }
1736
+ getDisplayMedia: null,
1737
+ },
1675
1738
  };
1676
1739
  }
1677
1740
  _getDisplayMedia = global.navigator.mediaDevices.getDisplayMedia;
1678
- Object.defineProperty(
1679
- global.navigator.mediaDevices,
1680
- 'getDisplayMedia',
1681
- {
1682
- value: sinon.stub().returns(Promise.resolve(MediaStream)),
1683
- writable: true
1684
- }
1685
- );
1741
+ Object.defineProperty(global.navigator.mediaDevices, 'getDisplayMedia', {
1742
+ value: sinon.stub().returns(Promise.resolve(MediaStream)),
1743
+ writable: true,
1744
+ });
1686
1745
  });
1687
1746
 
1688
1747
  after(() => {
1689
1748
  // clean up for browser
1690
- Object.defineProperty(
1691
- global.navigator.mediaDevices,
1692
- 'getDisplayMedia',
1693
- {
1694
- value: _getDisplayMedia,
1695
- writable: true
1696
- }
1697
- );
1749
+ Object.defineProperty(global.navigator.mediaDevices, 'getDisplayMedia', {
1750
+ value: _getDisplayMedia,
1751
+ writable: true,
1752
+ });
1698
1753
  });
1699
1754
 
1700
1755
  // eslint-disable-next-line max-len
@@ -1706,39 +1761,48 @@ describe('plugin-meetings', () => {
1706
1761
  maxWidth: SHARE_WIDTH,
1707
1762
  maxHeight: SHARE_HEIGHT,
1708
1763
  idealWidth: SHARE_WIDTH,
1709
- idealHeight: SHARE_HEIGHT
1764
+ idealHeight: SHARE_HEIGHT,
1710
1765
  };
1711
1766
 
1712
1767
  // If sharePreferences.shareConstraints is defined it ignores
1713
1768
  // default SDK config settings
1714
- getDisplayMedia({
1715
- ...shareOptions,
1716
- sharePreferences: {shareConstraints}
1717
- }, config);
1769
+ getDisplayMedia(
1770
+ {
1771
+ ...shareOptions,
1772
+ sharePreferences: {shareConstraints},
1773
+ },
1774
+ config
1775
+ );
1718
1776
 
1719
1777
  // eslint-disable-next-line no-undef
1720
- assert.calledWith(navigator.mediaDevices.getDisplayMedia,
1778
+ assert.calledWith(
1779
+ navigator.mediaDevices.getDisplayMedia,
1721
1780
  browserConditionalValue({
1722
1781
  default: {
1723
- video: {...shareConstraints}
1782
+ video: {...shareConstraints},
1724
1783
  },
1725
1784
  // Firefox is being handled differently
1726
- firefox: fireFoxOptions
1727
- }));
1785
+ firefox: fireFoxOptions,
1786
+ })
1787
+ );
1728
1788
  });
1729
1789
 
1730
1790
  // eslint-disable-next-line max-len
1731
1791
  it('will use default resolution if shareConstraints is undefined and highFrameRate is defined', () => {
1732
1792
  // If highFrameRate is defined it ignores default SDK config settings
1733
- getDisplayMedia({
1734
- ...shareOptions,
1735
- sharePreferences: {
1736
- highFrameRate: true
1737
- }
1738
- }, config);
1793
+ getDisplayMedia(
1794
+ {
1795
+ ...shareOptions,
1796
+ sharePreferences: {
1797
+ highFrameRate: true,
1798
+ },
1799
+ },
1800
+ config
1801
+ );
1739
1802
 
1740
1803
  // eslint-disable-next-line no-undef
1741
- assert.calledWith(navigator.mediaDevices.getDisplayMedia,
1804
+ assert.calledWith(
1805
+ navigator.mediaDevices.getDisplayMedia,
1742
1806
  browserConditionalValue({
1743
1807
  default: {
1744
1808
  video: {
@@ -1749,11 +1813,12 @@ describe('plugin-meetings', () => {
1749
1813
  maxWidth: resolution.maxWidth,
1750
1814
  maxHeight: resolution.maxHeight,
1751
1815
  idealWidth: resolution.idealWidth,
1752
- idealHeight: resolution.idealHeight
1753
- }
1816
+ idealHeight: resolution.idealHeight,
1817
+ },
1754
1818
  },
1755
- firefox: fireFoxOptions
1756
- }));
1819
+ firefox: fireFoxOptions,
1820
+ })
1821
+ );
1757
1822
  });
1758
1823
 
1759
1824
  // eslint-disable-next-line max-len
@@ -1762,17 +1827,19 @@ describe('plugin-meetings', () => {
1762
1827
  const {screenResolution} = config;
1763
1828
 
1764
1829
  // eslint-disable-next-line no-undef
1765
- assert.calledWith(navigator.mediaDevices.getDisplayMedia,
1830
+ assert.calledWith(
1831
+ navigator.mediaDevices.getDisplayMedia,
1766
1832
  browserConditionalValue({
1767
1833
  default: {
1768
1834
  video: {
1769
1835
  ...MediaConstraint,
1770
1836
  width: screenResolution.idealWidth,
1771
- height: screenResolution.idealHeight
1772
- }
1837
+ height: screenResolution.idealHeight,
1838
+ },
1773
1839
  },
1774
- firefox: fireFoxOptions
1775
- }));
1840
+ firefox: fireFoxOptions,
1841
+ })
1842
+ );
1776
1843
  });
1777
1844
 
1778
1845
  // Test screenResolution
@@ -1785,14 +1852,15 @@ describe('plugin-meetings', () => {
1785
1852
  maxWidth: SHARE_WIDTH,
1786
1853
  maxHeight: SHARE_HEIGHT,
1787
1854
  idealWidth: SHARE_WIDTH,
1788
- idealHeight: SHARE_HEIGHT
1789
- }
1855
+ idealHeight: SHARE_HEIGHT,
1856
+ },
1790
1857
  };
1791
1858
 
1792
1859
  getDisplayMedia(shareOptions, customConfig);
1793
1860
 
1794
1861
  // eslint-disable-next-line no-undef
1795
- assert.calledWith(navigator.mediaDevices.getDisplayMedia,
1862
+ assert.calledWith(
1863
+ navigator.mediaDevices.getDisplayMedia,
1796
1864
  browserConditionalValue({
1797
1865
  default: {
1798
1866
  video: {
@@ -1802,11 +1870,12 @@ describe('plugin-meetings', () => {
1802
1870
  maxWidth: SHARE_WIDTH,
1803
1871
  maxHeight: SHARE_HEIGHT,
1804
1872
  idealWidth: SHARE_WIDTH,
1805
- idealHeight: SHARE_HEIGHT
1806
- }
1873
+ idealHeight: SHARE_HEIGHT,
1874
+ },
1807
1875
  },
1808
- firefox: fireFoxOptions
1809
- }));
1876
+ firefox: fireFoxOptions,
1877
+ })
1878
+ );
1810
1879
  });
1811
1880
 
1812
1881
  // Test screenFrameRate
@@ -1819,14 +1888,15 @@ describe('plugin-meetings', () => {
1819
1888
  maxWidth: SHARE_WIDTH,
1820
1889
  maxHeight: SHARE_HEIGHT,
1821
1890
  idealWidth: SHARE_WIDTH,
1822
- idealHeight: SHARE_HEIGHT
1823
- }
1891
+ idealHeight: SHARE_HEIGHT,
1892
+ },
1824
1893
  };
1825
1894
 
1826
1895
  getDisplayMedia(shareOptions, customConfig);
1827
1896
 
1828
1897
  // eslint-disable-next-line no-undef
1829
- assert.calledWith(navigator.mediaDevices.getDisplayMedia,
1898
+ assert.calledWith(
1899
+ navigator.mediaDevices.getDisplayMedia,
1830
1900
  browserConditionalValue({
1831
1901
  default: {
1832
1902
  video: {
@@ -1837,11 +1907,12 @@ describe('plugin-meetings', () => {
1837
1907
  maxWidth: SHARE_WIDTH,
1838
1908
  maxHeight: SHARE_HEIGHT,
1839
1909
  idealWidth: SHARE_WIDTH,
1840
- idealHeight: SHARE_HEIGHT
1841
- }
1910
+ idealHeight: SHARE_HEIGHT,
1911
+ },
1842
1912
  },
1843
- firefox: fireFoxOptions
1844
- }));
1913
+ firefox: fireFoxOptions,
1914
+ })
1915
+ );
1845
1916
  });
1846
1917
  });
1847
1918
 
@@ -1883,22 +1954,35 @@ describe('plugin-meetings', () => {
1883
1954
  receiveVideo: true,
1884
1955
  receiveShare: true,
1885
1956
  };
1886
- meeting.mediaProperties.webrtcMediaConnection = {updateSendReceiveOptions: sinon.stub()};
1957
+ meeting.mediaProperties.webrtcMediaConnection = {
1958
+ updateSendReceiveOptions: sinon.stub(),
1959
+ };
1887
1960
  sinon.stub(MeetingUtil, 'getTrack').returns({audioTrack: FAKE_AUDIO_TRACK});
1888
1961
  });
1889
- it('calls this.mediaProperties.webrtcMediaConnection.updateSendReceiveOptions', () => meeting.updateAudio({
1890
- sendAudio: true,
1891
- receiveAudio: true,
1892
- stream: {id: 'fake stream'}
1893
- }).then(() => {
1894
- assert.calledOnce(meeting.mediaProperties.webrtcMediaConnection.updateSendReceiveOptions);
1895
- assert.calledWith(meeting.mediaProperties.webrtcMediaConnection.updateSendReceiveOptions, {
1896
- send: {audio: FAKE_AUDIO_TRACK},
1897
- receive: {
1898
- audio: true, video: true, screenShareVideo: true, remoteQualityLevel: 'HIGH'
1899
- }
1900
- });
1901
- }));
1962
+ it('calls this.mediaProperties.webrtcMediaConnection.updateSendReceiveOptions', () =>
1963
+ meeting
1964
+ .updateAudio({
1965
+ sendAudio: true,
1966
+ receiveAudio: true,
1967
+ stream: {id: 'fake stream'},
1968
+ })
1969
+ .then(() => {
1970
+ assert.calledOnce(
1971
+ meeting.mediaProperties.webrtcMediaConnection.updateSendReceiveOptions
1972
+ );
1973
+ assert.calledWith(
1974
+ meeting.mediaProperties.webrtcMediaConnection.updateSendReceiveOptions,
1975
+ {
1976
+ send: {audio: FAKE_AUDIO_TRACK},
1977
+ receive: {
1978
+ audio: true,
1979
+ video: true,
1980
+ screenShareVideo: true,
1981
+ remoteQualityLevel: 'HIGH',
1982
+ },
1983
+ }
1984
+ );
1985
+ }));
1902
1986
  });
1903
1987
  afterEach(() => {
1904
1988
  sinon.restore();
@@ -1918,7 +2002,7 @@ describe('plugin-meetings', () => {
1918
2002
 
1919
2003
  meeting.locusInfo.self = {
1920
2004
  enableDTMF: true,
1921
- url: url2
2005
+ url: url2,
1922
2006
  };
1923
2007
 
1924
2008
  await meeting.sendDTMF(tones);
@@ -1926,7 +2010,7 @@ describe('plugin-meetings', () => {
1926
2010
  assert.calledWith(meeting.meetingRequest.sendDTMF, {
1927
2011
  locusUrl: meeting.locusInfo.self.url,
1928
2012
  deviceUrl: meeting.deviceUrl,
1929
- tones
2013
+ tones,
1930
2014
  });
1931
2015
  });
1932
2016
 
@@ -1940,7 +2024,7 @@ describe('plugin-meetings', () => {
1940
2024
  it('should throw an error', () => {
1941
2025
  meeting.locusInfo.self = {
1942
2026
  enableDTMF: false,
1943
- url: url2
2027
+ url: url2,
1944
2028
  };
1945
2029
 
1946
2030
  assert.isRejected(meeting.sendDTMF('123'));
@@ -1965,7 +2049,6 @@ describe('plugin-meetings', () => {
1965
2049
  id: 'fake share track',
1966
2050
  getSettings: sinon.stub().returns({}),
1967
2051
  },
1968
-
1969
2052
  };
1970
2053
 
1971
2054
  beforeEach(() => {
@@ -1997,21 +2080,22 @@ describe('plugin-meetings', () => {
1997
2080
  receiveVideo: true,
1998
2081
  sendShare: true,
1999
2082
  receiveShare: true,
2000
- isSharing: true
2083
+ isSharing: true,
2001
2084
  };
2002
2085
 
2003
2086
  sandbox.stub(meeting, 'canUpdateMedia').returns(false);
2004
2087
  meeting.mediaProperties.webrtcMediaConnection = {
2005
- updateSendReceiveOptions: sinon.stub().resolves({})
2088
+ updateSendReceiveOptions: sinon.stub().resolves({}),
2006
2089
  };
2007
2090
 
2008
2091
  let myPromiseResolved = false;
2009
2092
 
2010
- meeting.updateMedia({
2011
- localStream: mockLocalStream,
2012
- localShare: mockLocalShare,
2013
- mediaSettings
2014
- })
2093
+ meeting
2094
+ .updateMedia({
2095
+ localStream: mockLocalStream,
2096
+ localShare: mockLocalShare,
2097
+ mediaSettings,
2098
+ })
2015
2099
  .then(() => {
2016
2100
  myPromiseResolved = true;
2017
2101
  });
@@ -2028,19 +2112,22 @@ describe('plugin-meetings', () => {
2028
2112
 
2029
2113
  // and check that updateSendReceiveOptions is called with the original args
2030
2114
  assert.calledOnce(meeting.mediaProperties.webrtcMediaConnection.updateSendReceiveOptions);
2031
- assert.calledWith(meeting.mediaProperties.webrtcMediaConnection.updateSendReceiveOptions, {
2032
- send: {
2033
- audio: FAKE_TRACKS.audio,
2034
- video: FAKE_TRACKS.video,
2035
- screenShareVideo: FAKE_TRACKS.screenshareVideo,
2036
- },
2037
- receive: {
2038
- audio: true,
2039
- video: true,
2040
- screenShareVideo: true,
2041
- remoteQualityLevel: 'HIGH'
2115
+ assert.calledWith(
2116
+ meeting.mediaProperties.webrtcMediaConnection.updateSendReceiveOptions,
2117
+ {
2118
+ send: {
2119
+ audio: FAKE_TRACKS.audio,
2120
+ video: FAKE_TRACKS.video,
2121
+ screenShareVideo: FAKE_TRACKS.screenshareVideo,
2122
+ },
2123
+ receive: {
2124
+ audio: true,
2125
+ video: true,
2126
+ screenShareVideo: true,
2127
+ remoteQualityLevel: 'HIGH',
2128
+ },
2042
2129
  }
2043
- });
2130
+ );
2044
2131
  assert.isTrue(myPromiseResolved);
2045
2132
  });
2046
2133
  });
@@ -2055,17 +2142,21 @@ describe('plugin-meetings', () => {
2055
2142
  sendAudio: true,
2056
2143
  sendVideo: true,
2057
2144
  sendShare: false,
2058
- receiveVideo: true
2145
+ receiveVideo: true,
2059
2146
  };
2060
2147
  meeting.getMediaStreams = sinon.stub().returns(Promise.resolve([]));
2061
2148
  meeting.updateVideo = sinon.stub().returns(Promise.resolve());
2062
2149
  meeting.mediaProperties.mediaDirection = mediaDirection;
2063
- meeting.mediaProperties.remoteVideoTrack = sinon.stub().returns({mockTrack: 'mockTrack'});
2150
+ meeting.mediaProperties.remoteVideoTrack = sinon
2151
+ .stub()
2152
+ .returns({mockTrack: 'mockTrack'});
2064
2153
 
2065
- meeting.meetingRequest.changeVideoLayoutDebounced = sinon.stub().returns(Promise.resolve());
2154
+ meeting.meetingRequest.changeVideoLayoutDebounced = sinon
2155
+ .stub()
2156
+ .returns(Promise.resolve());
2066
2157
 
2067
2158
  meeting.locusInfo.self = {
2068
- url: url2
2159
+ url: url2,
2069
2160
  };
2070
2161
  });
2071
2162
 
@@ -2094,11 +2185,11 @@ describe('plugin-meetings', () => {
2094
2185
  deviceUrl: meeting.deviceUrl,
2095
2186
  layoutType,
2096
2187
  main: undefined,
2097
- content: undefined
2188
+ content: undefined,
2098
2189
  });
2099
2190
  });
2100
2191
 
2101
- it('doesn\'t have layoutType which exists in the list of allowed layoutTypes should throw an error', async () => {
2192
+ it("doesn't have layoutType which exists in the list of allowed layoutTypes should throw an error", async () => {
2102
2193
  const layoutType = 'Invalid Layout';
2103
2194
 
2104
2195
  assert.isRejected(meeting.changeVideoLayout(layoutType));
@@ -2112,12 +2203,14 @@ describe('plugin-meetings', () => {
2112
2203
  deviceUrl: meeting.deviceUrl,
2113
2204
  layoutType: undefined,
2114
2205
  main: {width: 100, height: 200},
2115
- content: undefined
2206
+ content: undefined,
2116
2207
  });
2117
2208
  });
2118
2209
 
2119
2210
  it('throws if trying to send renderInfo for content when not receiving content', async () => {
2120
- assert.isRejected(meeting.changeVideoLayout(layoutTypeSingle, {content: {width: 1280, height: 720}}));
2211
+ assert.isRejected(
2212
+ meeting.changeVideoLayout(layoutTypeSingle, {content: {width: 1280, height: 720}})
2213
+ );
2121
2214
  });
2122
2215
 
2123
2216
  it('calls changeVideoLayoutDebounced with renderInfo for main and content', async () => {
@@ -2129,7 +2222,7 @@ describe('plugin-meetings', () => {
2129
2222
  deviceUrl: meeting.deviceUrl,
2130
2223
  layoutType: layoutTypeSingle,
2131
2224
  main: {width: 100, height: 200},
2132
- content: undefined
2225
+ content: undefined,
2133
2226
  });
2134
2227
 
2135
2228
  meeting.mediaProperties.mediaDirection.receiveShare = true;
@@ -2143,18 +2236,21 @@ describe('plugin-meetings', () => {
2143
2236
  deviceUrl: meeting.deviceUrl,
2144
2237
  layoutType: layoutTypeSingle,
2145
2238
  main: {width: 100, height: 200},
2146
- content: {width: 500, height: 600}
2239
+ content: {width: 500, height: 600},
2147
2240
  });
2148
2241
 
2149
2242
  // and now call with both
2150
- await meeting.changeVideoLayout(layoutTypeSingle, {main: {width: 300, height: 400}, content: {width: 700, height: 800}});
2243
+ await meeting.changeVideoLayout(layoutTypeSingle, {
2244
+ main: {width: 300, height: 400},
2245
+ content: {width: 700, height: 800},
2246
+ });
2151
2247
 
2152
2248
  assert.calledWith(meeting.meetingRequest.changeVideoLayoutDebounced, {
2153
2249
  locusUrl: meeting.locusInfo.self.url,
2154
2250
  deviceUrl: meeting.deviceUrl,
2155
2251
  layoutType: layoutTypeSingle,
2156
2252
  main: {width: 300, height: 400},
2157
- content: {width: 700, height: 800}
2253
+ content: {width: 700, height: 800},
2158
2254
  });
2159
2255
 
2160
2256
  // and now set just the layoutType, the previous main and content values should be used
@@ -2167,7 +2263,7 @@ describe('plugin-meetings', () => {
2167
2263
  deviceUrl: meeting.deviceUrl,
2168
2264
  layoutType,
2169
2265
  main: {width: 300, height: 400},
2170
- content: {width: 700, height: 800}
2266
+ content: {width: 700, height: 800},
2171
2267
  });
2172
2268
  });
2173
2269
 
@@ -2179,7 +2275,7 @@ describe('plugin-meetings', () => {
2179
2275
  deviceUrl: meeting.deviceUrl,
2180
2276
  layoutType: layoutTypeSingle,
2181
2277
  main: {width: 1024, height: 768},
2182
- content: undefined
2278
+ content: undefined,
2183
2279
  });
2184
2280
  meeting.meetingRequest.changeVideoLayoutDebounced.resetHistory();
2185
2281
 
@@ -2201,28 +2297,39 @@ describe('plugin-meetings', () => {
2201
2297
  meeting.mediaProperties.mediaDirection.receiveShare = true;
2202
2298
  meeting.mediaProperties.remoteShare = sinon.stub().returns({mockTrack: 'mockTrack'});
2203
2299
 
2204
- await meeting.changeVideoLayout(layoutTypeSingle, {main: {width: 500, height: 510}, content: {width: 1024, height: 768}});
2300
+ await meeting.changeVideoLayout(layoutTypeSingle, {
2301
+ main: {width: 500, height: 510},
2302
+ content: {width: 1024, height: 768},
2303
+ });
2205
2304
 
2206
2305
  assert.calledWith(meeting.meetingRequest.changeVideoLayoutDebounced, {
2207
2306
  locusUrl: meeting.locusInfo.self.url,
2208
2307
  deviceUrl: meeting.deviceUrl,
2209
2308
  layoutType: layoutTypeSingle,
2210
2309
  main: {width: 500, height: 510},
2211
- content: {width: 1024, height: 768}
2310
+ content: {width: 1024, height: 768},
2212
2311
  });
2213
2312
  meeting.meetingRequest.changeVideoLayoutDebounced.resetHistory();
2214
2313
 
2215
2314
  // now send main with width/height different by just 2px - it should be ignored
2216
- await meeting.changeVideoLayout(layoutTypeSingle, {content: {width: 1026, height: 768}});
2315
+ await meeting.changeVideoLayout(layoutTypeSingle, {
2316
+ content: {width: 1026, height: 768},
2317
+ });
2217
2318
  assert.notCalled(meeting.meetingRequest.changeVideoLayoutDebounced);
2218
2319
 
2219
- await meeting.changeVideoLayout(layoutTypeSingle, {content: {width: 1022, height: 768}});
2320
+ await meeting.changeVideoLayout(layoutTypeSingle, {
2321
+ content: {width: 1022, height: 768},
2322
+ });
2220
2323
  assert.notCalled(meeting.meetingRequest.changeVideoLayoutDebounced);
2221
2324
 
2222
- await meeting.changeVideoLayout(layoutTypeSingle, {content: {width: 1024, height: 770}});
2325
+ await meeting.changeVideoLayout(layoutTypeSingle, {
2326
+ content: {width: 1024, height: 770},
2327
+ });
2223
2328
  assert.notCalled(meeting.meetingRequest.changeVideoLayoutDebounced);
2224
2329
 
2225
- await meeting.changeVideoLayout(layoutTypeSingle, {content: {width: 1024, height: 766}});
2330
+ await meeting.changeVideoLayout(layoutTypeSingle, {
2331
+ content: {width: 1024, height: 766},
2332
+ });
2226
2333
  assert.notCalled(meeting.meetingRequest.changeVideoLayoutDebounced);
2227
2334
  });
2228
2335
 
@@ -2230,14 +2337,17 @@ describe('plugin-meetings', () => {
2230
2337
  meeting.mediaProperties.mediaDirection.receiveShare = true;
2231
2338
  meeting.mediaProperties.remoteShare = sinon.stub().returns({mockTrack: 'mockTrack'});
2232
2339
 
2233
- await meeting.changeVideoLayout(layoutTypeSingle, {main: {width: 500.5, height: 510.09}, content: {width: 1024.2, height: 768.85}});
2340
+ await meeting.changeVideoLayout(layoutTypeSingle, {
2341
+ main: {width: 500.5, height: 510.09},
2342
+ content: {width: 1024.2, height: 768.85},
2343
+ });
2234
2344
 
2235
2345
  assert.calledWith(meeting.meetingRequest.changeVideoLayoutDebounced, {
2236
2346
  locusUrl: meeting.locusInfo.self.url,
2237
2347
  deviceUrl: meeting.deviceUrl,
2238
2348
  layoutType: layoutTypeSingle,
2239
2349
  main: {width: 501, height: 510},
2240
- content: {width: 1024, height: 769}
2350
+ content: {width: 1024, height: 769},
2241
2351
  });
2242
2352
  });
2243
2353
  });
@@ -2249,7 +2359,7 @@ describe('plugin-meetings', () => {
2249
2359
  sendAudio: true,
2250
2360
  sendVideo: true,
2251
2361
  sendShare: false,
2252
- receiveVideo: true
2362
+ receiveVideo: true,
2253
2363
  };
2254
2364
 
2255
2365
  meeting.mediaProperties.mediaDirection = mediaDirection;
@@ -2263,7 +2373,7 @@ describe('plugin-meetings', () => {
2263
2373
  sendAudio: true,
2264
2374
  sendVideo: true,
2265
2375
  sendShare: false,
2266
- receiveVideo: false
2376
+ receiveVideo: false,
2267
2377
  };
2268
2378
 
2269
2379
  meeting.mediaProperties.mediaDirection = mediaDirection;
@@ -2277,8 +2387,8 @@ describe('plugin-meetings', () => {
2277
2387
 
2278
2388
  const fakeTrack = {getSettings: () => ({height: 720})};
2279
2389
  const USER_AGENT_CHROME_MAC =
2280
- 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) ' +
2281
- 'AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.85 Safari/537.36';
2390
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) ' +
2391
+ 'AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.85 Safari/537.36';
2282
2392
 
2283
2393
  beforeEach(() => {
2284
2394
  mediaDirection = {sendAudio: true, sendVideo: true, sendShare: false};
@@ -2294,34 +2404,36 @@ describe('plugin-meetings', () => {
2294
2404
  assert.exists(meeting.setLocalVideoQuality);
2295
2405
  });
2296
2406
 
2297
- it('should call getMediaStreams with the proper level', () => meeting.setLocalVideoQuality(CONSTANTS.QUALITY_LEVELS.LOW).then(() => {
2298
- delete mediaDirection.receiveVideo;
2299
- assert.calledWith(meeting.getMediaStreams,
2300
- mediaDirection,
2301
- CONSTANTS.VIDEO_RESOLUTIONS[CONSTANTS.QUALITY_LEVELS.LOW]);
2302
- }));
2407
+ it('should call getMediaStreams with the proper level', () =>
2408
+ meeting.setLocalVideoQuality(CONSTANTS.QUALITY_LEVELS.LOW).then(() => {
2409
+ delete mediaDirection.receiveVideo;
2410
+ assert.calledWith(
2411
+ meeting.getMediaStreams,
2412
+ mediaDirection,
2413
+ CONSTANTS.VIDEO_RESOLUTIONS[CONSTANTS.QUALITY_LEVELS.LOW]
2414
+ );
2415
+ }));
2303
2416
 
2304
2417
  it('when browser is chrome then it should stop previous video track', () => {
2305
2418
  meeting.mediaProperties.videoTrack = fakeTrack;
2306
- assert.equal(
2307
- BrowserDetection(USER_AGENT_CHROME_MAC).getBrowserName(),
2308
- 'Chrome'
2309
- );
2310
- meeting.setLocalVideoQuality(CONSTANTS.QUALITY_LEVELS.LOW)
2311
- .then(() => {
2312
- assert.calledWith(Media.stopTracks, fakeTrack);
2313
- });
2419
+ assert.equal(BrowserDetection(USER_AGENT_CHROME_MAC).getBrowserName(), 'Chrome');
2420
+ meeting.setLocalVideoQuality(CONSTANTS.QUALITY_LEVELS.LOW).then(() => {
2421
+ assert.calledWith(Media.stopTracks, fakeTrack);
2422
+ });
2314
2423
  });
2315
2424
 
2316
- it('should set mediaProperty with the proper level', () => meeting.setLocalVideoQuality(CONSTANTS.QUALITY_LEVELS.LOW).then(() => {
2317
- assert.equal(meeting.mediaProperties.localQualityLevel, CONSTANTS.QUALITY_LEVELS.LOW);
2318
- }));
2425
+ it('should set mediaProperty with the proper level', () =>
2426
+ meeting.setLocalVideoQuality(CONSTANTS.QUALITY_LEVELS.LOW).then(() => {
2427
+ assert.equal(meeting.mediaProperties.localQualityLevel, CONSTANTS.QUALITY_LEVELS.LOW);
2428
+ }));
2319
2429
 
2320
2430
  it('when device does not support 1080p then it should set localQualityLevel with highest possible resolution', () => {
2321
- meeting.setLocalVideoQuality(CONSTANTS.QUALITY_LEVELS['1080p'])
2322
- .then(() => {
2323
- assert.equal(meeting.mediaProperties.localQualityLevel, CONSTANTS.QUALITY_LEVELS['720p']);
2324
- });
2431
+ meeting.setLocalVideoQuality(CONSTANTS.QUALITY_LEVELS['1080p']).then(() => {
2432
+ assert.equal(
2433
+ meeting.mediaProperties.localQualityLevel,
2434
+ CONSTANTS.QUALITY_LEVELS['720p']
2435
+ );
2436
+ });
2325
2437
  });
2326
2438
 
2327
2439
  it('should error if set to a invalid level', () => {
@@ -2347,13 +2459,15 @@ describe('plugin-meetings', () => {
2347
2459
  assert.exists(meeting.setRemoteQualityLevel);
2348
2460
  });
2349
2461
 
2350
- it('should set mediaProperty with the proper level', () => meeting.setRemoteQualityLevel(CONSTANTS.QUALITY_LEVELS.LOW).then(() => {
2351
- assert.equal(meeting.mediaProperties.remoteQualityLevel, CONSTANTS.QUALITY_LEVELS.LOW);
2352
- }));
2462
+ it('should set mediaProperty with the proper level', () =>
2463
+ meeting.setRemoteQualityLevel(CONSTANTS.QUALITY_LEVELS.LOW).then(() => {
2464
+ assert.equal(meeting.mediaProperties.remoteQualityLevel, CONSTANTS.QUALITY_LEVELS.LOW);
2465
+ }));
2353
2466
 
2354
- it('should call updateMedia', () => meeting.setRemoteQualityLevel(CONSTANTS.QUALITY_LEVELS.LOW).then(() => {
2355
- assert.calledOnce(meeting.updateMedia);
2356
- }));
2467
+ it('should call updateMedia', () =>
2468
+ meeting.setRemoteQualityLevel(CONSTANTS.QUALITY_LEVELS.LOW).then(() => {
2469
+ assert.calledOnce(meeting.updateMedia);
2470
+ }));
2357
2471
 
2358
2472
  it('should error if set to a invalid level', () => {
2359
2473
  assert.isRejected(meeting.setRemoteQualityLevel('invalid'));
@@ -2367,8 +2481,12 @@ describe('plugin-meetings', () => {
2367
2481
 
2368
2482
  describe('#usePhoneAudio', () => {
2369
2483
  beforeEach(() => {
2370
- meeting.meetingRequest.dialIn = sinon.stub().returns(Promise.resolve({body: {locus: 'testData'}}));
2371
- meeting.meetingRequest.dialOut = sinon.stub().returns(Promise.resolve({body: {locus: 'testData'}}));
2484
+ meeting.meetingRequest.dialIn = sinon
2485
+ .stub()
2486
+ .returns(Promise.resolve({body: {locus: 'testData'}}));
2487
+ meeting.meetingRequest.dialOut = sinon
2488
+ .stub()
2489
+ .returns(Promise.resolve({body: {locus: 'testData'}}));
2372
2490
  meeting.locusInfo.onFullLocus = sinon.stub().returns(Promise.resolve());
2373
2491
  });
2374
2492
 
@@ -2380,7 +2498,7 @@ describe('plugin-meetings', () => {
2380
2498
  correlationId: meeting.correlationId,
2381
2499
  dialInUrl: DIAL_IN_URL,
2382
2500
  locusUrl: meeting.locusUrl,
2383
- clientUrl: meeting.deviceUrl
2501
+ clientUrl: meeting.deviceUrl,
2384
2502
  });
2385
2503
  assert.calledWith(meeting.locusInfo.onFullLocus, 'testData');
2386
2504
  assert.notCalled(meeting.meetingRequest.dialOut);
@@ -2395,7 +2513,7 @@ describe('plugin-meetings', () => {
2395
2513
  correlationId: meeting.correlationId,
2396
2514
  dialInUrl: DIAL_IN_URL,
2397
2515
  locusUrl: meeting.locusUrl,
2398
- clientUrl: meeting.deviceUrl
2516
+ clientUrl: meeting.deviceUrl,
2399
2517
  });
2400
2518
  assert.calledWith(meeting.locusInfo.onFullLocus, 'testData');
2401
2519
  assert.notCalled(meeting.meetingRequest.dialOut);
@@ -2412,7 +2530,7 @@ describe('plugin-meetings', () => {
2412
2530
  dialOutUrl: DIAL_OUT_URL,
2413
2531
  locusUrl: meeting.locusUrl,
2414
2532
  clientUrl: meeting.deviceUrl,
2415
- phoneNumber
2533
+ phoneNumber,
2416
2534
  });
2417
2535
  assert.calledWith(meeting.locusInfo.onFullLocus, 'testData');
2418
2536
  assert.notCalled(meeting.meetingRequest.dialIn);
@@ -2428,7 +2546,7 @@ describe('plugin-meetings', () => {
2428
2546
  dialOutUrl: DIAL_OUT_URL,
2429
2547
  locusUrl: meeting.locusUrl,
2430
2548
  clientUrl: meeting.deviceUrl,
2431
- phoneNumber
2549
+ phoneNumber,
2432
2550
  });
2433
2551
  assert.calledWith(meeting.locusInfo.onFullLocus, 'testData');
2434
2552
  assert.notCalled(meeting.meetingRequest.dialIn);
@@ -2439,11 +2557,14 @@ describe('plugin-meetings', () => {
2439
2557
 
2440
2558
  meeting.meetingRequest.dialIn = sinon.stub().returns(Promise.reject(error));
2441
2559
 
2442
- return meeting.usePhoneAudio().then(() => Promise.reject(new Error('Promise resolved when it should have rejected'))).catch((e) => {
2443
- assert.equal(e, error);
2560
+ return meeting
2561
+ .usePhoneAudio()
2562
+ .then(() => Promise.reject(new Error('Promise resolved when it should have rejected')))
2563
+ .catch((e) => {
2564
+ assert.equal(e, error);
2444
2565
 
2445
- return Promise.resolve();
2446
- });
2566
+ return Promise.resolve();
2567
+ });
2447
2568
  });
2448
2569
 
2449
2570
  it('rejects if the request failed (dial out)', async () => {
@@ -2451,11 +2572,14 @@ describe('plugin-meetings', () => {
2451
2572
 
2452
2573
  meeting.meetingRequest.dialOut = sinon.stub().returns(Promise.reject(error));
2453
2574
 
2454
- return meeting.usePhoneAudio('+441234567890').then(() => Promise.reject(new Error('Promise resolved when it should have rejected'))).catch((e) => {
2455
- assert.equal(e, error);
2575
+ return meeting
2576
+ .usePhoneAudio('+441234567890')
2577
+ .then(() => Promise.reject(new Error('Promise resolved when it should have rejected')))
2578
+ .catch((e) => {
2579
+ assert.equal(e, error);
2456
2580
 
2457
- return Promise.resolve();
2458
- });
2581
+ return Promise.resolve();
2582
+ });
2459
2583
  });
2460
2584
  });
2461
2585
 
@@ -2474,34 +2598,42 @@ describe('plugin-meetings', () => {
2474
2598
  locusUrl: 'some_locus_url',
2475
2599
  sipUrl: 'some_sip_url', // or sipMeetingUri
2476
2600
  meetingNumber: '123456', // this.config.experimental.enableUnifiedMeetings
2477
- hostId: 'some_host_id' // this.owner;
2601
+ hostId: 'some_host_id', // this.owner;
2478
2602
  };
2479
2603
  const FAKE_SDK_CAPTCHA_INFO = {
2480
2604
  captchaId: FAKE_CAPTCHA_ID,
2481
2605
  verificationImageURL: FAKE_CAPTCHA_IMAGE_URL,
2482
2606
  verificationAudioURL: FAKE_CAPTCHA_AUDIO_URL,
2483
- refreshURL: FAKE_CAPTCHA_REFRESH_URL
2607
+ refreshURL: FAKE_CAPTCHA_REFRESH_URL,
2484
2608
  };
2485
2609
  const FAKE_WBXAPPAPI_CAPTCHA_INFO = {
2486
2610
  captchaID: `${FAKE_CAPTCHA_ID}-2`,
2487
2611
  verificationImageURL: `${FAKE_CAPTCHA_IMAGE_URL}-2`,
2488
2612
  verificationAudioURL: `${FAKE_CAPTCHA_AUDIO_URL}-2`,
2489
- refreshURL: `${FAKE_CAPTCHA_REFRESH_URL}-2`
2613
+ refreshURL: `${FAKE_CAPTCHA_REFRESH_URL}-2`,
2490
2614
  };
2491
2615
 
2492
-
2493
2616
  it('calls meetingInfoProvider with all the right parameters and parses the result', async () => {
2494
- meeting.attrs.meetingInfoProvider = {fetchMeetingInfo: sinon.stub().resolves({body: FAKE_MEETING_INFO})};
2617
+ meeting.attrs.meetingInfoProvider = {
2618
+ fetchMeetingInfo: sinon.stub().resolves({body: FAKE_MEETING_INFO}),
2619
+ };
2495
2620
  meeting.requiredCaptcha = FAKE_SDK_CAPTCHA_INFO;
2496
2621
  meeting.destination = FAKE_DESTINATION;
2497
2622
  meeting.destinationType = FAKE_TYPE;
2498
2623
  meeting.parseMeetingInfo = sinon.stub().returns(undefined);
2499
2624
 
2500
2625
  await meeting.fetchMeetingInfo({
2501
- password: FAKE_PASSWORD, captchaCode: FAKE_CAPTCHA_CODE
2626
+ password: FAKE_PASSWORD,
2627
+ captchaCode: FAKE_CAPTCHA_CODE,
2502
2628
  });
2503
2629
 
2504
- assert.calledWith(meeting.attrs.meetingInfoProvider.fetchMeetingInfo, FAKE_DESTINATION, FAKE_TYPE, FAKE_PASSWORD, {code: FAKE_CAPTCHA_CODE, id: FAKE_CAPTCHA_ID});
2630
+ assert.calledWith(
2631
+ meeting.attrs.meetingInfoProvider.fetchMeetingInfo,
2632
+ FAKE_DESTINATION,
2633
+ FAKE_TYPE,
2634
+ FAKE_PASSWORD,
2635
+ {code: FAKE_CAPTCHA_CODE, id: FAKE_CAPTCHA_ID}
2636
+ );
2505
2637
 
2506
2638
  assert.calledWith(meeting.parseMeetingInfo, {body: FAKE_MEETING_INFO}, FAKE_DESTINATION);
2507
2639
  assert.deepEqual(meeting.meetingInfo, FAKE_MEETING_INFO);
@@ -2509,11 +2641,18 @@ describe('plugin-meetings', () => {
2509
2641
  assert.equal(meeting.meetingInfoFailureReason, MEETING_INFO_FAILURE_REASON.NONE);
2510
2642
  assert.equal(meeting.requiredCaptcha, null);
2511
2643
  assert.calledTwice(TriggerProxy.trigger);
2512
- assert.calledWith(TriggerProxy.trigger, meeting, {file: 'meetings', function: 'fetchMeetingInfo'}, 'meeting:meetingInfoAvailable');
2644
+ assert.calledWith(
2645
+ TriggerProxy.trigger,
2646
+ meeting,
2647
+ {file: 'meetings', function: 'fetchMeetingInfo'},
2648
+ 'meeting:meetingInfoAvailable'
2649
+ );
2513
2650
  });
2514
2651
 
2515
2652
  it('calls meetingInfoProvider with all the right parameters and parses the result when random delay is applied', async () => {
2516
- meeting.attrs.meetingInfoProvider = {fetchMeetingInfo: sinon.stub().resolves({body: FAKE_MEETING_INFO})};
2653
+ meeting.attrs.meetingInfoProvider = {
2654
+ fetchMeetingInfo: sinon.stub().resolves({body: FAKE_MEETING_INFO}),
2655
+ };
2517
2656
  meeting.destination = FAKE_DESTINATION;
2518
2657
  meeting.destinationType = FAKE_TYPE;
2519
2658
  meeting.parseMeetingInfo = sinon.stub().returns(undefined);
@@ -2530,7 +2669,13 @@ describe('plugin-meetings', () => {
2530
2669
  assert.isUndefined(meeting.fetchMeetingInfoTimeoutId);
2531
2670
 
2532
2671
  // meeting info provider
2533
- assert.calledWith(meeting.attrs.meetingInfoProvider.fetchMeetingInfo, FAKE_DESTINATION, FAKE_TYPE, null, null);
2672
+ assert.calledWith(
2673
+ meeting.attrs.meetingInfoProvider.fetchMeetingInfo,
2674
+ FAKE_DESTINATION,
2675
+ FAKE_TYPE,
2676
+ null,
2677
+ null
2678
+ );
2534
2679
 
2535
2680
  // parseMeeting info
2536
2681
  assert.calledWith(meeting.parseMeetingInfo, {body: FAKE_MEETING_INFO}, FAKE_DESTINATION);
@@ -2541,31 +2686,48 @@ describe('plugin-meetings', () => {
2541
2686
  assert.equal(meeting.passwordStatus, PASSWORD_STATUS.NOT_REQUIRED);
2542
2687
 
2543
2688
  assert.calledTwice(TriggerProxy.trigger);
2544
- assert.calledWith(TriggerProxy.trigger, meeting, {file: 'meetings', function: 'fetchMeetingInfo'}, 'meeting:meetingInfoAvailable');
2689
+ assert.calledWith(
2690
+ TriggerProxy.trigger,
2691
+ meeting,
2692
+ {file: 'meetings', function: 'fetchMeetingInfo'},
2693
+ 'meeting:meetingInfoAvailable'
2694
+ );
2545
2695
  });
2546
2696
 
2547
2697
  it('fails if captchaCode is provided when captcha not needed', async () => {
2548
- meeting.attrs.meetingInfoProvider = {fetchMeetingInfo: sinon.stub().resolves({body: FAKE_MEETING_INFO})};
2698
+ meeting.attrs.meetingInfoProvider = {
2699
+ fetchMeetingInfo: sinon.stub().resolves({body: FAKE_MEETING_INFO}),
2700
+ };
2549
2701
  meeting.requiredCaptcha = null;
2550
2702
  meeting.destination = FAKE_DESTINATION;
2551
2703
  meeting.destinationType = FAKE_TYPE;
2552
2704
 
2553
- await assert.isRejected(meeting.fetchMeetingInfo({
2554
- captchaCode: FAKE_CAPTCHA_CODE
2555
- }), Error, 'fetchMeetingInfo() called with captchaCode when captcha was not required');
2705
+ await assert.isRejected(
2706
+ meeting.fetchMeetingInfo({
2707
+ captchaCode: FAKE_CAPTCHA_CODE,
2708
+ }),
2709
+ Error,
2710
+ 'fetchMeetingInfo() called with captchaCode when captcha was not required'
2711
+ );
2556
2712
 
2557
2713
  assert.notCalled(meeting.attrs.meetingInfoProvider.fetchMeetingInfo);
2558
2714
  });
2559
2715
 
2560
2716
  it('fails if password is provided when not required', async () => {
2561
- meeting.attrs.meetingInfoProvider = {fetchMeetingInfo: sinon.stub().resolves({body: FAKE_MEETING_INFO})};
2717
+ meeting.attrs.meetingInfoProvider = {
2718
+ fetchMeetingInfo: sinon.stub().resolves({body: FAKE_MEETING_INFO}),
2719
+ };
2562
2720
  meeting.passwordStatus = PASSWORD_STATUS.NOT_REQUIRED;
2563
2721
  meeting.destination = FAKE_DESTINATION;
2564
2722
  meeting.destinationType = FAKE_TYPE;
2565
2723
 
2566
- await assert.isRejected(meeting.fetchMeetingInfo({
2567
- password: FAKE_PASSWORD
2568
- }), Error, 'fetchMeetingInfo() called with password when password was not required');
2724
+ await assert.isRejected(
2725
+ meeting.fetchMeetingInfo({
2726
+ password: FAKE_PASSWORD,
2727
+ }),
2728
+ Error,
2729
+ 'fetchMeetingInfo() called with password when password was not required'
2730
+ );
2569
2731
 
2570
2732
  assert.notCalled(meeting.attrs.meetingInfoProvider.fetchMeetingInfo);
2571
2733
  });
@@ -2574,15 +2736,26 @@ describe('plugin-meetings', () => {
2574
2736
  meeting.destination = FAKE_DESTINATION;
2575
2737
  meeting.destinationType = FAKE_TYPE;
2576
2738
  meeting.attrs.meetingInfoProvider = {
2577
- fetchMeetingInfo: sinon.stub().throws(new MeetingInfoV2PasswordError(403004, FAKE_MEETING_INFO))
2739
+ fetchMeetingInfo: sinon
2740
+ .stub()
2741
+ .throws(new MeetingInfoV2PasswordError(403004, FAKE_MEETING_INFO)),
2578
2742
  };
2579
2743
 
2580
2744
  await assert.isRejected(meeting.fetchMeetingInfo({}), PasswordError);
2581
2745
 
2582
- assert.calledWith(meeting.attrs.meetingInfoProvider.fetchMeetingInfo, FAKE_DESTINATION, FAKE_TYPE, null, null);
2746
+ assert.calledWith(
2747
+ meeting.attrs.meetingInfoProvider.fetchMeetingInfo,
2748
+ FAKE_DESTINATION,
2749
+ FAKE_TYPE,
2750
+ null,
2751
+ null
2752
+ );
2583
2753
 
2584
2754
  assert.deepEqual(meeting.meetingInfo, FAKE_MEETING_INFO);
2585
- assert.equal(meeting.meetingInfoFailureReason, MEETING_INFO_FAILURE_REASON.WRONG_PASSWORD);
2755
+ assert.equal(
2756
+ meeting.meetingInfoFailureReason,
2757
+ MEETING_INFO_FAILURE_REASON.WRONG_PASSWORD
2758
+ );
2586
2759
  assert.equal(meeting.requiredCaptcha, null);
2587
2760
  assert.equal(meeting.passwordStatus, PASSWORD_STATUS.REQUIRED);
2588
2761
  });
@@ -2591,25 +2764,38 @@ describe('plugin-meetings', () => {
2591
2764
  meeting.destination = FAKE_DESTINATION;
2592
2765
  meeting.destinationType = FAKE_TYPE;
2593
2766
  meeting.attrs.meetingInfoProvider = {
2594
- fetchMeetingInfo: sinon.stub().throws(new MeetingInfoV2CaptchaError(423005, FAKE_SDK_CAPTCHA_INFO))
2767
+ fetchMeetingInfo: sinon
2768
+ .stub()
2769
+ .throws(new MeetingInfoV2CaptchaError(423005, FAKE_SDK_CAPTCHA_INFO)),
2595
2770
  };
2596
2771
  meeting.requiredCaptcha = null;
2597
2772
 
2598
- await assert.isRejected(meeting.fetchMeetingInfo({
2599
- password: 'aaa'
2600
- }), CaptchaError);
2601
-
2602
- assert.calledWith(meeting.attrs.meetingInfoProvider.fetchMeetingInfo, FAKE_DESTINATION, FAKE_TYPE, 'aaa', null);
2773
+ await assert.isRejected(
2774
+ meeting.fetchMeetingInfo({
2775
+ password: 'aaa',
2776
+ }),
2777
+ CaptchaError
2778
+ );
2603
2779
 
2780
+ assert.calledWith(
2781
+ meeting.attrs.meetingInfoProvider.fetchMeetingInfo,
2782
+ FAKE_DESTINATION,
2783
+ FAKE_TYPE,
2784
+ 'aaa',
2785
+ null
2786
+ );
2604
2787
 
2605
2788
  assert.deepEqual(meeting.meetingInfo, {});
2606
- assert.equal(meeting.meetingInfoFailureReason, MEETING_INFO_FAILURE_REASON.WRONG_PASSWORD);
2789
+ assert.equal(
2790
+ meeting.meetingInfoFailureReason,
2791
+ MEETING_INFO_FAILURE_REASON.WRONG_PASSWORD
2792
+ );
2607
2793
  assert.equal(meeting.passwordStatus, PASSWORD_STATUS.REQUIRED);
2608
2794
  assert.deepEqual(meeting.requiredCaptcha, {
2609
2795
  captchaId: FAKE_CAPTCHA_ID,
2610
2796
  verificationImageURL: FAKE_CAPTCHA_IMAGE_URL,
2611
2797
  verificationAudioURL: FAKE_CAPTCHA_AUDIO_URL,
2612
- refreshURL: FAKE_CAPTCHA_REFRESH_URL
2798
+ refreshURL: FAKE_CAPTCHA_REFRESH_URL,
2613
2799
  });
2614
2800
  });
2615
2801
 
@@ -2617,15 +2803,27 @@ describe('plugin-meetings', () => {
2617
2803
  meeting.destination = FAKE_DESTINATION;
2618
2804
  meeting.destinationType = FAKE_TYPE;
2619
2805
  meeting.attrs.meetingInfoProvider = {
2620
- fetchMeetingInfo: sinon.stub().throws(new MeetingInfoV2CaptchaError(423005, FAKE_SDK_CAPTCHA_INFO))
2806
+ fetchMeetingInfo: sinon
2807
+ .stub()
2808
+ .throws(new MeetingInfoV2CaptchaError(423005, FAKE_SDK_CAPTCHA_INFO)),
2621
2809
  };
2622
2810
  meeting.requiredCaptcha = FAKE_SDK_CAPTCHA_INFO;
2623
2811
 
2624
- await assert.isRejected(meeting.fetchMeetingInfo({
2625
- password: 'aaa', captchaCode: 'bbb'
2626
- }), CaptchaError);
2812
+ await assert.isRejected(
2813
+ meeting.fetchMeetingInfo({
2814
+ password: 'aaa',
2815
+ captchaCode: 'bbb',
2816
+ }),
2817
+ CaptchaError
2818
+ );
2627
2819
 
2628
- assert.calledWith(meeting.attrs.meetingInfoProvider.fetchMeetingInfo, FAKE_DESTINATION, FAKE_TYPE, 'aaa', {code: 'bbb', id: FAKE_CAPTCHA_ID});
2820
+ assert.calledWith(
2821
+ meeting.attrs.meetingInfoProvider.fetchMeetingInfo,
2822
+ FAKE_DESTINATION,
2823
+ FAKE_TYPE,
2824
+ 'aaa',
2825
+ {code: 'bbb', id: FAKE_CAPTCHA_ID}
2826
+ );
2629
2827
 
2630
2828
  assert.deepEqual(meeting.meetingInfo, {});
2631
2829
  assert.equal(meeting.meetingInfoFailureReason, MEETING_INFO_FAILURE_REASON.WRONG_CAPTCHA);
@@ -2637,20 +2835,24 @@ describe('plugin-meetings', () => {
2637
2835
  meeting.destination = FAKE_DESTINATION;
2638
2836
  meeting.destinationType = FAKE_TYPE;
2639
2837
  meeting.attrs.meetingInfoProvider = {
2640
- fetchMeetingInfo: sinon.stub().resolves(
2641
- {
2642
- statusCode: 200,
2643
- body: FAKE_MEETING_INFO
2644
- }
2645
- )
2838
+ fetchMeetingInfo: sinon.stub().resolves({
2839
+ statusCode: 200,
2840
+ body: FAKE_MEETING_INFO,
2841
+ }),
2646
2842
  };
2647
2843
  meeting.passwordStatus = PASSWORD_STATUS.REQUIRED;
2648
2844
 
2649
2845
  await meeting.fetchMeetingInfo({
2650
- password: 'aaa'
2846
+ password: 'aaa',
2651
2847
  });
2652
2848
 
2653
- assert.calledWith(meeting.attrs.meetingInfoProvider.fetchMeetingInfo, FAKE_DESTINATION, FAKE_TYPE, 'aaa', null);
2849
+ assert.calledWith(
2850
+ meeting.attrs.meetingInfoProvider.fetchMeetingInfo,
2851
+ FAKE_DESTINATION,
2852
+ FAKE_TYPE,
2853
+ 'aaa',
2854
+ null
2855
+ );
2654
2856
 
2655
2857
  assert.deepEqual(meeting.meetingInfo, FAKE_MEETING_INFO);
2656
2858
  assert.equal(meeting.meetingInfoFailureReason, MEETING_INFO_FAILURE_REASON.NONE);
@@ -2664,36 +2866,50 @@ describe('plugin-meetings', () => {
2664
2866
  const refreshedCaptcha = {
2665
2867
  captchaID: FAKE_WBXAPPAPI_CAPTCHA_INFO.captchaID,
2666
2868
  verificationImageURL: FAKE_WBXAPPAPI_CAPTCHA_INFO.verificationImageURL,
2667
- verificationAudioURL: FAKE_WBXAPPAPI_CAPTCHA_INFO.verificationAudioURL
2869
+ verificationAudioURL: FAKE_WBXAPPAPI_CAPTCHA_INFO.verificationAudioURL,
2668
2870
  };
2669
2871
 
2670
2872
  meeting.attrs.meetingInfoProvider = {
2671
- fetchMeetingInfo: sinon.stub().throws(new MeetingInfoV2PasswordError(403004, FAKE_MEETING_INFO))
2873
+ fetchMeetingInfo: sinon
2874
+ .stub()
2875
+ .throws(new MeetingInfoV2PasswordError(403004, FAKE_MEETING_INFO)),
2672
2876
  };
2673
- meeting.meetingRequest.refreshCaptcha = sinon.stub().returns(Promise.resolve(
2674
- {
2675
- body: refreshedCaptcha
2676
- }
2677
- ));
2877
+ meeting.meetingRequest.refreshCaptcha = sinon.stub().returns(
2878
+ Promise.resolve({
2879
+ body: refreshedCaptcha,
2880
+ })
2881
+ );
2678
2882
  meeting.passwordStatus = PASSWORD_STATUS.REQUIRED;
2679
2883
  meeting.requiredCaptcha = FAKE_SDK_CAPTCHA_INFO;
2680
2884
  meeting.destination = FAKE_DESTINATION;
2681
2885
  meeting.destinationType = FAKE_TYPE;
2682
2886
 
2683
- await assert.isRejected(meeting.fetchMeetingInfo({
2684
- password: 'aaa', captchaCode: 'bbb'
2685
- }));
2887
+ await assert.isRejected(
2888
+ meeting.fetchMeetingInfo({
2889
+ password: 'aaa',
2890
+ captchaCode: 'bbb',
2891
+ })
2892
+ );
2686
2893
 
2687
- assert.calledWith(meeting.attrs.meetingInfoProvider.fetchMeetingInfo, FAKE_DESTINATION, FAKE_TYPE, 'aaa', {code: 'bbb', id: FAKE_CAPTCHA_ID});
2894
+ assert.calledWith(
2895
+ meeting.attrs.meetingInfoProvider.fetchMeetingInfo,
2896
+ FAKE_DESTINATION,
2897
+ FAKE_TYPE,
2898
+ 'aaa',
2899
+ {code: 'bbb', id: FAKE_CAPTCHA_ID}
2900
+ );
2688
2901
 
2689
2902
  assert.deepEqual(meeting.meetingInfo, FAKE_MEETING_INFO);
2690
- assert.equal(meeting.meetingInfoFailureReason, MEETING_INFO_FAILURE_REASON.WRONG_PASSWORD);
2903
+ assert.equal(
2904
+ meeting.meetingInfoFailureReason,
2905
+ MEETING_INFO_FAILURE_REASON.WRONG_PASSWORD
2906
+ );
2691
2907
  assert.equal(meeting.passwordStatus, PASSWORD_STATUS.REQUIRED);
2692
2908
  assert.deepEqual(meeting.requiredCaptcha, {
2693
2909
  captchaId: refreshedCaptcha.captchaID,
2694
2910
  verificationImageURL: refreshedCaptcha.verificationImageURL,
2695
2911
  verificationAudioURL: refreshedCaptcha.verificationAudioURL,
2696
- refreshURL: FAKE_SDK_CAPTCHA_INFO.refreshURL // refresh url doesn't change
2912
+ refreshURL: FAKE_SDK_CAPTCHA_INFO.refreshURL, // refresh url doesn't change
2697
2913
  });
2698
2914
  });
2699
2915
  });
@@ -2703,48 +2919,56 @@ describe('plugin-meetings', () => {
2703
2919
  assert.isRejected(meeting.refreshCaptcha(), Error);
2704
2920
  });
2705
2921
  it('sends correct request to captcha service refresh url', async () => {
2706
- const REFRESH_URL = 'https://something.webex.com/captchaservice/v1/captchas/refresh?blablabla=something&captchaID=xxx';
2707
- const EXPECTED_REFRESH_URL = 'https://something.webex.com/captchaservice/v1/captchas/refresh?blablabla=something&captchaID=xxx&siteFullName=something.webex.com';
2922
+ const REFRESH_URL =
2923
+ 'https://something.webex.com/captchaservice/v1/captchas/refresh?blablabla=something&captchaID=xxx';
2924
+ const EXPECTED_REFRESH_URL =
2925
+ 'https://something.webex.com/captchaservice/v1/captchas/refresh?blablabla=something&captchaID=xxx&siteFullName=something.webex.com';
2708
2926
 
2709
2927
  const FAKE_SDK_CAPTCHA_INFO = {
2710
2928
  captchaId: 'some id',
2711
2929
  verificationImageURL: 'some image url',
2712
2930
  verificationAudioURL: 'some audio url',
2713
- refreshURL: REFRESH_URL
2931
+ refreshURL: REFRESH_URL,
2714
2932
  };
2715
2933
 
2716
2934
  const FAKE_REFRESHED_CAPTCHA = {
2717
2935
  captchaID: 'some id',
2718
2936
  verificationImageURL: 'some image url',
2719
- verificationAudioURL: 'some audio url'
2937
+ verificationAudioURL: 'some audio url',
2720
2938
  };
2721
2939
 
2722
2940
  // setup the meeting so that a captcha is required
2723
2941
  meeting.attrs.meetingInfoProvider = {
2724
- fetchMeetingInfo: sinon.stub().throws(new MeetingInfoV2CaptchaError(423005, FAKE_SDK_CAPTCHA_INFO))
2942
+ fetchMeetingInfo: sinon
2943
+ .stub()
2944
+ .throws(new MeetingInfoV2CaptchaError(423005, FAKE_SDK_CAPTCHA_INFO)),
2725
2945
  };
2726
2946
 
2727
- await assert.isRejected(meeting.fetchMeetingInfo({
2728
- password: ''
2729
- }), CaptchaError);
2947
+ await assert.isRejected(
2948
+ meeting.fetchMeetingInfo({
2949
+ password: '',
2950
+ }),
2951
+ CaptchaError
2952
+ );
2730
2953
 
2731
2954
  assert.deepEqual(meeting.requiredCaptcha, FAKE_SDK_CAPTCHA_INFO);
2732
- meeting.meetingRequest.refreshCaptcha = sinon.stub().returns(Promise.resolve({body: FAKE_REFRESHED_CAPTCHA}));
2955
+ meeting.meetingRequest.refreshCaptcha = sinon
2956
+ .stub()
2957
+ .returns(Promise.resolve({body: FAKE_REFRESHED_CAPTCHA}));
2733
2958
 
2734
2959
  // test the captcha refresh
2735
2960
  await meeting.refreshCaptcha();
2736
2961
 
2737
- assert.calledWith(meeting.meetingRequest.refreshCaptcha,
2738
- {
2739
- captchaRefreshUrl: EXPECTED_REFRESH_URL,
2740
- captchaId: FAKE_SDK_CAPTCHA_INFO.captchaId
2741
- });
2962
+ assert.calledWith(meeting.meetingRequest.refreshCaptcha, {
2963
+ captchaRefreshUrl: EXPECTED_REFRESH_URL,
2964
+ captchaId: FAKE_SDK_CAPTCHA_INFO.captchaId,
2965
+ });
2742
2966
 
2743
2967
  assert.deepEqual(meeting.requiredCaptcha, {
2744
2968
  captchaId: FAKE_REFRESHED_CAPTCHA.captchaID,
2745
2969
  verificationImageURL: FAKE_REFRESHED_CAPTCHA.verificationImageURL,
2746
2970
  verificationAudioURL: FAKE_REFRESHED_CAPTCHA.verificationAudioURL,
2747
- refreshURL: FAKE_SDK_CAPTCHA_INFO.refreshURL // refresh url doesn't change
2971
+ refreshURL: FAKE_SDK_CAPTCHA_INFO.refreshURL, // refresh url doesn't change
2748
2972
  });
2749
2973
  });
2750
2974
  });
@@ -2758,7 +2982,7 @@ describe('plugin-meetings', () => {
2758
2982
  assert(Metrics.sendBehavioralMetric.calledOnce);
2759
2983
  assert.calledWith(
2760
2984
  Metrics.sendBehavioralMetric,
2761
- BEHAVIORAL_METRICS.VERIFY_PASSWORD_SUCCESS,
2985
+ BEHAVIORAL_METRICS.VERIFY_PASSWORD_SUCCESS
2762
2986
  );
2763
2987
  assert.equal(result.isPasswordValid, true);
2764
2988
  assert.equal(result.requiredCaptcha, null);
@@ -2833,7 +3057,9 @@ describe('plugin-meetings', () => {
2833
3057
  sandbox = sinon.createSandbox();
2834
3058
  meeting.meetingFiniteStateMachine.ring();
2835
3059
  meeting.meetingFiniteStateMachine.join();
2836
- meeting.meetingRequest.endMeetingForAll = sinon.stub().returns(Promise.resolve({body: 'test'}));
3060
+ meeting.meetingRequest.endMeetingForAll = sinon
3061
+ .stub()
3062
+ .returns(Promise.resolve({body: 'test'}));
2837
3063
  meeting.locusInfo.onFullLocus = sinon.stub().returns(true);
2838
3064
  meeting.closeLocalStream = sinon.stub().returns(Promise.resolve());
2839
3065
  meeting.closeLocalShare = sinon.stub().returns(Promise.resolve());
@@ -2886,7 +3112,11 @@ describe('plugin-meetings', () => {
2886
3112
  sandbox.stub(meeting.mediaProperties, 'unsetMediaTracks');
2887
3113
 
2888
3114
  sandbox.stub(meeting.reconnectionManager, 'reconnectMedia').returns(Promise.resolve());
2889
- sandbox.stub(MeetingUtil, 'joinMeeting').returns(Promise.resolve(MeetingUtil.parseLocusJoin({body: {locus, mediaConnections: []}})));
3115
+ sandbox
3116
+ .stub(MeetingUtil, 'joinMeeting')
3117
+ .returns(
3118
+ Promise.resolve(MeetingUtil.parseLocusJoin({body: {locus, mediaConnections: []}}))
3119
+ );
2890
3120
  });
2891
3121
 
2892
3122
  afterEach(() => {
@@ -2897,8 +3127,7 @@ describe('plugin-meetings', () => {
2897
3127
  it('should throw an error if resourceId not passed', async () => {
2898
3128
  try {
2899
3129
  await meeting.moveTo();
2900
- }
2901
- catch (err) {
3130
+ } catch (err) {
2902
3131
  assert.instanceOf(err, ParameterError);
2903
3132
  assert.equal(err.sdkMessage, 'Cannot move call without a resourceId.');
2904
3133
  }
@@ -2915,17 +3144,17 @@ describe('plugin-meetings', () => {
2915
3144
  share: true,
2916
3145
  share_audio: false,
2917
3146
  video: false,
2918
- whiteboard: false
3147
+ whiteboard: false,
2919
3148
  },
2920
3149
  tx: {
2921
3150
  audio: false,
2922
3151
  share: false,
2923
3152
  share_audio: false,
2924
3153
  video: false,
2925
- whiteboard: false
2926
- }
2927
- }
2928
- }
3154
+ whiteboard: false,
3155
+ },
3156
+ },
3157
+ },
2929
3158
  });
2930
3159
  assert.calledWithMatch(Metrics.postEvent, {event: eventType.MOVE_MEDIA});
2931
3160
  });
@@ -2934,17 +3163,19 @@ describe('plugin-meetings', () => {
2934
3163
  sinon.spy(MeetingUtil, 'joinMeetingOptions');
2935
3164
  await meeting.moveTo('resourceId');
2936
3165
 
2937
- assert.calledWith(MeetingUtil.joinMeetingOptions, meeting, {resourceId: 'resourceId', moveToResource: true});
3166
+ assert.calledWith(MeetingUtil.joinMeetingOptions, meeting, {
3167
+ resourceId: 'resourceId',
3168
+ moveToResource: true,
3169
+ });
2938
3170
  });
2939
3171
 
2940
3172
  it('should reconnectMedia after DX joins after moveTo', async () => {
2941
3173
  await meeting.moveTo('resourceId');
2942
3174
 
2943
-
2944
3175
  await meeting.locusInfo.emitScoped(
2945
3176
  {
2946
3177
  file: 'locus-info',
2947
- function: 'updateSelf'
3178
+ function: 'updateSelf',
2948
3179
  },
2949
3180
  'SELF_OBSERVING'
2950
3181
  );
@@ -2960,36 +3191,30 @@ describe('plugin-meetings', () => {
2960
3191
  assert.called(meeting.mediaProperties.setMediaDirection);
2961
3192
  assert.called(meeting.mediaProperties.unsetMediaTracks);
2962
3193
 
2963
- assert.calledWith(meeting.reconnectionManager.reconnectMedia,
2964
- {
2965
- mediaDirection: {
2966
- sendVideo: false,
2967
- receiveVideo: false,
2968
- sendAudio: false,
2969
- receiveAudio: false,
2970
- sendShare: false,
2971
- receiveShare: true
2972
- }
2973
- });
3194
+ assert.calledWith(meeting.reconnectionManager.reconnectMedia, {
3195
+ mediaDirection: {
3196
+ sendVideo: false,
3197
+ receiveVideo: false,
3198
+ sendAudio: false,
3199
+ receiveAudio: false,
3200
+ sendShare: false,
3201
+ receiveShare: true,
3202
+ },
3203
+ });
2974
3204
  });
2975
3205
 
2976
3206
  it('should throw an error if moveTo call fails', async () => {
2977
3207
  MeetingUtil.joinMeeting = sinon.stub().returns(Promise.reject());
2978
3208
  try {
2979
3209
  await meeting.moveTo('resourceId');
2980
- }
2981
- catch {
3210
+ } catch {
2982
3211
  assert.calledOnce(Metrics.sendBehavioralMetric);
2983
- assert.calledWith(
2984
- Metrics.sendBehavioralMetric,
2985
- BEHAVIORAL_METRICS.MOVE_TO_FAILURE,
2986
- {
2987
- correlation_id: meeting.correlationId,
2988
- locus_id: meeting.locusUrl.split('/').pop(),
2989
- reason: sinon.match.any,
2990
- stack: sinon.match.any
2991
- }
2992
- );
3212
+ assert.calledWith(Metrics.sendBehavioralMetric, BEHAVIORAL_METRICS.MOVE_TO_FAILURE, {
3213
+ correlation_id: meeting.correlationId,
3214
+ locus_id: meeting.locusUrl.split('/').pop(),
3215
+ reason: sinon.match.any,
3216
+ stack: sinon.match.any,
3217
+ });
2993
3218
  }
2994
3219
  Metrics.sendBehavioralMetric.reset();
2995
3220
  meeting.reconnectionManager.reconnectMedia = sinon.stub().returns(Promise.reject());
@@ -2999,23 +3224,18 @@ describe('plugin-meetings', () => {
2999
3224
  await meeting.locusInfo.emitScoped(
3000
3225
  {
3001
3226
  file: 'locus-info',
3002
- function: 'updateSelf'
3227
+ function: 'updateSelf',
3003
3228
  },
3004
3229
  'SELF_OBSERVING'
3005
3230
  );
3006
- }
3007
- catch {
3231
+ } catch {
3008
3232
  assert.calledOnce(Metrics.sendBehavioralMetric);
3009
- assert.calledWith(
3010
- Metrics.sendBehavioralMetric,
3011
- BEHAVIORAL_METRICS.MOVE_TO_FAILURE,
3012
- {
3013
- correlation_id: meeting.correlationId,
3014
- locus_id: meeting.locusUrl.split('/').pop(),
3015
- reason: sinon.match.any,
3016
- stack: sinon.match.any
3017
- }
3018
- );
3233
+ assert.calledWith(Metrics.sendBehavioralMetric, BEHAVIORAL_METRICS.MOVE_TO_FAILURE, {
3234
+ correlation_id: meeting.correlationId,
3235
+ locus_id: meeting.locusUrl.split('/').pop(),
3236
+ reason: sinon.match.any,
3237
+ stack: sinon.match.any,
3238
+ });
3019
3239
  }
3020
3240
  });
3021
3241
  });
@@ -3025,7 +3245,11 @@ describe('plugin-meetings', () => {
3025
3245
 
3026
3246
  beforeEach(() => {
3027
3247
  sandbox = sinon.createSandbox();
3028
- sandbox.stub(MeetingUtil, 'joinMeeting').returns(Promise.resolve(MeetingUtil.parseLocusJoin({body: {locus, mediaConnections: []}})));
3248
+ sandbox
3249
+ .stub(MeetingUtil, 'joinMeeting')
3250
+ .returns(
3251
+ Promise.resolve(MeetingUtil.parseLocusJoin({body: {locus, mediaConnections: []}}))
3252
+ );
3029
3253
  sandbox.stub(MeetingUtil, 'leaveMeeting').returns(Promise.resolve());
3030
3254
  });
3031
3255
 
@@ -3037,8 +3261,7 @@ describe('plugin-meetings', () => {
3037
3261
  it('should throw an error if resourceId not passed', async () => {
3038
3262
  try {
3039
3263
  await meeting.moveFrom();
3040
- }
3041
- catch (err) {
3264
+ } catch (err) {
3042
3265
  assert.instanceOf(err, ParameterError);
3043
3266
 
3044
3267
  assert.equal(err.sdkMessage, 'Cannot move call without a resourceId.');
@@ -3059,33 +3282,25 @@ describe('plugin-meetings', () => {
3059
3282
  assert.calledWith(MeetingUtil.leaveMeeting, meeting, {
3060
3283
  resourceId: 'resourceId',
3061
3284
  correlationId: meeting.correlationId,
3062
- moveMeeting: true
3285
+ moveMeeting: true,
3063
3286
  });
3064
3287
 
3065
3288
  assert.calledOnce(Metrics.sendBehavioralMetric);
3066
- assert.calledWith(
3067
- Metrics.sendBehavioralMetric,
3068
- BEHAVIORAL_METRICS.MOVE_FROM_SUCCESS,
3069
- );
3289
+ assert.calledWith(Metrics.sendBehavioralMetric, BEHAVIORAL_METRICS.MOVE_FROM_SUCCESS);
3070
3290
  });
3071
3291
 
3072
3292
  it('should throw an error if moveFrom call fails', async () => {
3073
3293
  MeetingUtil.joinMeeting = sinon.stub().returns(Promise.reject());
3074
3294
  try {
3075
3295
  await meeting.moveFrom('resourceId');
3076
- }
3077
- catch {
3296
+ } catch {
3078
3297
  assert.calledOnce(Metrics.sendBehavioralMetric);
3079
- assert.calledWith(
3080
- Metrics.sendBehavioralMetric,
3081
- BEHAVIORAL_METRICS.MOVE_FROM_FAILURE,
3082
- {
3083
- correlation_id: meeting.correlationId,
3084
- locus_id: meeting.locusUrl.split('/').pop(),
3085
- reason: sinon.match.any,
3086
- stack: sinon.match.any
3087
- }
3088
- );
3298
+ assert.calledWith(Metrics.sendBehavioralMetric, BEHAVIORAL_METRICS.MOVE_FROM_FAILURE, {
3299
+ correlation_id: meeting.correlationId,
3300
+ locus_id: meeting.locusUrl.split('/').pop(),
3301
+ reason: sinon.match.any,
3302
+ stack: sinon.match.any,
3303
+ });
3089
3304
  }
3090
3305
  });
3091
3306
  });
@@ -3154,7 +3369,9 @@ describe('plugin-meetings', () => {
3154
3369
  meeting.config.reconnection.enabled = true;
3155
3370
  meeting.currentMediaStatus = {audio: true};
3156
3371
  meeting.reconnectionManager = new ReconnectionManager(meeting);
3157
- meeting.reconnectionManager.reconnect = sinon.stub().returns(Promise.reject(new Error()));
3372
+ meeting.reconnectionManager.reconnect = sinon
3373
+ .stub()
3374
+ .returns(Promise.reject(new Error()));
3158
3375
  meeting.reconnectionManager.reset = sinon.stub().returns(true);
3159
3376
  });
3160
3377
 
@@ -3179,7 +3396,7 @@ describe('plugin-meetings', () => {
3179
3396
  correlation_id: meeting.correlationId,
3180
3397
  locus_id: meeting.locusUrl.split('/').pop(),
3181
3398
  reason: sinon.match.any,
3182
- stack: sinon.match.any
3399
+ stack: sinon.match.any,
3183
3400
  }
3184
3401
  );
3185
3402
  });
@@ -3191,7 +3408,7 @@ describe('plugin-meetings', () => {
3191
3408
  sinon.match.instanceOf(Meeting),
3192
3409
  {file: 'meeting/index', function: 'reconnect'},
3193
3410
  EVENTS.REQUEST_UPLOAD_LOGS,
3194
- sinon.match.instanceOf(Meeting),
3411
+ sinon.match.instanceOf(Meeting)
3195
3412
  );
3196
3413
  });
3197
3414
 
@@ -3275,8 +3492,8 @@ describe('plugin-meetings', () => {
3275
3492
  height: 1980,
3276
3493
  width: 1080,
3277
3494
  displaySurface: true,
3278
- cursor: true
3279
- })
3495
+ cursor: true,
3496
+ }),
3280
3497
  };
3281
3498
  const getVideoTracks = sinon.stub().returns([track]);
3282
3499
 
@@ -3308,7 +3525,7 @@ describe('plugin-meetings', () => {
3308
3525
  // mock the on() method and store all the listeners
3309
3526
  on: sinon.stub().callsFake((event, listener) => {
3310
3527
  eventListeners[event] = listener;
3311
- })
3528
+ }),
3312
3529
  };
3313
3530
  });
3314
3531
 
@@ -3324,17 +3541,35 @@ describe('plugin-meetings', () => {
3324
3541
 
3325
3542
  it('should trigger a media:ready event when REMOTE_TRACK_ADDED is fired', () => {
3326
3543
  meeting.setupMediaConnectionListeners();
3327
- eventListeners[MC.Event.REMOTE_TRACK_ADDED]({track: 'track', type: MC.RemoteTrackType.AUDIO});
3544
+ eventListeners[MC.Event.REMOTE_TRACK_ADDED]({
3545
+ track: 'track',
3546
+ type: MC.RemoteTrackType.AUDIO,
3547
+ });
3328
3548
  assert.equal(TriggerProxy.trigger.getCall(1).args[2], 'media:ready');
3329
- assert.deepEqual(TriggerProxy.trigger.getCall(1).args[3], {type: 'remoteAudio', stream: true});
3549
+ assert.deepEqual(TriggerProxy.trigger.getCall(1).args[3], {
3550
+ type: 'remoteAudio',
3551
+ stream: true,
3552
+ });
3330
3553
 
3331
- eventListeners[MC.Event.REMOTE_TRACK_ADDED]({track: 'track', type: MC.RemoteTrackType.VIDEO});
3554
+ eventListeners[MC.Event.REMOTE_TRACK_ADDED]({
3555
+ track: 'track',
3556
+ type: MC.RemoteTrackType.VIDEO,
3557
+ });
3332
3558
  assert.equal(TriggerProxy.trigger.getCall(2).args[2], 'media:ready');
3333
- assert.deepEqual(TriggerProxy.trigger.getCall(2).args[3], {type: 'remoteVideo', stream: true});
3559
+ assert.deepEqual(TriggerProxy.trigger.getCall(2).args[3], {
3560
+ type: 'remoteVideo',
3561
+ stream: true,
3562
+ });
3334
3563
 
3335
- eventListeners[MC.Event.REMOTE_TRACK_ADDED]({track: 'track', type: MC.RemoteTrackType.SCREENSHARE_VIDEO});
3564
+ eventListeners[MC.Event.REMOTE_TRACK_ADDED]({
3565
+ track: 'track',
3566
+ type: MC.RemoteTrackType.SCREENSHARE_VIDEO,
3567
+ });
3336
3568
  assert.equal(TriggerProxy.trigger.getCall(3).args[2], 'media:ready');
3337
- assert.deepEqual(TriggerProxy.trigger.getCall(3).args[3], {type: 'remoteShare', stream: true});
3569
+ assert.deepEqual(TriggerProxy.trigger.getCall(3).args[3], {
3570
+ type: 'remoteShare',
3571
+ stream: true,
3572
+ });
3338
3573
  });
3339
3574
 
3340
3575
  describe('should send correct metrics for ROAP_FAILURE event', () => {
@@ -3348,10 +3583,19 @@ describe('plugin-meetings', () => {
3348
3583
 
3349
3584
  const checkMetricSent = (event) => {
3350
3585
  assert.calledOnce(Metrics.postEvent);
3351
- assert.calledWithMatch(Metrics.postEvent, {event, meetingId: meeting.id, data: {canProceed: false}});
3586
+ assert.calledWithMatch(Metrics.postEvent, {
3587
+ event,
3588
+ meetingId: meeting.id,
3589
+ data: {canProceed: false},
3590
+ });
3352
3591
  };
3353
3592
 
3354
- const checkBehavioralMetricSent = (metricName, expectedCode, expectedReason, expectedMetadataType) => {
3593
+ const checkBehavioralMetricSent = (
3594
+ metricName,
3595
+ expectedCode,
3596
+ expectedReason,
3597
+ expectedMetadataType
3598
+ ) => {
3355
3599
  assert.calledOnce(Metrics.sendBehavioralMetric);
3356
3600
  assert.calledWith(
3357
3601
  Metrics.sendBehavioralMetric,
@@ -3360,39 +3604,63 @@ describe('plugin-meetings', () => {
3360
3604
  code: expectedCode,
3361
3605
  correlation_id: meeting.correlationId,
3362
3606
  reason: expectedReason,
3363
- stack: sinon.match.any
3607
+ stack: sinon.match.any,
3364
3608
  },
3365
3609
  {
3366
- type: expectedMetadataType
3610
+ type: expectedMetadataType,
3367
3611
  }
3368
3612
  );
3369
3613
  };
3370
3614
 
3371
3615
  it('should send metrics for SdpOfferCreationError error', () => {
3372
- const fakeError = new MC.Errors.SdpOfferCreationError(fakeErrorMessage, {name: fakeErrorName, cause: {name: fakeRootCauseName}});
3616
+ const fakeError = new MC.Errors.SdpOfferCreationError(fakeErrorMessage, {
3617
+ name: fakeErrorName,
3618
+ cause: {name: fakeRootCauseName},
3619
+ });
3373
3620
 
3374
3621
  eventListeners[MC.Event.ROAP_FAILURE](fakeError);
3375
3622
 
3376
3623
  checkMetricSent(eventType.LOCAL_SDP_GENERATED);
3377
- checkBehavioralMetricSent(BEHAVIORAL_METRICS.PEERCONNECTION_FAILURE, MC.Errors.ErrorCode.SdpOfferCreationError, fakeErrorMessage, fakeRootCauseName);
3624
+ checkBehavioralMetricSent(
3625
+ BEHAVIORAL_METRICS.PEERCONNECTION_FAILURE,
3626
+ MC.Errors.ErrorCode.SdpOfferCreationError,
3627
+ fakeErrorMessage,
3628
+ fakeRootCauseName
3629
+ );
3378
3630
  });
3379
3631
 
3380
3632
  it('should send metrics for SdpOfferHandlingError error', () => {
3381
- const fakeError = new MC.Errors.SdpOfferHandlingError(fakeErrorMessage, {name: fakeErrorName, cause: {name: fakeRootCauseName}});
3633
+ const fakeError = new MC.Errors.SdpOfferHandlingError(fakeErrorMessage, {
3634
+ name: fakeErrorName,
3635
+ cause: {name: fakeRootCauseName},
3636
+ });
3382
3637
 
3383
3638
  eventListeners[MC.Event.ROAP_FAILURE](fakeError);
3384
3639
 
3385
3640
  checkMetricSent(eventType.REMOTE_SDP_RECEIVED);
3386
- checkBehavioralMetricSent(BEHAVIORAL_METRICS.PEERCONNECTION_FAILURE, MC.Errors.ErrorCode.SdpOfferHandlingError, fakeErrorMessage, fakeRootCauseName);
3641
+ checkBehavioralMetricSent(
3642
+ BEHAVIORAL_METRICS.PEERCONNECTION_FAILURE,
3643
+ MC.Errors.ErrorCode.SdpOfferHandlingError,
3644
+ fakeErrorMessage,
3645
+ fakeRootCauseName
3646
+ );
3387
3647
  });
3388
3648
 
3389
3649
  it('should send metrics for SdpAnswerHandlingError error', () => {
3390
- const fakeError = new MC.Errors.SdpAnswerHandlingError(fakeErrorMessage, {name: fakeErrorName, cause: {name: fakeRootCauseName}});
3650
+ const fakeError = new MC.Errors.SdpAnswerHandlingError(fakeErrorMessage, {
3651
+ name: fakeErrorName,
3652
+ cause: {name: fakeRootCauseName},
3653
+ });
3391
3654
 
3392
3655
  eventListeners[MC.Event.ROAP_FAILURE](fakeError);
3393
3656
 
3394
3657
  checkMetricSent(eventType.REMOTE_SDP_RECEIVED);
3395
- checkBehavioralMetricSent(BEHAVIORAL_METRICS.PEERCONNECTION_FAILURE, MC.Errors.ErrorCode.SdpAnswerHandlingError, fakeErrorMessage, fakeRootCauseName);
3658
+ checkBehavioralMetricSent(
3659
+ BEHAVIORAL_METRICS.PEERCONNECTION_FAILURE,
3660
+ MC.Errors.ErrorCode.SdpAnswerHandlingError,
3661
+ fakeErrorMessage,
3662
+ fakeRootCauseName
3663
+ );
3396
3664
  });
3397
3665
 
3398
3666
  it('should send metrics for SdpError error', () => {
@@ -3403,18 +3671,30 @@ describe('plugin-meetings', () => {
3403
3671
 
3404
3672
  checkMetricSent(eventType.LOCAL_SDP_GENERATED);
3405
3673
  // expectedMetadataType is the error name in this case
3406
- checkBehavioralMetricSent(BEHAVIORAL_METRICS.INVALID_ICE_CANDIDATE, MC.Errors.ErrorCode.SdpError, fakeErrorMessage, fakeErrorName);
3674
+ checkBehavioralMetricSent(
3675
+ BEHAVIORAL_METRICS.INVALID_ICE_CANDIDATE,
3676
+ MC.Errors.ErrorCode.SdpError,
3677
+ fakeErrorMessage,
3678
+ fakeErrorName
3679
+ );
3407
3680
  });
3408
3681
 
3409
3682
  it('should send metrics for IceGatheringError error', () => {
3410
3683
  // IceGatheringError is usually without a cause
3411
- const fakeError = new MC.Errors.IceGatheringError(fakeErrorMessage, {name: fakeErrorName});
3684
+ const fakeError = new MC.Errors.IceGatheringError(fakeErrorMessage, {
3685
+ name: fakeErrorName,
3686
+ });
3412
3687
 
3413
3688
  eventListeners[MC.Event.ROAP_FAILURE](fakeError);
3414
3689
 
3415
3690
  checkMetricSent(eventType.LOCAL_SDP_GENERATED);
3416
3691
  // expectedMetadataType is the error name in this case
3417
- checkBehavioralMetricSent(BEHAVIORAL_METRICS.INVALID_ICE_CANDIDATE, MC.Errors.ErrorCode.IceGatheringError, fakeErrorMessage, fakeErrorName);
3692
+ checkBehavioralMetricSent(
3693
+ BEHAVIORAL_METRICS.INVALID_ICE_CANDIDATE,
3694
+ MC.Errors.ErrorCode.IceGatheringError,
3695
+ fakeErrorMessage,
3696
+ fakeErrorName
3697
+ );
3418
3698
  });
3419
3699
  });
3420
3700
 
@@ -3426,7 +3706,9 @@ describe('plugin-meetings', () => {
3426
3706
 
3427
3707
  beforeEach(() => {
3428
3708
  sendRoapOKStub = sinon.stub(meeting.roap, 'sendRoapOK').resolves({});
3429
- sendRoapMediaRequestStub = sinon.stub(meeting.roap, 'sendRoapMediaRequest').resolves({});
3709
+ sendRoapMediaRequestStub = sinon
3710
+ .stub(meeting.roap, 'sendRoapMediaRequest')
3711
+ .resolves({});
3430
3712
  sendRoapAnswerStub = sinon.stub(meeting.roap, 'sendRoapAnswer').resolves({});
3431
3713
  sendRoapErrorStub = sinon.stub(meeting.roap, 'sendRoapError').resolves({});
3432
3714
 
@@ -3434,13 +3716,22 @@ describe('plugin-meetings', () => {
3434
3716
  });
3435
3717
 
3436
3718
  it('handles OK message correctly', () => {
3437
- eventListeners[MC.Event.ROAP_MESSAGE_TO_SEND]({roapMessage: {messageType: 'OK', seq: 1}});
3719
+ eventListeners[MC.Event.ROAP_MESSAGE_TO_SEND]({
3720
+ roapMessage: {messageType: 'OK', seq: 1},
3721
+ });
3438
3722
 
3439
3723
  assert.calledOnce(Metrics.postEvent);
3440
- assert.calledWithMatch(Metrics.postEvent, {event: eventType.REMOTE_SDP_RECEIVED, meetingId: meeting.id});
3724
+ assert.calledWithMatch(Metrics.postEvent, {
3725
+ event: eventType.REMOTE_SDP_RECEIVED,
3726
+ meetingId: meeting.id,
3727
+ });
3441
3728
 
3442
3729
  assert.calledOnce(sendRoapOKStub);
3443
- assert.calledWith(sendRoapOKStub, {seq: 1, mediaId: meeting.mediaId, correlationId: meeting.correlationId});
3730
+ assert.calledWith(sendRoapOKStub, {
3731
+ seq: 1,
3732
+ mediaId: meeting.mediaId,
3733
+ correlationId: meeting.correlationId,
3734
+ });
3444
3735
  });
3445
3736
 
3446
3737
  it('handles OFFER message correctly', () => {
@@ -3450,15 +3741,22 @@ describe('plugin-meetings', () => {
3450
3741
  seq: 1,
3451
3742
  sdp: 'fake sdp',
3452
3743
  tieBreaker: 12345,
3453
- }
3744
+ },
3454
3745
  });
3455
3746
 
3456
3747
  assert.calledOnce(Metrics.postEvent);
3457
- assert.calledWithMatch(Metrics.postEvent, {event: eventType.LOCAL_SDP_GENERATED, meetingId: meeting.id});
3748
+ assert.calledWithMatch(Metrics.postEvent, {
3749
+ event: eventType.LOCAL_SDP_GENERATED,
3750
+ meetingId: meeting.id,
3751
+ });
3458
3752
 
3459
3753
  assert.calledOnce(sendRoapMediaRequestStub);
3460
3754
  assert.calledWith(sendRoapMediaRequestStub, {
3461
- seq: 1, sdp: 'fake sdp', tieBreaker: 12345, meeting, reconnect: false
3755
+ seq: 1,
3756
+ sdp: 'fake sdp',
3757
+ tieBreaker: 12345,
3758
+ meeting,
3759
+ reconnect: false,
3462
3760
  });
3463
3761
  });
3464
3762
 
@@ -3469,15 +3767,21 @@ describe('plugin-meetings', () => {
3469
3767
  seq: 10,
3470
3768
  sdp: 'fake sdp answer',
3471
3769
  tieBreaker: 12345,
3472
- }
3770
+ },
3473
3771
  });
3474
3772
 
3475
3773
  assert.calledOnce(Metrics.postEvent);
3476
- assert.calledWithMatch(Metrics.postEvent, {event: eventType.REMOTE_SDP_RECEIVED, meetingId: meeting.id});
3774
+ assert.calledWithMatch(Metrics.postEvent, {
3775
+ event: eventType.REMOTE_SDP_RECEIVED,
3776
+ meetingId: meeting.id,
3777
+ });
3477
3778
 
3478
3779
  assert.calledOnce(sendRoapAnswerStub);
3479
3780
  assert.calledWith(sendRoapAnswerStub, {
3480
- seq: 10, sdp: 'fake sdp answer', mediaId: meeting.mediaId, correlationId: meeting.correlationId
3781
+ seq: 10,
3782
+ sdp: 'fake sdp answer',
3783
+ mediaId: meeting.mediaId,
3784
+ correlationId: meeting.correlationId,
3481
3785
  });
3482
3786
  });
3483
3787
 
@@ -3490,16 +3794,20 @@ describe('plugin-meetings', () => {
3490
3794
  seq: 10,
3491
3795
  sdp: 'fake sdp answer',
3492
3796
  tieBreaker: 12345,
3493
- }
3797
+ },
3494
3798
  });
3495
3799
  await testUtils.flushPromises();
3496
3800
 
3497
3801
  assert.calledOnce(Metrics.sendBehavioralMetric);
3498
- assert.calledWithMatch(Metrics.sendBehavioralMetric, BEHAVIORAL_METRICS.ROAP_ANSWER_FAILURE, {
3499
- correlation_id: meeting.correlationId,
3500
- locus_id: meeting.locusUrl.split('/').pop(),
3501
- reason: 'sending answer failed'
3502
- });
3802
+ assert.calledWithMatch(
3803
+ Metrics.sendBehavioralMetric,
3804
+ BEHAVIORAL_METRICS.ROAP_ANSWER_FAILURE,
3805
+ {
3806
+ correlation_id: meeting.correlationId,
3807
+ locus_id: meeting.locusUrl.split('/').pop(),
3808
+ reason: 'sending answer failed',
3809
+ }
3810
+ );
3503
3811
  });
3504
3812
 
3505
3813
  [MC.ErrorType.CONFLICT, MC.ErrorType.DOUBLECONFLICT].forEach((errorType) =>
@@ -3510,21 +3818,29 @@ describe('plugin-meetings', () => {
3510
3818
  seq: 10,
3511
3819
  errorType,
3512
3820
  tieBreaker: 12345,
3513
- }
3821
+ },
3514
3822
  });
3515
3823
 
3516
3824
  assert.calledOnce(Metrics.sendBehavioralMetric);
3517
- assert.calledWithMatch(Metrics.sendBehavioralMetric, BEHAVIORAL_METRICS.ROAP_GLARE_CONDITION, {
3518
- correlation_id: meeting.correlationId,
3519
- locus_id: meeting.locusUrl.split('/').pop(),
3520
- sequence: 10
3521
- });
3825
+ assert.calledWithMatch(
3826
+ Metrics.sendBehavioralMetric,
3827
+ BEHAVIORAL_METRICS.ROAP_GLARE_CONDITION,
3828
+ {
3829
+ correlation_id: meeting.correlationId,
3830
+ locus_id: meeting.locusUrl.split('/').pop(),
3831
+ sequence: 10,
3832
+ }
3833
+ );
3522
3834
 
3523
3835
  assert.calledOnce(sendRoapErrorStub);
3524
3836
  assert.calledWith(sendRoapErrorStub, {
3525
- seq: 10, errorType, mediaId: meeting.mediaId, correlationId: meeting.correlationId
3837
+ seq: 10,
3838
+ errorType,
3839
+ mediaId: meeting.mediaId,
3840
+ correlationId: meeting.correlationId,
3526
3841
  });
3527
- }));
3842
+ })
3843
+ );
3528
3844
 
3529
3845
  it('handles ERROR message indicating other errors correctly', () => {
3530
3846
  eventListeners[MC.Event.ROAP_MESSAGE_TO_SEND]({
@@ -3533,7 +3849,7 @@ describe('plugin-meetings', () => {
3533
3849
  seq: 10,
3534
3850
  errorType: MC.ErrorType.FAILED,
3535
3851
  tieBreaker: 12345,
3536
- }
3852
+ },
3537
3853
  });
3538
3854
 
3539
3855
  assert.notCalled(Metrics.sendBehavioralMetric);
@@ -3543,7 +3859,7 @@ describe('plugin-meetings', () => {
3543
3859
  seq: 10,
3544
3860
  errorType: MC.ErrorType.FAILED,
3545
3861
  mediaId: meeting.mediaId,
3546
- correlationId: meeting.correlationId
3862
+ correlationId: meeting.correlationId,
3547
3863
  });
3548
3864
  });
3549
3865
  });
@@ -3585,11 +3901,12 @@ describe('plugin-meetings', () => {
3585
3901
 
3586
3902
  meeting.members = {locusUrlUpdate: sinon.stub().returns(Promise.resolve(test1))};
3587
3903
 
3588
- meeting.locusInfo.emit({function: 'test', file: 'test'}, 'LOCUS_INFO_UPDATE_URL', newLocusUrl);
3589
- assert.calledWith(
3590
- meeting.members.locusUrlUpdate,
3904
+ meeting.locusInfo.emit(
3905
+ {function: 'test', file: 'test'},
3906
+ 'LOCUS_INFO_UPDATE_URL',
3591
3907
  newLocusUrl
3592
3908
  );
3909
+ assert.calledWith(meeting.members.locusUrlUpdate, newLocusUrl);
3593
3910
  assert.equal(meeting.locusUrl, newLocusUrl);
3594
3911
  assert(meeting.locusId, '12345');
3595
3912
  done();
@@ -3598,7 +3915,11 @@ describe('plugin-meetings', () => {
3598
3915
  describe('#setUpLocusInfoMediaInactiveListener', () => {
3599
3916
  it('listens to disconnect due to un activity ', (done) => {
3600
3917
  TriggerProxy.trigger.reset();
3601
- meeting.locusInfo.emit({function: 'test', file: 'test'}, EVENTS.DISCONNECT_DUE_TO_INACTIVITY, {reason: 'inactive'});
3918
+ meeting.locusInfo.emit(
3919
+ {function: 'test', file: 'test'},
3920
+ EVENTS.DISCONNECT_DUE_TO_INACTIVITY,
3921
+ {reason: 'inactive'}
3922
+ );
3602
3923
  assert.calledTwice(TriggerProxy.trigger);
3603
3924
 
3604
3925
  assert.calledWith(
@@ -3625,7 +3946,11 @@ describe('plugin-meetings', () => {
3625
3946
  sinon.stub(meeting, 'reconnect');
3626
3947
 
3627
3948
  meeting.config.reconnection.autoRejoin = true;
3628
- meeting.locusInfo.emit({function: 'test', file: 'test'}, EVENTS.DISCONNECT_DUE_TO_INACTIVITY, {reason: 'inactive'});
3949
+ meeting.locusInfo.emit(
3950
+ {function: 'test', file: 'test'},
3951
+ EVENTS.DISCONNECT_DUE_TO_INACTIVITY,
3952
+ {reason: 'inactive'}
3953
+ );
3629
3954
  assert.calledOnce(TriggerProxy.trigger);
3630
3955
 
3631
3956
  assert.calledWith(
@@ -3650,7 +3975,10 @@ describe('plugin-meetings', () => {
3650
3975
  sinon.stub(meeting.reconnectionManager, 'cleanUp');
3651
3976
  sinon.spy(MeetingUtil, 'cleanUp');
3652
3977
 
3653
- meeting.locusInfo.emit({function: 'test', file: 'test'}, EVENTS.DESTROY_MEETING, {shouldLeave: false, reason: 'ended'});
3978
+ meeting.locusInfo.emit({function: 'test', file: 'test'}, EVENTS.DESTROY_MEETING, {
3979
+ shouldLeave: false,
3980
+ reason: 'ended',
3981
+ });
3654
3982
  assert.calledOnce(TriggerProxy.trigger);
3655
3983
  assert.calledOnce(MeetingUtil.cleanUp);
3656
3984
  assert.calledWith(
@@ -3658,12 +3986,12 @@ describe('plugin-meetings', () => {
3658
3986
  meeting,
3659
3987
  {
3660
3988
  file: 'meeting/index',
3661
- function: 'setUpLocusInfoMeetingListener'
3989
+ function: 'setUpLocusInfoMeetingListener',
3662
3990
  },
3663
3991
  EVENTS.DESTROY_MEETING,
3664
3992
  {
3665
3993
  reason: 'ended',
3666
- meetingId: meeting.id
3994
+ meetingId: meeting.id,
3667
3995
  }
3668
3996
  );
3669
3997
  done();
@@ -3689,7 +4017,9 @@ describe('plugin-meetings', () => {
3689
4017
  });
3690
4018
  beforeEach(() => {
3691
4019
  meeting.selfId = 'some self id';
3692
- meeting.locusInfo.mediaShares = [{name: 'content', url: url1, floor: {beneficiary: {id: meeting.selfId}}}];
4020
+ meeting.locusInfo.mediaShares = [
4021
+ {name: 'content', url: url1, floor: {beneficiary: {id: meeting.selfId}}},
4022
+ ];
3693
4023
  meeting.locusInfo.self = {url: url2};
3694
4024
  meeting.mediaProperties = {mediaDirection: {sendShare: true}};
3695
4025
  meeting.meetingRequest.changeMeetingFloor = sinon.stub().returns(Promise.resolve());
@@ -3792,8 +4122,8 @@ describe('plugin-meetings', () => {
3792
4122
  permissionToken: 'abc',
3793
4123
  sipMeetingUri: test1,
3794
4124
  sipUrl: test1,
3795
- owner: test2
3796
- }
4125
+ owner: test2,
4126
+ },
3797
4127
  };
3798
4128
 
3799
4129
  meeting.parseMeetingInfo(FAKE_MEETING_INFO);
@@ -3804,7 +4134,7 @@ describe('plugin-meetings', () => {
3804
4134
  meetingNumber: '12345',
3805
4135
  meetingJoinUrl: url2,
3806
4136
  owner: test2,
3807
- permissionToken: 'abc'
4137
+ permissionToken: 'abc',
3808
4138
  };
3809
4139
 
3810
4140
  checkParseMeetingInfo(expectedInfoToParse);
@@ -3818,8 +4148,8 @@ describe('plugin-meetings', () => {
3818
4148
  info: {
3819
4149
  webExMeetingId: 'locusMeetingId',
3820
4150
  sipUri: 'locusSipUri',
3821
- owner: 'locusOwner'
3822
- }
4151
+ owner: 'locusOwner',
4152
+ },
3823
4153
  };
3824
4154
  const FAKE_MEETING_INFO = {
3825
4155
  body: {
@@ -3830,8 +4160,8 @@ describe('plugin-meetings', () => {
3830
4160
  permissionToken: 'abc',
3831
4161
  sipMeetingUri: test1,
3832
4162
  sipUrl: test1,
3833
- owner: test2
3834
- }
4163
+ owner: test2,
4164
+ },
3835
4165
  };
3836
4166
 
3837
4167
  meeting.parseMeetingInfo(FAKE_MEETING_INFO, FAKE_LOCUS_MEETING);
@@ -3842,7 +4172,7 @@ describe('plugin-meetings', () => {
3842
4172
  meetingNumber: 'locusMeetingId',
3843
4173
  meetingJoinUrl: url2,
3844
4174
  owner: 'locusOwner',
3845
- permissionToken: 'abc'
4175
+ permissionToken: 'abc',
3846
4176
  };
3847
4177
 
3848
4178
  checkParseMeetingInfo(expectedInfoToParse);
@@ -3859,8 +4189,8 @@ describe('plugin-meetings', () => {
3859
4189
  permissionToken: 'abc',
3860
4190
  sipMeetingUri: test1,
3861
4191
  sipUrl: test1,
3862
- owner: test2
3863
- }
4192
+ owner: test2,
4193
+ },
3864
4194
  };
3865
4195
 
3866
4196
  meeting.parseMeetingInfo(FAKE_MEETING_INFO);
@@ -3871,7 +4201,7 @@ describe('plugin-meetings', () => {
3871
4201
  meetingNumber: '12345',
3872
4202
  meetingJoinUrl: url2,
3873
4203
  owner: test2,
3874
- permissionToken: 'abc'
4204
+ permissionToken: 'abc',
3875
4205
  };
3876
4206
 
3877
4207
  checkParseMeetingInfo(expectedInfoToParse);
@@ -3889,8 +4219,8 @@ describe('plugin-meetings', () => {
3889
4219
  permissionToken: 'abc',
3890
4220
  sipMeetingUri: test1,
3891
4221
  sipUrl: test1,
3892
- owner: test2
3893
- }
4222
+ owner: test2,
4223
+ },
3894
4224
  };
3895
4225
 
3896
4226
  meeting.parseMeetingInfo(FAKE_MEETING_INFO, FAKE_STRING_DESTINATION);
@@ -3901,7 +4231,7 @@ describe('plugin-meetings', () => {
3901
4231
  meetingNumber: '12345',
3902
4232
  meetingJoinUrl: url2,
3903
4233
  owner: test2,
3904
- permissionToken: 'abc'
4234
+ permissionToken: 'abc',
3905
4235
  };
3906
4236
 
3907
4237
  checkParseMeetingInfo(expectedInfoToParse);
@@ -3917,7 +4247,11 @@ describe('plugin-meetings', () => {
3917
4247
  meeting.type = 'CALL';
3918
4248
  meeting.parseLocus({url: url1, participants: [{id: uuid1}], self: {id: uuid2}});
3919
4249
  assert.calledOnce(meeting.setLocus);
3920
- assert.calledWith(meeting.setLocus, {url: url1, participants: [{id: uuid1}], self: {id: uuid2}});
4250
+ assert.calledWith(meeting.setLocus, {
4251
+ url: url1,
4252
+ participants: [{id: uuid1}],
4253
+ self: {id: uuid2},
4254
+ });
3921
4255
  assert.calledOnce(MeetingUtil.getLocusPartner);
3922
4256
  assert.calledWith(MeetingUtil.getLocusPartner, [{id: uuid1}], {id: uuid2});
3923
4257
  assert.deepEqual(meeting.partner, {person: {sipUrl: uuid3}});
@@ -3966,7 +4300,7 @@ describe('plugin-meetings', () => {
3966
4300
  meeting,
3967
4301
  {
3968
4302
  file: 'meeting/index',
3969
- function: 'setUpLocusInfoAssignHostListener'
4303
+ function: 'setUpLocusInfoAssignHostListener',
3970
4304
  },
3971
4305
  'meeting:actionsUpdate',
3972
4306
  meeting.inMeetingActions.get()
@@ -4007,7 +4341,10 @@ describe('plugin-meetings', () => {
4007
4341
  inMeetingActionsSetSpy = sinon.spy(meeting.inMeetingActions, 'set');
4008
4342
  canUserRaiseHandSpy = sinon.spy(MeetingUtil, 'canUserRaiseHand');
4009
4343
  canUserLowerAllHandsSpy = sinon.spy(MeetingUtil, 'canUserLowerAllHands');
4010
- bothLeaveAndEndMeetingAvailableSpy = sinon.spy(MeetingUtil, 'bothLeaveAndEndMeetingAvailable');
4344
+ bothLeaveAndEndMeetingAvailableSpy = sinon.spy(
4345
+ MeetingUtil,
4346
+ 'bothLeaveAndEndMeetingAvailable'
4347
+ );
4011
4348
  canUserLowerSomeoneElsesHandSpy = sinon.spy(MeetingUtil, 'canUserLowerSomeoneElsesHand');
4012
4349
  waitingForOthersToJoinSpy = sinon.spy(MeetingUtil, 'waitingForOthersToJoin');
4013
4350
  handleDataChannelUrlChangeSpy = sinon.spy(meeting, 'handleDataChannelUrlChange');
@@ -4019,7 +4356,6 @@ describe('plugin-meetings', () => {
4019
4356
  waitingForOthersToJoinSpy.restore();
4020
4357
  });
4021
4358
 
4022
-
4023
4359
  it('registers the correct MEETING_INFO_UPDATED event', () => {
4024
4360
  meeting.setUpLocusInfoMeetingInfoListener();
4025
4361
 
@@ -4033,8 +4369,8 @@ describe('plugin-meetings', () => {
4033
4369
  const payload = {
4034
4370
  info: {
4035
4371
  userDisplayHints: ['LOCK_CONTROL_UNLOCK'],
4036
- datachannelUrl: 'some url'
4037
- }
4372
+ datachannelUrl: 'some url',
4373
+ },
4038
4374
  };
4039
4375
 
4040
4376
  callback(payload);
@@ -4057,7 +4393,7 @@ describe('plugin-meetings', () => {
4057
4393
  meeting,
4058
4394
  {
4059
4395
  file: 'meeting/index',
4060
- function: 'setUpLocusInfoMeetingInfoListener'
4396
+ function: 'setUpLocusInfoMeetingInfoListener',
4061
4397
  },
4062
4398
  'meeting:actionsUpdate',
4063
4399
  meeting.inMeetingActions.get()
@@ -4087,8 +4423,7 @@ describe('plugin-meetings', () => {
4087
4423
 
4088
4424
  if (expectedCalled) {
4089
4425
  assert.calledWith(updateLLMConnectionSpy);
4090
- }
4091
- else {
4426
+ } else {
4092
4427
  assert.notCalled(updateLLMConnectionSpy);
4093
4428
  }
4094
4429
  };
@@ -4112,7 +4447,9 @@ describe('plugin-meetings', () => {
4112
4447
  beforeEach(() => {
4113
4448
  webex.internal.llm.isConnected = sinon.stub().returns(false);
4114
4449
  webex.internal.llm.getLocusUrl = sinon.stub();
4115
- webex.internal.llm.registerAndConnect = sinon.stub().returns(Promise.resolve('something'));
4450
+ webex.internal.llm.registerAndConnect = sinon
4451
+ .stub()
4452
+ .returns(Promise.resolve('something'));
4116
4453
  webex.internal.llm.disconnectLLM = sinon.stub().returns(Promise.resolve());
4117
4454
  });
4118
4455
 
@@ -4164,7 +4501,11 @@ describe('plugin-meetings', () => {
4164
4501
  const result = await meeting.updateLLMConnection();
4165
4502
 
4166
4503
  assert.calledWith(webex.internal.llm.disconnectLLM);
4167
- assert.calledWith(webex.internal.llm.registerAndConnect, 'a different url', 'a datachannel url');
4504
+ assert.calledWith(
4505
+ webex.internal.llm.registerAndConnect,
4506
+ 'a different url',
4507
+ 'a datachannel url'
4508
+ );
4168
4509
  assert.equal(result, 'something');
4169
4510
  });
4170
4511
 
@@ -4194,7 +4535,7 @@ describe('plugin-meetings', () => {
4194
4535
  locusId: uuid1,
4195
4536
  selfId: uuid2,
4196
4537
  mediaId: uuid3,
4197
- host: {id: uuid4}
4538
+ host: {id: uuid4},
4198
4539
  });
4199
4540
  assert.calledOnce(meeting.locusInfo.initialSetup);
4200
4541
  assert.calledWith(meeting.locusInfo.initialSetup, {
@@ -4203,7 +4544,7 @@ describe('plugin-meetings', () => {
4203
4544
  locusId: uuid1,
4204
4545
  selfId: uuid2,
4205
4546
  mediaId: uuid3,
4206
- host: {id: uuid4}
4547
+ host: {id: uuid4},
4207
4548
  });
4208
4549
  assert.equal(meeting.mediaConnections, test1);
4209
4550
  assert.equal(meeting.locusUrl, url1);
@@ -4252,7 +4593,7 @@ describe('plugin-meetings', () => {
4252
4593
  });
4253
4594
  it('should send the whiteboard share', async () => {
4254
4595
  const whiteboardShare = meeting.startWhiteboardShare({
4255
- channelUrl: url2
4596
+ channelUrl: url2,
4256
4597
  });
4257
4598
 
4258
4599
  assert.exists(whiteboardShare.then);
@@ -4292,18 +4633,35 @@ describe('plugin-meetings', () => {
4292
4633
  const USER_IDS = {
4293
4634
  ME: '9528d952-e4de-46cf-8157-fd4823b98377',
4294
4635
  REMOTE_A: '5be7e7b0-b304-48da-8083-83bd72b5300d',
4295
- REMOTE_B: 'd4d102a1-17ce-4e17-9b08-bded3de467e4'
4636
+ REMOTE_B: 'd4d102a1-17ce-4e17-9b08-bded3de467e4',
4296
4637
  };
4297
4638
 
4298
4639
  const RESOURCE_URLS = {
4299
- WHITEBOARD_A: 'https://board-a.wbx2.com/board/api/v1/channels/49cfb550-5517-11eb-a2af-1b9e4bc3da13',
4300
- WHITEBOARD_B: 'https://board-a.wbx2.com/board/api/v1/channels/977a7330-54f4-11eb-b1ef-91f5eefc7bf3'
4640
+ WHITEBOARD_A:
4641
+ 'https://board-a.wbx2.com/board/api/v1/channels/49cfb550-5517-11eb-a2af-1b9e4bc3da13',
4642
+ WHITEBOARD_B:
4643
+ 'https://board-a.wbx2.com/board/api/v1/channels/977a7330-54f4-11eb-b1ef-91f5eefc7bf3',
4301
4644
  };
4302
4645
 
4303
- const generateContent = (beneficiaryId = null, disposition = null) => ({beneficiaryId, disposition});
4304
- const generateWhiteboard = (beneficiaryId = null, disposition = null, resourceUrl = null) => ({beneficiaryId, disposition, resourceUrl});
4305
-
4306
- const generateData = (payload, isGranting, isContent, beneficiaryId, resourceUrl, isAccepting, otherBeneficiaryId) => {
4646
+ const generateContent = (beneficiaryId = null, disposition = null) => ({
4647
+ beneficiaryId,
4648
+ disposition,
4649
+ });
4650
+ const generateWhiteboard = (
4651
+ beneficiaryId = null,
4652
+ disposition = null,
4653
+ resourceUrl = null
4654
+ ) => ({beneficiaryId, disposition, resourceUrl});
4655
+
4656
+ const generateData = (
4657
+ payload,
4658
+ isGranting,
4659
+ isContent,
4660
+ beneficiaryId,
4661
+ resourceUrl,
4662
+ isAccepting,
4663
+ otherBeneficiaryId
4664
+ ) => {
4307
4665
  const newPayload = cloneDeep(payload);
4308
4666
 
4309
4667
  newPayload.previous = cloneDeep(payload.current);
@@ -4314,15 +4672,15 @@ describe('plugin-meetings', () => {
4314
4672
  eventName: EVENT_TRIGGERS.MEMBERS_CONTENT_UPDATE,
4315
4673
  eventPayload: {
4316
4674
  activeSharingId: null,
4317
- endedSharingId: null
4318
- }
4319
- }
4675
+ endedSharingId: null,
4676
+ },
4677
+ },
4320
4678
  };
4321
4679
 
4322
4680
  let shareStatus = null;
4323
4681
  const activeSharingId = {
4324
4682
  whiteboard: null,
4325
- content: null
4683
+ content: null,
4326
4684
  };
4327
4685
 
4328
4686
  if (isGranting) {
@@ -4332,68 +4690,72 @@ describe('plugin-meetings', () => {
4332
4690
 
4333
4691
  if (isEqual(newPayload.current, newPayload.previous)) {
4334
4692
  eventTrigger.member = null;
4335
- }
4336
- else {
4693
+ } else {
4337
4694
  if (newPayload.current.whiteboard.beneficiaryId) {
4338
4695
  if (newPayload.current.whiteboard.disposition === FLOOR_ACTION.GRANTED) {
4339
4696
  newPayload.current.whiteboard.disposition = FLOOR_ACTION.RELEASED;
4340
4697
  eventTrigger.share.push({
4341
4698
  eventName: EVENT_TRIGGERS.MEETING_STOPPED_SHARING_WHITEBOARD,
4342
- functionName: 'stopWhiteboardShare'
4699
+ functionName: 'stopWhiteboardShare',
4343
4700
  });
4344
- eventTrigger.member.eventPayload.endedSharingId = newPayload.current.whiteboard.beneficiaryId;
4701
+ eventTrigger.member.eventPayload.endedSharingId =
4702
+ newPayload.current.whiteboard.beneficiaryId;
4345
4703
  }
4346
4704
  }
4347
4705
 
4348
4706
  if (newPayload.previous.content.beneficiaryId) {
4349
- if (newPayload.previous.content.beneficiaryId !== newPayload.current.content.beneficiaryId) {
4707
+ if (
4708
+ newPayload.previous.content.beneficiaryId !==
4709
+ newPayload.current.content.beneficiaryId
4710
+ ) {
4350
4711
  if (newPayload.previous.content.beneficiaryId === USER_IDS.ME) {
4351
4712
  eventTrigger.share.push({
4352
4713
  eventName: EVENT_TRIGGERS.MEETING_STOPPED_SHARING_LOCAL,
4353
- functionName: 'localShare'
4714
+ functionName: 'localShare',
4354
4715
  });
4355
- }
4356
- else if (newPayload.current.content.beneficiaryId === USER_IDS.ME) {
4716
+ } else if (newPayload.current.content.beneficiaryId === USER_IDS.ME) {
4357
4717
  eventTrigger.share.push({
4358
4718
  eventName: EVENT_TRIGGERS.MEETING_STOPPED_SHARING_REMOTE,
4359
- functionName: 'remoteShare'
4719
+ functionName: 'remoteShare',
4360
4720
  });
4361
4721
  }
4362
- eventTrigger.member.eventPayload.endedSharingId = newPayload.previous.content.beneficiaryId;
4722
+ eventTrigger.member.eventPayload.endedSharingId =
4723
+ newPayload.previous.content.beneficiaryId;
4363
4724
  }
4364
4725
  }
4365
4726
 
4366
4727
  if (isAccepting) {
4367
4728
  eventTrigger.share.push({
4368
4729
  eventName: EVENT_TRIGGERS.MEETING_STOPPED_SHARING_WHITEBOARD,
4369
- functionName: 'stopWhiteboardShare'
4730
+ functionName: 'stopWhiteboardShare',
4370
4731
  });
4371
4732
  }
4372
4733
 
4373
4734
  if (beneficiaryId === USER_IDS.ME) {
4374
4735
  eventTrigger.share.push({
4375
4736
  eventName: EVENT_TRIGGERS.MEETING_STARTED_SHARING_LOCAL,
4376
- functionName: 'share'
4737
+ functionName: 'share',
4377
4738
  });
4378
- }
4379
- else {
4739
+ } else {
4380
4740
  eventTrigger.share.push({
4381
4741
  eventName: EVENT_TRIGGERS.MEETING_STARTED_SHARING_REMOTE,
4382
4742
  functionName: 'remoteShare',
4383
- eventPayload: {memberId: beneficiaryId}
4743
+ eventPayload: {memberId: beneficiaryId},
4384
4744
  });
4385
4745
  }
4386
4746
  }
4387
4747
 
4388
4748
  if (beneficiaryId === USER_IDS.ME) {
4389
4749
  shareStatus = SHARE_STATUS.LOCAL_SHARE_ACTIVE;
4390
- }
4391
- else {
4750
+ } else {
4392
4751
  shareStatus = SHARE_STATUS.REMOTE_SHARE_ACTIVE;
4393
4752
  }
4394
- }
4395
- else {
4396
- newPayload.current.whiteboard = generateWhiteboard(beneficiaryId, FLOOR_ACTION.GRANTED, resourceUrl);
4753
+ } else {
4754
+ newPayload.current.whiteboard = generateWhiteboard(
4755
+ beneficiaryId,
4756
+ FLOOR_ACTION.GRANTED,
4757
+ resourceUrl
4758
+ );
4397
4759
 
4398
4760
  if (newPayload.current.content.beneficiaryId) {
4399
4761
  if (newPayload.current.content.disposition === FLOOR_ACTION.GRANTED) {
@@ -4401,41 +4763,48 @@ describe('plugin-meetings', () => {
4401
4763
  if (newPayload.current.content.beneficiaryId === USER_IDS.ME) {
4402
4764
  eventTrigger.share.push({
4403
4765
  eventName: EVENT_TRIGGERS.MEETING_STOPPED_SHARING_LOCAL,
4404
- functionName: 'localShare'
4766
+ functionName: 'localShare',
4405
4767
  });
4406
- }
4407
- else {
4768
+ } else {
4408
4769
  eventTrigger.share.push({
4409
4770
  eventName: EVENT_TRIGGERS.MEETING_STOPPED_SHARING_REMOTE,
4410
- functionName: 'remoteShare'
4771
+ functionName: 'remoteShare',
4411
4772
  });
4412
4773
  }
4413
4774
 
4414
- eventTrigger.member.eventPayload.endedSharingId = newPayload.current.content.beneficiaryId;
4775
+ eventTrigger.member.eventPayload.endedSharingId =
4776
+ newPayload.current.content.beneficiaryId;
4415
4777
  }
4416
4778
  }
4417
4779
 
4418
4780
  if (newPayload.previous.content.beneficiaryId) {
4419
- if (newPayload.previous.content.beneficiaryId !== newPayload.current.content.beneficiaryId) {
4781
+ if (
4782
+ newPayload.previous.content.beneficiaryId !==
4783
+ newPayload.current.content.beneficiaryId
4784
+ ) {
4420
4785
  if (newPayload.previous.content.beneficiaryId === USER_IDS.ME) {
4421
4786
  eventTrigger.share.push({
4422
4787
  eventName: EVENT_TRIGGERS.MEETING_STOPPED_SHARING_LOCAL,
4423
- functionName: 'localShare'
4788
+ functionName: 'localShare',
4424
4789
  });
4425
- }
4426
- else if (newPayload.current.content.beneficiaryId === USER_IDS.ME) {
4790
+ } else if (newPayload.current.content.beneficiaryId === USER_IDS.ME) {
4427
4791
  eventTrigger.share.push({
4428
4792
  eventName: EVENT_TRIGGERS.MEETING_STOPPED_SHARING_REMOTE,
4429
- functionName: 'remoteShare'
4793
+ functionName: 'remoteShare',
4430
4794
  });
4431
4795
  }
4432
- eventTrigger.member.eventPayload.endedSharingId = newPayload.previous.content.beneficiaryId;
4796
+ eventTrigger.member.eventPayload.endedSharingId =
4797
+ newPayload.previous.content.beneficiaryId;
4433
4798
  }
4434
4799
  }
4435
4800
 
4436
4801
  if (newPayload.previous.whiteboard.beneficiaryId) {
4437
- if (newPayload.previous.whiteboard.beneficiaryId !== newPayload.current.whiteboard.beneficiaryId) {
4438
- eventTrigger.member.eventPayload.endedSharingId = newPayload.previous.whiteboard.beneficiaryId;
4802
+ if (
4803
+ newPayload.previous.whiteboard.beneficiaryId !==
4804
+ newPayload.current.whiteboard.beneficiaryId
4805
+ ) {
4806
+ eventTrigger.member.eventPayload.endedSharingId =
4807
+ newPayload.previous.whiteboard.beneficiaryId;
4439
4808
  }
4440
4809
  }
4441
4810
 
@@ -4444,7 +4813,7 @@ describe('plugin-meetings', () => {
4444
4813
  eventTrigger.share.push({
4445
4814
  eventName: EVENT_TRIGGERS.MEETING_STARTED_SHARING_WHITEBOARD,
4446
4815
  functionName: 'startWhiteboardShare',
4447
- eventPayload: {resourceUrl, memberId: beneficiaryId}
4816
+ eventPayload: {resourceUrl, memberId: beneficiaryId},
4448
4817
  });
4449
4818
 
4450
4819
  shareStatus = SHARE_STATUS.WHITEBOARD_SHARE_ACTIVE;
@@ -4453,8 +4822,7 @@ describe('plugin-meetings', () => {
4453
4822
  if (eventTrigger.member) {
4454
4823
  eventTrigger.member.eventPayload.activeSharingId = beneficiaryId;
4455
4824
  }
4456
- }
4457
- else {
4825
+ } else {
4458
4826
  eventTrigger.member.eventPayload.endedSharingId = beneficiaryId;
4459
4827
 
4460
4828
  if (isContent) {
@@ -4463,19 +4831,17 @@ describe('plugin-meetings', () => {
4463
4831
  if (beneficiaryId === USER_IDS.ME) {
4464
4832
  eventTrigger.share.push({
4465
4833
  eventName: EVENT_TRIGGERS.MEETING_STOPPED_SHARING_LOCAL,
4466
- functionName: 'localShare'
4834
+ functionName: 'localShare',
4467
4835
  });
4468
- }
4469
- else {
4836
+ } else {
4470
4837
  eventTrigger.share.push({
4471
4838
  eventName: EVENT_TRIGGERS.MEETING_STOPPED_SHARING_REMOTE,
4472
- functionName: 'remoteShare'
4839
+ functionName: 'remoteShare',
4473
4840
  });
4474
4841
  }
4475
4842
 
4476
4843
  shareStatus = SHARE_STATUS.NO_SHARE;
4477
- }
4478
- else {
4844
+ } else {
4479
4845
  newPayload.current.whiteboard.disposition = FLOOR_ACTION.RELEASED;
4480
4846
 
4481
4847
  if (isAccepting) {
@@ -4485,15 +4851,14 @@ describe('plugin-meetings', () => {
4485
4851
  eventTrigger.share.push({
4486
4852
  eventName: EVENT_TRIGGERS.MEETING_STARTED_SHARING_WHITEBOARD,
4487
4853
  functionName: 'startWhiteboardShare',
4488
- eventPayload: {resourceUrl, memberId: beneficiaryId}
4854
+ eventPayload: {resourceUrl, memberId: beneficiaryId},
4489
4855
  });
4490
4856
 
4491
4857
  shareStatus = SHARE_STATUS.WHITEBOARD_SHARE_ACTIVE;
4492
- }
4493
- else {
4858
+ } else {
4494
4859
  eventTrigger.share.push({
4495
4860
  eventName: EVENT_TRIGGERS.MEETING_STOPPED_SHARING_WHITEBOARD,
4496
- functionName: 'stopWhiteboardShare'
4861
+ functionName: 'stopWhiteboardShare',
4497
4862
  });
4498
4863
 
4499
4864
  shareStatus = SHARE_STATUS.NO_SHARE;
@@ -4502,22 +4867,24 @@ describe('plugin-meetings', () => {
4502
4867
  }
4503
4868
 
4504
4869
  return {
4505
- payload: newPayload, eventTrigger, shareStatus, activeSharingId
4870
+ payload: newPayload,
4871
+ eventTrigger,
4872
+ shareStatus,
4873
+ activeSharingId,
4506
4874
  };
4507
4875
  };
4508
4876
 
4509
4877
  const blankPayload = {
4510
4878
  previous: {
4511
4879
  content: generateContent(),
4512
- whiteboard: generateWhiteboard()
4880
+ whiteboard: generateWhiteboard(),
4513
4881
  },
4514
4882
  current: {
4515
4883
  content: generateContent(),
4516
- whiteboard: generateWhiteboard()
4517
- }
4884
+ whiteboard: generateWhiteboard(),
4885
+ },
4518
4886
  };
4519
4887
 
4520
-
4521
4888
  const payloadTestHelper = (data) => {
4522
4889
  assert.equal(meeting.shareStatus, SHARE_STATUS.NO_SHARE);
4523
4890
 
@@ -4525,23 +4892,33 @@ describe('plugin-meetings', () => {
4525
4892
  let callCounter = 1;
4526
4893
 
4527
4894
  data.forEach((d, index) => {
4528
- meeting.locusInfo.emit({function: 'test', file: 'test'}, EVENTS.LOCUS_INFO_UPDATE_MEDIA_SHARES, d.payload);
4895
+ meeting.locusInfo.emit(
4896
+ {function: 'test', file: 'test'},
4897
+ EVENTS.LOCUS_INFO_UPDATE_MEDIA_SHARES,
4898
+ d.payload
4899
+ );
4529
4900
 
4530
4901
  assert.equal(meeting.shareStatus, data[index].shareStatus);
4531
4902
 
4532
- callCounter += data[index].eventTrigger.share.length + (data[index].eventTrigger.member ? 1 : 0);
4903
+ callCounter +=
4904
+ data[index].eventTrigger.share.length + (data[index].eventTrigger.member ? 1 : 0);
4533
4905
 
4534
4906
  assert.callCount(TriggerProxy.trigger, callCounter);
4535
4907
 
4536
- assert.equal(meeting.members.mediaShareWhiteboardId, data[index].activeSharingId.whiteboard);
4537
- assert.equal(meeting.members.mediaShareContentId, data[index].activeSharingId.content);
4908
+ assert.equal(
4909
+ meeting.members.mediaShareWhiteboardId,
4910
+ data[index].activeSharingId.whiteboard
4911
+ );
4912
+ assert.equal(
4913
+ meeting.members.mediaShareContentId,
4914
+ data[index].activeSharingId.content
4915
+ );
4538
4916
  });
4539
4917
 
4540
4918
  assert.callCount(TriggerProxy.trigger, callCounter);
4541
4919
 
4542
4920
  // Start with 1 to ignore members:update trigger
4543
4921
 
4544
-
4545
4922
  let i = 1;
4546
4923
  let offset = 2;
4547
4924
 
@@ -4553,21 +4930,24 @@ describe('plugin-meetings', () => {
4553
4930
  for (let idx = 0; idx < share.length; idx += 1) {
4554
4931
  const shareCallArgs = TriggerProxy.trigger.getCall(i + idx).args;
4555
4932
  const {functionName, eventName, eventPayload} = share[idx];
4556
- const fileName = functionName === 'remoteShare' ? 'meetings/index' : 'meeting/index';
4933
+ const fileName =
4934
+ functionName === 'remoteShare' ? 'meetings/index' : 'meeting/index';
4557
4935
 
4558
4936
  assert.deepEqual(shareCallArgs[1], {
4559
4937
  file: fileName,
4560
- function: functionName
4938
+ function: functionName,
4561
4939
  });
4562
4940
 
4563
-
4564
4941
  assert.equal(shareCallArgs[2], eventName);
4565
4942
 
4566
4943
  if (functionName === 'startWhiteboardShare') {
4567
4944
  assert.deepEqual(shareCallArgs[3], eventPayload);
4568
4945
  }
4569
4946
 
4570
- if (functionName === 'remoteShare' && eventName === EVENT_TRIGGERS.MEETING_STARTED_SHARING_REMOTE) {
4947
+ if (
4948
+ functionName === 'remoteShare' &&
4949
+ eventName === EVENT_TRIGGERS.MEETING_STARTED_SHARING_REMOTE
4950
+ ) {
4571
4951
  assert.deepEqual(shareCallArgs[3], eventPayload);
4572
4952
  }
4573
4953
  }
@@ -4578,7 +4958,7 @@ describe('plugin-meetings', () => {
4578
4958
 
4579
4959
  assert.deepEqual(memberCallArgs[1], {
4580
4960
  file: 'members',
4581
- function: 'locusMediaSharesUpdate'
4961
+ function: 'locusMediaSharesUpdate',
4582
4962
  });
4583
4963
  assert.equal(memberCallArgs[2], member.eventName);
4584
4964
 
@@ -4592,9 +4972,8 @@ describe('plugin-meetings', () => {
4592
4972
 
4593
4973
  if (share.length + 1 > offset) {
4594
4974
  offset = (offset + share.length + 1) / 2;
4595
- }
4596
- else if (share.length + 1 < offset) {
4597
- offset = (share.length + 1) + 0.5;
4975
+ } else if (share.length + 1 < offset) {
4976
+ offset = share.length + 1 + 0.5;
4598
4977
  }
4599
4978
  }
4600
4979
  };
@@ -4605,40 +4984,100 @@ describe('plugin-meetings', () => {
4605
4984
 
4606
4985
  describe('Whiteboard A --> Whiteboard B', () => {
4607
4986
  it('Scenario #1: you share both whiteboards', () => {
4608
- const data1 = generateData(blankPayload, true, false, USER_IDS.ME, RESOURCE_URLS.WHITEBOARD_A);
4609
- const data2 = generateData(data1.payload, true, false, USER_IDS.ME, RESOURCE_URLS.WHITEBOARD_B);
4987
+ const data1 = generateData(
4988
+ blankPayload,
4989
+ true,
4990
+ false,
4991
+ USER_IDS.ME,
4992
+ RESOURCE_URLS.WHITEBOARD_A
4993
+ );
4994
+ const data2 = generateData(
4995
+ data1.payload,
4996
+ true,
4997
+ false,
4998
+ USER_IDS.ME,
4999
+ RESOURCE_URLS.WHITEBOARD_B
5000
+ );
4610
5001
  const data3 = generateData(data2.payload, false, false, USER_IDS.ME);
4611
5002
 
4612
5003
  payloadTestHelper([data1, data2, data3]);
4613
5004
  });
4614
5005
 
4615
5006
  it('Scenario #2: you share whiteboard A and remote person A shares whiteboard B', () => {
4616
- const data1 = generateData(blankPayload, true, false, USER_IDS.ME, RESOURCE_URLS.WHITEBOARD_A);
4617
- const data2 = generateData(data1.payload, true, false, USER_IDS.REMOTE_A, RESOURCE_URLS.WHITEBOARD_B);
5007
+ const data1 = generateData(
5008
+ blankPayload,
5009
+ true,
5010
+ false,
5011
+ USER_IDS.ME,
5012
+ RESOURCE_URLS.WHITEBOARD_A
5013
+ );
5014
+ const data2 = generateData(
5015
+ data1.payload,
5016
+ true,
5017
+ false,
5018
+ USER_IDS.REMOTE_A,
5019
+ RESOURCE_URLS.WHITEBOARD_B
5020
+ );
4618
5021
  const data3 = generateData(data2.payload, false, false, USER_IDS.REMOTE_A);
4619
5022
 
4620
5023
  payloadTestHelper([data1, data2, data3]);
4621
5024
  });
4622
5025
 
4623
5026
  it('Scenario #3: remote person A shares whiteboard A and you share whiteboard B', () => {
4624
- const data1 = generateData(blankPayload, true, false, USER_IDS.REMOTE_A, RESOURCE_URLS.WHITEBOARD_A);
4625
- const data2 = generateData(data1.payload, true, false, USER_IDS.ME, RESOURCE_URLS.WHITEBOARD_B);
5027
+ const data1 = generateData(
5028
+ blankPayload,
5029
+ true,
5030
+ false,
5031
+ USER_IDS.REMOTE_A,
5032
+ RESOURCE_URLS.WHITEBOARD_A
5033
+ );
5034
+ const data2 = generateData(
5035
+ data1.payload,
5036
+ true,
5037
+ false,
5038
+ USER_IDS.ME,
5039
+ RESOURCE_URLS.WHITEBOARD_B
5040
+ );
4626
5041
  const data3 = generateData(data2.payload, false, false, USER_IDS.ME);
4627
5042
 
4628
5043
  payloadTestHelper([data1, data2, data3]);
4629
5044
  });
4630
5045
 
4631
5046
  it('Scenario #4: remote person A shares both whiteboards', () => {
4632
- const data1 = generateData(blankPayload, true, false, USER_IDS.REMOTE_A, RESOURCE_URLS.WHITEBOARD_A);
4633
- const data2 = generateData(data1.payload, true, false, USER_IDS.REMOTE_A, RESOURCE_URLS.WHITEBOARD_B);
5047
+ const data1 = generateData(
5048
+ blankPayload,
5049
+ true,
5050
+ false,
5051
+ USER_IDS.REMOTE_A,
5052
+ RESOURCE_URLS.WHITEBOARD_A
5053
+ );
5054
+ const data2 = generateData(
5055
+ data1.payload,
5056
+ true,
5057
+ false,
5058
+ USER_IDS.REMOTE_A,
5059
+ RESOURCE_URLS.WHITEBOARD_B
5060
+ );
4634
5061
  const data3 = generateData(data2.payload, false, false, USER_IDS.REMOTE_A);
4635
5062
 
4636
5063
  payloadTestHelper([data1, data2, data3]);
4637
5064
  });
4638
5065
 
4639
5066
  it('Scenario #5: remote person A shares whiteboard A and remote person B shares whiteboard B', () => {
4640
- const data1 = generateData(blankPayload, true, false, USER_IDS.REMOTE_A, RESOURCE_URLS.WHITEBOARD_A);
4641
- const data2 = generateData(data1.payload, true, false, USER_IDS.REMOTE_B, RESOURCE_URLS.WHITEBOARD_B);
5067
+ const data1 = generateData(
5068
+ blankPayload,
5069
+ true,
5070
+ false,
5071
+ USER_IDS.REMOTE_A,
5072
+ RESOURCE_URLS.WHITEBOARD_A
5073
+ );
5074
+ const data2 = generateData(
5075
+ data1.payload,
5076
+ true,
5077
+ false,
5078
+ USER_IDS.REMOTE_B,
5079
+ RESOURCE_URLS.WHITEBOARD_B
5080
+ );
4642
5081
  const data3 = generateData(data2.payload, false, false, USER_IDS.REMOTE_B);
4643
5082
 
4644
5083
  payloadTestHelper([data1, data2, data3]);
@@ -4647,45 +5086,155 @@ describe('plugin-meetings', () => {
4647
5086
 
4648
5087
  describe('Whiteboard A --> Desktop', () => {
4649
5088
  it('Scenario #1: you share whiteboard and then share desktop', () => {
4650
- const data1 = generateData(blankPayload, true, false, USER_IDS.ME, RESOURCE_URLS.WHITEBOARD_A);
4651
- const data2 = generateData(data1.payload, false, false, USER_IDS.ME, RESOURCE_URLS.WHITEBOARD_A, true, USER_IDS.ME);
4652
- const data3 = generateData(data2.payload, true, true, USER_IDS.ME, undefined, true, USER_IDS.ME);
5089
+ const data1 = generateData(
5090
+ blankPayload,
5091
+ true,
5092
+ false,
5093
+ USER_IDS.ME,
5094
+ RESOURCE_URLS.WHITEBOARD_A
5095
+ );
5096
+ const data2 = generateData(
5097
+ data1.payload,
5098
+ false,
5099
+ false,
5100
+ USER_IDS.ME,
5101
+ RESOURCE_URLS.WHITEBOARD_A,
5102
+ true,
5103
+ USER_IDS.ME
5104
+ );
5105
+ const data3 = generateData(
5106
+ data2.payload,
5107
+ true,
5108
+ true,
5109
+ USER_IDS.ME,
5110
+ undefined,
5111
+ true,
5112
+ USER_IDS.ME
5113
+ );
4653
5114
  const data4 = generateData(data3.payload, false, true, USER_IDS.ME);
4654
5115
 
4655
5116
  payloadTestHelper([data1, data2, data3, data4]);
4656
5117
  });
4657
5118
 
4658
5119
  it('Scenario #2: you share whiteboard A and remote person A shares desktop', () => {
4659
- const data1 = generateData(blankPayload, true, false, USER_IDS.ME, RESOURCE_URLS.WHITEBOARD_A);
4660
- const data2 = generateData(data1.payload, false, false, USER_IDS.ME, RESOURCE_URLS.WHITEBOARD_A, true, USER_IDS.REMOTE_A);
4661
- const data3 = generateData(data2.payload, true, true, USER_IDS.REMOTE_A, undefined, true, USER_IDS.ME);
5120
+ const data1 = generateData(
5121
+ blankPayload,
5122
+ true,
5123
+ false,
5124
+ USER_IDS.ME,
5125
+ RESOURCE_URLS.WHITEBOARD_A
5126
+ );
5127
+ const data2 = generateData(
5128
+ data1.payload,
5129
+ false,
5130
+ false,
5131
+ USER_IDS.ME,
5132
+ RESOURCE_URLS.WHITEBOARD_A,
5133
+ true,
5134
+ USER_IDS.REMOTE_A
5135
+ );
5136
+ const data3 = generateData(
5137
+ data2.payload,
5138
+ true,
5139
+ true,
5140
+ USER_IDS.REMOTE_A,
5141
+ undefined,
5142
+ true,
5143
+ USER_IDS.ME
5144
+ );
4662
5145
  const data4 = generateData(data3.payload, false, true, USER_IDS.REMOTE_A);
4663
5146
 
4664
5147
  payloadTestHelper([data1, data2, data3, data4]);
4665
5148
  });
4666
5149
 
4667
5150
  it('Scenario #3: remote person A shares whiteboard and you share desktop', () => {
4668
- const data1 = generateData(blankPayload, true, false, USER_IDS.REMOTE_A, RESOURCE_URLS.WHITEBOARD_A);
4669
- const data2 = generateData(data1.payload, false, false, USER_IDS.REMOTE_A, RESOURCE_URLS.WHITEBOARD_A, true, USER_IDS.ME);
4670
- const data3 = generateData(data2.payload, true, true, USER_IDS.ME, undefined, true, USER_IDS.REMOTE_A);
5151
+ const data1 = generateData(
5152
+ blankPayload,
5153
+ true,
5154
+ false,
5155
+ USER_IDS.REMOTE_A,
5156
+ RESOURCE_URLS.WHITEBOARD_A
5157
+ );
5158
+ const data2 = generateData(
5159
+ data1.payload,
5160
+ false,
5161
+ false,
5162
+ USER_IDS.REMOTE_A,
5163
+ RESOURCE_URLS.WHITEBOARD_A,
5164
+ true,
5165
+ USER_IDS.ME
5166
+ );
5167
+ const data3 = generateData(
5168
+ data2.payload,
5169
+ true,
5170
+ true,
5171
+ USER_IDS.ME,
5172
+ undefined,
5173
+ true,
5174
+ USER_IDS.REMOTE_A
5175
+ );
4671
5176
  const data4 = generateData(data3.payload, false, true, USER_IDS.ME);
4672
5177
 
4673
5178
  payloadTestHelper([data1, data2, data3, data4]);
4674
5179
  });
4675
5180
 
4676
5181
  it('Scenario #4: remote person A shares whiteboard and then shares desktop', () => {
4677
- const data1 = generateData(blankPayload, true, false, USER_IDS.REMOTE_A, RESOURCE_URLS.WHITEBOARD_A);
4678
- const data2 = generateData(data1.payload, false, false, USER_IDS.REMOTE_A, RESOURCE_URLS.WHITEBOARD_A, true, USER_IDS.REMOTE_A);
4679
- const data3 = generateData(data2.payload, true, true, USER_IDS.REMOTE_A, undefined, true, USER_IDS.REMOTE_A);
5182
+ const data1 = generateData(
5183
+ blankPayload,
5184
+ true,
5185
+ false,
5186
+ USER_IDS.REMOTE_A,
5187
+ RESOURCE_URLS.WHITEBOARD_A
5188
+ );
5189
+ const data2 = generateData(
5190
+ data1.payload,
5191
+ false,
5192
+ false,
5193
+ USER_IDS.REMOTE_A,
5194
+ RESOURCE_URLS.WHITEBOARD_A,
5195
+ true,
5196
+ USER_IDS.REMOTE_A
5197
+ );
5198
+ const data3 = generateData(
5199
+ data2.payload,
5200
+ true,
5201
+ true,
5202
+ USER_IDS.REMOTE_A,
5203
+ undefined,
5204
+ true,
5205
+ USER_IDS.REMOTE_A
5206
+ );
4680
5207
  const data4 = generateData(data3.payload, false, true, USER_IDS.REMOTE_A);
4681
5208
 
4682
5209
  payloadTestHelper([data1, data2, data3, data4]);
4683
5210
  });
4684
5211
 
4685
5212
  it('Scenario #5: remote person A shares whiteboard and remote person B shares desktop', () => {
4686
- const data1 = generateData(blankPayload, true, false, USER_IDS.REMOTE_A, RESOURCE_URLS.WHITEBOARD_A);
4687
- const data2 = generateData(data1.payload, false, false, USER_IDS.REMOTE_A, RESOURCE_URLS.WHITEBOARD_A, true, USER_IDS.REMOTE_B);
4688
- const data3 = generateData(data2.payload, true, true, USER_IDS.REMOTE_B, undefined, true, USER_IDS.REMOTE_A);
5213
+ const data1 = generateData(
5214
+ blankPayload,
5215
+ true,
5216
+ false,
5217
+ USER_IDS.REMOTE_A,
5218
+ RESOURCE_URLS.WHITEBOARD_A
5219
+ );
5220
+ const data2 = generateData(
5221
+ data1.payload,
5222
+ false,
5223
+ false,
5224
+ USER_IDS.REMOTE_A,
5225
+ RESOURCE_URLS.WHITEBOARD_A,
5226
+ true,
5227
+ USER_IDS.REMOTE_B
5228
+ );
5229
+ const data3 = generateData(
5230
+ data2.payload,
5231
+ true,
5232
+ true,
5233
+ USER_IDS.REMOTE_B,
5234
+ undefined,
5235
+ true,
5236
+ USER_IDS.REMOTE_A
5237
+ );
4689
5238
  const data4 = generateData(data3.payload, false, true, USER_IDS.REMOTE_B);
4690
5239
 
4691
5240
  payloadTestHelper([data1, data2, data3, data4]);
@@ -4695,7 +5244,13 @@ describe('plugin-meetings', () => {
4695
5244
  describe('Desktop --> Whiteboard A', () => {
4696
5245
  it('Scenario #1: you share desktop and then share whiteboard', () => {
4697
5246
  const data1 = generateData(blankPayload, true, true, USER_IDS.ME);
4698
- const data2 = generateData(data1.payload, true, false, USER_IDS.ME, RESOURCE_URLS.WHITEBOARD_A);
5247
+ const data2 = generateData(
5248
+ data1.payload,
5249
+ true,
5250
+ false,
5251
+ USER_IDS.ME,
5252
+ RESOURCE_URLS.WHITEBOARD_A
5253
+ );
4699
5254
  const data3 = generateData(data2.payload, false, false, USER_IDS.ME);
4700
5255
 
4701
5256
  payloadTestHelper([data1, data2, data3]);
@@ -4703,7 +5258,13 @@ describe('plugin-meetings', () => {
4703
5258
 
4704
5259
  it('Scenario #2: you share desktop and remote person A shares whiteboard', () => {
4705
5260
  const data1 = generateData(blankPayload, true, true, USER_IDS.ME);
4706
- const data2 = generateData(data1.payload, true, false, USER_IDS.REMOTE_A, RESOURCE_URLS.WHITEBOARD_A);
5261
+ const data2 = generateData(
5262
+ data1.payload,
5263
+ true,
5264
+ false,
5265
+ USER_IDS.REMOTE_A,
5266
+ RESOURCE_URLS.WHITEBOARD_A
5267
+ );
4707
5268
  const data3 = generateData(data2.payload, false, false, USER_IDS.REMOTE_A);
4708
5269
 
4709
5270
  payloadTestHelper([data1, data2, data3]);
@@ -4711,7 +5272,13 @@ describe('plugin-meetings', () => {
4711
5272
 
4712
5273
  it('Scenario #3: remote person A shares desktop and you share whiteboard', () => {
4713
5274
  const data1 = generateData(blankPayload, true, true, USER_IDS.REMOTE_A);
4714
- const data2 = generateData(data1.payload, true, false, USER_IDS.REMOTE_A, RESOURCE_URLS.WHITEBOARD_A);
5275
+ const data2 = generateData(
5276
+ data1.payload,
5277
+ true,
5278
+ false,
5279
+ USER_IDS.REMOTE_A,
5280
+ RESOURCE_URLS.WHITEBOARD_A
5281
+ );
4715
5282
  const data3 = generateData(data2.payload, false, false, USER_IDS.REMOTE_A);
4716
5283
 
4717
5284
  payloadTestHelper([data1, data2, data3]);
@@ -4719,7 +5286,13 @@ describe('plugin-meetings', () => {
4719
5286
 
4720
5287
  it('Scenario #4: remote person A shares desktop and then shares whiteboard', () => {
4721
5288
  const data1 = generateData(blankPayload, true, true, USER_IDS.REMOTE_A);
4722
- const data2 = generateData(data1.payload, true, false, USER_IDS.ME, RESOURCE_URLS.WHITEBOARD_A);
5289
+ const data2 = generateData(
5290
+ data1.payload,
5291
+ true,
5292
+ false,
5293
+ USER_IDS.ME,
5294
+ RESOURCE_URLS.WHITEBOARD_A
5295
+ );
4723
5296
  const data3 = generateData(data2.payload, false, false, USER_IDS.ME);
4724
5297
 
4725
5298
  payloadTestHelper([data1, data2, data3]);
@@ -4727,7 +5300,13 @@ describe('plugin-meetings', () => {
4727
5300
 
4728
5301
  it('Scenario #5: remote person A shares desktop and remote person B shares whiteboard', () => {
4729
5302
  const data1 = generateData(blankPayload, true, true, USER_IDS.REMOTE_A);
4730
- const data2 = generateData(data1.payload, true, false, USER_IDS.REMOTE_A, RESOURCE_URLS.WHITEBOARD_A);
5303
+ const data2 = generateData(
5304
+ data1.payload,
5305
+ true,
5306
+ false,
5307
+ USER_IDS.REMOTE_A,
5308
+ RESOURCE_URLS.WHITEBOARD_A
5309
+ );
4731
5310
  const data3 = generateData(data2.payload, false, false, USER_IDS.REMOTE_A);
4732
5311
 
4733
5312
  payloadTestHelper([data1, data2, data3]);
@@ -4803,17 +5382,21 @@ describe('plugin-meetings', () => {
4803
5382
  assert.isNull(meeting.keepAliveTimerId);
4804
5383
  meeting.joinedWith = {
4805
5384
  keepAliveUrl: defaultKeepAliveUrl,
4806
- keepAliveSecs: defaultKeepAliveSecs
5385
+ keepAliveSecs: defaultKeepAliveSecs,
4807
5386
  };
4808
5387
  meeting.startKeepAlive();
4809
5388
  assert.isNumber(meeting.keepAliveTimerId.id);
4810
5389
  await testUtils.flushPromises();
4811
5390
  assert.notCalled(meeting.meetingRequest.keepAlive);
4812
5391
  await progressTime(defaultExpectedInterval);
4813
- assert.calledOnceWithExactly(meeting.meetingRequest.keepAlive, {keepAliveUrl: defaultKeepAliveUrl});
5392
+ assert.calledOnceWithExactly(meeting.meetingRequest.keepAlive, {
5393
+ keepAliveUrl: defaultKeepAliveUrl,
5394
+ });
4814
5395
  await progressTime(defaultExpectedInterval);
4815
5396
  assert.calledTwice(meeting.meetingRequest.keepAlive);
4816
- assert.alwaysCalledWithExactly(meeting.meetingRequest.keepAlive, {keepAliveUrl: defaultKeepAliveUrl});
5397
+ assert.alwaysCalledWithExactly(meeting.meetingRequest.keepAlive, {
5398
+ keepAliveUrl: defaultKeepAliveUrl,
5399
+ });
4817
5400
  });
4818
5401
  it('startKeepAlive handles existing keepAliveTimerId', async () => {
4819
5402
  meeting.meetingRequest.keepAlive = sinon.stub().returns(Promise.resolve());
@@ -4822,7 +5405,7 @@ describe('plugin-meetings', () => {
4822
5405
  meeting.keepAliveTimerId = 7;
4823
5406
  meeting.joinedWith = {
4824
5407
  keepAliveUrl: defaultKeepAliveUrl,
4825
- keepAliveSecs: defaultKeepAliveSecs
5408
+ keepAliveSecs: defaultKeepAliveSecs,
4826
5409
  };
4827
5410
  meeting.startKeepAlive();
4828
5411
  assert.equal(meeting.keepAliveTimerId, 7);
@@ -4835,7 +5418,7 @@ describe('plugin-meetings', () => {
4835
5418
 
4836
5419
  assert.isNull(meeting.keepAliveTimerId);
4837
5420
  meeting.joinedWith = {
4838
- keepAliveSecs: defaultKeepAliveSecs
5421
+ keepAliveSecs: defaultKeepAliveSecs,
4839
5422
  };
4840
5423
  meeting.startKeepAlive();
4841
5424
  assert.isNull(meeting.keepAliveTimerId);
@@ -4848,7 +5431,7 @@ describe('plugin-meetings', () => {
4848
5431
 
4849
5432
  assert.isNull(meeting.keepAliveTimerId);
4850
5433
  meeting.joinedWith = {
4851
- keepAliveUrl: defaultKeepAliveUrl
5434
+ keepAliveUrl: defaultKeepAliveUrl,
4852
5435
  };
4853
5436
  meeting.startKeepAlive();
4854
5437
  assert.isNull(meeting.keepAliveTimerId);
@@ -4862,7 +5445,7 @@ describe('plugin-meetings', () => {
4862
5445
  assert.isNull(meeting.keepAliveTimerId);
4863
5446
  meeting.joinedWith = {
4864
5447
  keepAliveUrl: defaultKeepAliveUrl,
4865
- keepAliveSecs: 1
5448
+ keepAliveSecs: 1,
4866
5449
  };
4867
5450
  meeting.startKeepAlive();
4868
5451
  assert.isNull(meeting.keepAliveTimerId);
@@ -4875,14 +5458,16 @@ describe('plugin-meetings', () => {
4875
5458
  assert.isNull(meeting.keepAliveTimerId);
4876
5459
  meeting.joinedWith = {
4877
5460
  keepAliveUrl: defaultKeepAliveUrl,
4878
- keepAliveSecs: defaultKeepAliveSecs
5461
+ keepAliveSecs: defaultKeepAliveSecs,
4879
5462
  };
4880
5463
  meeting.startKeepAlive();
4881
5464
  assert.isNumber(meeting.keepAliveTimerId.id);
4882
5465
  await testUtils.flushPromises();
4883
5466
  assert.notCalled(meeting.meetingRequest.keepAlive);
4884
5467
  await progressTime(defaultExpectedInterval);
4885
- assert.calledOnceWithExactly(meeting.meetingRequest.keepAlive, {keepAliveUrl: defaultKeepAliveUrl});
5468
+ assert.calledOnceWithExactly(meeting.meetingRequest.keepAlive, {
5469
+ keepAliveUrl: defaultKeepAliveUrl,
5470
+ });
4886
5471
  assert.isNull(meeting.keepAliveTimerId);
4887
5472
  await progressTime(defaultExpectedInterval);
4888
5473
  assert.calledOnce(meeting.meetingRequest.keepAlive);
@@ -4912,12 +5497,14 @@ describe('plugin-meetings', () => {
4912
5497
  assert.isNull(meeting.keepAliveTimerId);
4913
5498
  meeting.joinedWith = {
4914
5499
  keepAliveUrl: defaultKeepAliveUrl,
4915
- keepAliveSecs: defaultKeepAliveSecs
5500
+ keepAliveSecs: defaultKeepAliveSecs,
4916
5501
  };
4917
5502
  meeting.startKeepAlive();
4918
5503
  assert.isNumber(meeting.keepAliveTimerId.id);
4919
5504
  await progressTime(defaultExpectedInterval);
4920
- assert.calledOnceWithExactly(meeting.meetingRequest.keepAlive, {keepAliveUrl: defaultKeepAliveUrl});
5505
+ assert.calledOnceWithExactly(meeting.meetingRequest.keepAlive, {
5506
+ keepAliveUrl: defaultKeepAliveUrl,
5507
+ });
4921
5508
 
4922
5509
  meeting.stopKeepAlive();
4923
5510
  assert.isNull(meeting.keepAliveTimerId);
@@ -4955,8 +5542,8 @@ describe('plugin-meetings', () => {
4955
5542
  tone: {
4956
5543
  type: 'light_skin_tone',
4957
5544
  codepoints: '1F3FB',
4958
- shortcodes: ':skin-tone-2:'
4959
- }
5545
+ shortcodes: ':skin-tone-2:',
5546
+ },
4960
5547
  },
4961
5548
  participantId: meeting.members.selfId,
4962
5549
  });
@@ -4965,7 +5552,11 @@ describe('plugin-meetings', () => {
4965
5552
  it('should fail sending a reaction if data channel is undefined', async () => {
4966
5553
  meeting.locusInfo.controls = {reactions: {reactionChannelUrl: undefined}};
4967
5554
 
4968
- await assert.isRejected(meeting.sendReaction('thumbs_down', 'light'), Error, 'Error sending reaction, service url not found.');
5555
+ await assert.isRejected(
5556
+ meeting.sendReaction('thumbs_down', 'light'),
5557
+ Error,
5558
+ 'Error sending reaction, service url not found.'
5559
+ );
4969
5560
 
4970
5561
  assert.notCalled(meeting.meetingRequest.sendReaction);
4971
5562
  });
@@ -4973,7 +5564,11 @@ describe('plugin-meetings', () => {
4973
5564
  it('should fail sending a reaction if reactionType is invalid ', async () => {
4974
5565
  meeting.locusInfo.controls = {reactions: {reactionChannelUrl: 'Fake URL'}};
4975
5566
 
4976
- await assert.isRejected(meeting.sendReaction('invalid_reaction', 'light'), Error, 'invalid_reaction is not a valid reaction.');
5567
+ await assert.isRejected(
5568
+ meeting.sendReaction('invalid_reaction', 'light'),
5569
+ Error,
5570
+ 'invalid_reaction is not a valid reaction.'
5571
+ );
4977
5572
 
4978
5573
  assert.notCalled(meeting.meetingRequest.sendReaction);
4979
5574
  });
@@ -4991,7 +5586,7 @@ describe('plugin-meetings', () => {
4991
5586
  type: 'thumb_down',
4992
5587
  codepoints: '1F44E',
4993
5588
  shortcodes: ':thumbsdown:',
4994
- tone: {type: 'normal_skin_tone', codepoints: '', shortcodes: ''}
5589
+ tone: {type: 'normal_skin_tone', codepoints: '', shortcodes: ''},
4995
5590
  },
4996
5591
  participantId: meeting.members.selfId,
4997
5592
  });
@@ -5010,7 +5605,7 @@ describe('plugin-meetings', () => {
5010
5605
  type: 'thumb_down',
5011
5606
  codepoints: '1F44E',
5012
5607
  shortcodes: ':thumbsdown:',
5013
- tone: {type: 'normal_skin_tone', codepoints: '', shortcodes: ''}
5608
+ tone: {type: 'normal_skin_tone', codepoints: '', shortcodes: ''},
5014
5609
  },
5015
5610
  participantId: meeting.members.selfId,
5016
5611
  });
@@ -5029,7 +5624,6 @@ describe('plugin-meetings', () => {
5029
5624
  meeting.locusUrl = 'locusUrl';
5030
5625
  meeting.locusInfo.controls = {reactions: {enabled: false}};
5031
5626
 
5032
-
5033
5627
  const togglePromise = meeting.toggleReactions(true);
5034
5628
 
5035
5629
  assert.exists(togglePromise.then);