@webex/plugin-meetings 2.36.1 → 2.37.1

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 (308) 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 +7 -46
  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 +46 -42
  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 -37
  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 +74 -137
  74. package/dist/media/index.js.map +1 -1
  75. package/dist/media/properties.js +64 -110
  76. package/dist/media/properties.js.map +1 -1
  77. package/dist/media/util.js +3 -17
  78. package/dist/media/util.js.map +1 -1
  79. package/dist/mediaQualityMetrics/config.js +10 -12
  80. package/dist/mediaQualityMetrics/config.js.map +1 -1
  81. package/dist/meeting/effectsState.js +120 -192
  82. package/dist/meeting/effectsState.js.map +1 -1
  83. package/dist/meeting/in-meeting-actions.js +0 -13
  84. package/dist/meeting/in-meeting-actions.js.map +1 -1
  85. package/dist/meeting/index.js +812 -1487
  86. package/dist/meeting/index.js.map +1 -1
  87. package/dist/meeting/muteState.js +31 -78
  88. package/dist/meeting/muteState.js.map +1 -1
  89. package/dist/meeting/request.js +157 -227
  90. package/dist/meeting/request.js.map +1 -1
  91. package/dist/meeting/state.js +21 -31
  92. package/dist/meeting/state.js.map +1 -1
  93. package/dist/meeting/util.js +25 -169
  94. package/dist/meeting/util.js.map +1 -1
  95. package/dist/meeting-info/collection.js +3 -25
  96. package/dist/meeting-info/collection.js.map +1 -1
  97. package/dist/meeting-info/index.js +10 -33
  98. package/dist/meeting-info/index.js.map +1 -1
  99. package/dist/meeting-info/meeting-info-v2.js +179 -268
  100. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  101. package/dist/meeting-info/request.js +1 -16
  102. package/dist/meeting-info/request.js.map +1 -1
  103. package/dist/meeting-info/util.js +98 -183
  104. package/dist/meeting-info/util.js.map +1 -1
  105. package/dist/meeting-info/utilv2.js +137 -228
  106. package/dist/meeting-info/utilv2.js.map +1 -1
  107. package/dist/meetings/collection.js +3 -21
  108. package/dist/meetings/collection.js.map +1 -1
  109. package/dist/meetings/index.js +451 -570
  110. package/dist/meetings/index.js.map +1 -1
  111. package/dist/meetings/request.js +7 -30
  112. package/dist/meetings/request.js.map +1 -1
  113. package/dist/meetings/util.js +94 -148
  114. package/dist/meetings/util.js.map +1 -1
  115. package/dist/member/index.js +49 -89
  116. package/dist/member/index.js.map +1 -1
  117. package/dist/member/util.js +17 -68
  118. package/dist/member/util.js.map +1 -1
  119. package/dist/members/collection.js +2 -12
  120. package/dist/members/collection.js.map +1 -1
  121. package/dist/members/index.js +68 -184
  122. package/dist/members/index.js.map +1 -1
  123. package/dist/members/request.js +21 -56
  124. package/dist/members/request.js.map +1 -1
  125. package/dist/members/util.js +9 -38
  126. package/dist/members/util.js.map +1 -1
  127. package/dist/metrics/config.js +0 -2
  128. package/dist/metrics/config.js.map +1 -1
  129. package/dist/metrics/constants.js +1 -2
  130. package/dist/metrics/constants.js.map +1 -1
  131. package/dist/metrics/index.js +48 -136
  132. package/dist/metrics/index.js.map +1 -1
  133. package/dist/networkQualityMonitor/index.js +28 -57
  134. package/dist/networkQualityMonitor/index.js.map +1 -1
  135. package/dist/peer-connection-manager/index.js +60 -190
  136. package/dist/peer-connection-manager/index.js.map +1 -1
  137. package/dist/peer-connection-manager/util.js +10 -24
  138. package/dist/peer-connection-manager/util.js.map +1 -1
  139. package/dist/personal-meeting-room/index.js +10 -45
  140. package/dist/personal-meeting-room/index.js.map +1 -1
  141. package/dist/personal-meeting-room/request.js +2 -33
  142. package/dist/personal-meeting-room/request.js.map +1 -1
  143. package/dist/personal-meeting-room/util.js +0 -13
  144. package/dist/personal-meeting-room/util.js.map +1 -1
  145. package/dist/reachability/index.js +100 -166
  146. package/dist/reachability/index.js.map +1 -1
  147. package/dist/reachability/request.js +2 -18
  148. package/dist/reachability/request.js.map +1 -1
  149. package/dist/reactions/reactions.js +0 -2
  150. package/dist/reactions/reactions.js.map +1 -1
  151. package/dist/reactions/reactions.type.js +0 -5
  152. package/dist/reactions/reactions.type.js.map +1 -1
  153. package/dist/reconnection-manager/index.js +294 -468
  154. package/dist/reconnection-manager/index.js.map +1 -1
  155. package/dist/roap/collection.js +1 -12
  156. package/dist/roap/collection.js.map +1 -1
  157. package/dist/roap/handler.js +15 -85
  158. package/dist/roap/handler.js.map +1 -1
  159. package/dist/roap/index.js +42 -94
  160. package/dist/roap/index.js.map +1 -1
  161. package/dist/roap/request.js +81 -148
  162. package/dist/roap/request.js.map +1 -1
  163. package/dist/roap/state.js +2 -39
  164. package/dist/roap/state.js.map +1 -1
  165. package/dist/roap/turnDiscovery.js +8 -52
  166. package/dist/roap/turnDiscovery.js.map +1 -1
  167. package/dist/roap/util.js +0 -26
  168. package/dist/roap/util.js.map +1 -1
  169. package/dist/statsAnalyzer/global.js +0 -2
  170. package/dist/statsAnalyzer/global.js.map +1 -1
  171. package/dist/statsAnalyzer/index.js +68 -168
  172. package/dist/statsAnalyzer/index.js.map +1 -1
  173. package/dist/statsAnalyzer/mqaUtil.js +54 -53
  174. package/dist/statsAnalyzer/mqaUtil.js.map +1 -1
  175. package/dist/transcription/index.js +13 -45
  176. package/dist/transcription/index.js.map +1 -1
  177. package/internal-README.md +7 -6
  178. package/package.json +17 -17
  179. package/src/common/browser-detection.ts +9 -6
  180. package/src/common/collection.ts +3 -1
  181. package/src/common/errors/captcha-error.ts +6 -6
  182. package/src/common/errors/intent-to-join.ts +6 -6
  183. package/src/common/errors/join-meeting.ts +12 -8
  184. package/src/common/errors/media.ts +6 -6
  185. package/src/common/errors/parameter.ts +9 -6
  186. package/src/common/errors/password-error.ts +6 -6
  187. package/src/common/errors/permission.ts +5 -5
  188. package/src/common/errors/reconnection.ts +6 -6
  189. package/src/common/errors/stats.ts +6 -6
  190. package/src/common/errors/webex-errors.ts +7 -5
  191. package/src/common/errors/webex-meetings-error.ts +1 -1
  192. package/src/common/events/events-scope.ts +5 -1
  193. package/src/common/events/events.ts +5 -1
  194. package/src/common/events/trigger-proxy.ts +8 -3
  195. package/src/common/events/util.ts +1 -2
  196. package/src/common/logs/logger-proxy.ts +21 -10
  197. package/src/common/logs/request.ts +11 -8
  198. package/src/config.ts +11 -11
  199. package/src/constants.ts +138 -119
  200. package/src/index.js +1 -1
  201. package/src/locus-info/controlsUtils.ts +34 -24
  202. package/src/locus-info/fullState.ts +15 -11
  203. package/src/locus-info/hostUtils.ts +4 -3
  204. package/src/locus-info/index.ts +25 -34
  205. package/src/locus-info/infoUtils.ts +12 -4
  206. package/src/locus-info/mediaSharesUtils.ts +4 -4
  207. package/src/locus-info/parser.ts +45 -68
  208. package/src/locus-info/selfUtils.ts +106 -57
  209. package/src/media/index.ts +118 -109
  210. package/src/media/properties.ts +26 -20
  211. package/src/media/util.ts +2 -2
  212. package/src/mediaQualityMetrics/config.ts +46 -46
  213. package/src/meeting/effectsState.ts +35 -35
  214. package/src/meeting/in-meeting-actions.ts +7 -3
  215. package/src/meeting/index.ts +1435 -1210
  216. package/src/meeting/muteState.ts +62 -31
  217. package/src/meeting/request.ts +160 -113
  218. package/src/meeting/state.ts +45 -30
  219. package/src/meeting/util.ts +131 -90
  220. package/src/meeting-info/collection.ts +2 -1
  221. package/src/meeting-info/index.ts +32 -30
  222. package/src/meeting-info/meeting-info-v2.ts +106 -108
  223. package/src/meeting-info/request.ts +9 -3
  224. package/src/meeting-info/util.ts +54 -46
  225. package/src/meeting-info/utilv2.ts +59 -53
  226. package/src/meetings/collection.ts +1 -1
  227. package/src/meetings/index.ts +513 -441
  228. package/src/meetings/request.ts +26 -24
  229. package/src/meetings/util.ts +26 -23
  230. package/src/member/index.ts +55 -49
  231. package/src/member/util.ts +26 -13
  232. package/src/members/collection.ts +0 -1
  233. package/src/members/index.ts +172 -121
  234. package/src/members/request.ts +46 -14
  235. package/src/members/util.ts +44 -42
  236. package/src/metrics/config.ts +254 -81
  237. package/src/metrics/constants.ts +0 -2
  238. package/src/metrics/index.ts +84 -71
  239. package/src/networkQualityMonitor/index.ts +20 -23
  240. package/src/peer-connection-manager/index.ts +321 -241
  241. package/src/peer-connection-manager/util.ts +4 -2
  242. package/src/personal-meeting-room/index.ts +12 -16
  243. package/src/personal-meeting-room/request.ts +10 -3
  244. package/src/personal-meeting-room/util.ts +3 -3
  245. package/src/reachability/index.ts +61 -59
  246. package/src/reachability/request.ts +36 -32
  247. package/src/reactions/reactions.ts +4 -4
  248. package/src/reactions/reactions.type.ts +2 -3
  249. package/src/reconnection-manager/index.ts +159 -98
  250. package/src/roap/collection.ts +2 -4
  251. package/src/roap/handler.ts +63 -32
  252. package/src/roap/index.ts +78 -58
  253. package/src/roap/request.ts +69 -54
  254. package/src/roap/state.ts +17 -11
  255. package/src/roap/turnDiscovery.ts +60 -31
  256. package/src/roap/util.ts +39 -31
  257. package/src/statsAnalyzer/global.ts +30 -33
  258. package/src/statsAnalyzer/index.ts +397 -169
  259. package/src/statsAnalyzer/mqaUtil.ts +178 -72
  260. package/src/transcription/index.ts +34 -32
  261. package/test/integration/spec/journey.js +666 -462
  262. package/test/integration/spec/space-meeting.js +318 -203
  263. package/test/integration/spec/transcription.js +6 -7
  264. package/test/unit/spec/common/browser-detection.js +9 -28
  265. package/test/unit/spec/fixture/locus.js +92 -90
  266. package/test/unit/spec/locus-info/controlsUtils.js +5 -5
  267. package/test/unit/spec/locus-info/embeddedAppsUtils.js +8 -6
  268. package/test/unit/spec/locus-info/index.js +1 -2
  269. package/test/unit/spec/locus-info/infoUtils.js +24 -31
  270. package/test/unit/spec/locus-info/lib/BasicSeqCmp.json +88 -430
  271. package/test/unit/spec/locus-info/lib/SeqCmp.json +513 -685
  272. package/test/unit/spec/locus-info/parser.js +3 -9
  273. package/test/unit/spec/locus-info/selfConstant.js +72 -103
  274. package/test/unit/spec/locus-info/selfUtils.js +21 -12
  275. package/test/unit/spec/meeting/effectsState.js +33 -45
  276. package/test/unit/spec/meeting/in-meeting-actions.ts +2 -3
  277. package/test/unit/spec/meeting/index.js +1141 -649
  278. package/test/unit/spec/meeting/muteState.js +42 -33
  279. package/test/unit/spec/meeting/request.js +56 -45
  280. package/test/unit/spec/meeting/utils.js +66 -49
  281. package/test/unit/spec/meeting-info/meetinginfov2.js +100 -73
  282. package/test/unit/spec/meeting-info/request.js +7 -9
  283. package/test/unit/spec/meeting-info/util.js +11 -12
  284. package/test/unit/spec/meeting-info/utilv2.js +110 -74
  285. package/test/unit/spec/meetings/collection.js +1 -1
  286. package/test/unit/spec/meetings/index.js +438 -257
  287. package/test/unit/spec/meetings/utils.js +14 -12
  288. package/test/unit/spec/member/index.js +0 -1
  289. package/test/unit/spec/member/util.js +5 -6
  290. package/test/unit/spec/members/index.js +84 -35
  291. package/test/unit/spec/members/request.js +29 -20
  292. package/test/unit/spec/members/utils.js +8 -5
  293. package/test/unit/spec/metrics/index.js +16 -21
  294. package/test/unit/spec/networkQualityMonitor/index.js +21 -15
  295. package/test/unit/spec/peerconnection-manager/index.js +88 -58
  296. package/test/unit/spec/peerconnection-manager/utils.js +5 -4
  297. package/test/unit/spec/peerconnection-manager/utils.test-fixtures.ts +7 -8
  298. package/test/unit/spec/personal-meeting-room/personal-meeting-room.js +2 -7
  299. package/test/unit/spec/reachability/index.ts +9 -11
  300. package/test/unit/spec/reconnection-manager/index.js +14 -17
  301. package/test/unit/spec/roap/index.ts +18 -8
  302. package/test/unit/spec/roap/turnDiscovery.ts +22 -19
  303. package/test/unit/spec/roap/util.js +3 -3
  304. package/test/unit/spec/stats-analyzer/index.js +29 -24
  305. package/test/utils/cmr.js +44 -42
  306. package/test/utils/testUtils.js +83 -74
  307. package/test/utils/webex-config.js +18 -18
  308. package/test/utils/webex-test-users.js +53 -50
@@ -49,7 +49,7 @@ import {
49
49
  UserNotJoinedError,
50
50
  MeetingNotActiveError,
51
51
  UserInLobbyError,
52
- NoMediaEstablishedYetError
52
+ NoMediaEstablishedYetError,
53
53
  } from '../../../../src/common/errors/webex-errors';
54
54
  import WebExMeetingsErrors from '../../../../src/common/errors/webex-meetings-error';
55
55
  import ParameterError from '../../../../src/common/errors/parameter';
@@ -58,11 +58,12 @@ import CaptchaError from '../../../../src/common/errors/captcha-error';
58
58
  import IntentToJoinError from '../../../../src/common/errors/intent-to-join';
59
59
  import DefaultSDKConfig from '../../../../src/config';
60
60
  import testUtils from '../../../utils/testUtils';
61
- import {MeetingInfoV2CaptchaError, MeetingInfoV2PasswordError} from '../../../../src/meeting-info/meeting-info-v2';
61
+ import {
62
+ MeetingInfoV2CaptchaError,
63
+ MeetingInfoV2PasswordError,
64
+ } from '../../../../src/meeting-info/meeting-info-v2';
62
65
 
63
- const {
64
- getBrowserName
65
- } = BrowserDetection();
66
+ const {getBrowserName} = BrowserDetection();
66
67
 
67
68
  // Non-stubbed function
68
69
  const {getDisplayMedia} = Media;
@@ -74,7 +75,7 @@ describe('plugin-meetings', () => {
74
75
  error: () => {},
75
76
  warn: () => {},
76
77
  trace: () => {},
77
- debug: () => {}
78
+ debug: () => {},
78
79
  };
79
80
 
80
81
  beforeEach(() => {
@@ -86,44 +87,48 @@ describe('plugin-meetings', () => {
86
87
 
87
88
  before(() => {
88
89
  const MediaStream = {
89
- getVideoTracks: () => [{
90
- applyConstraints: () => { }
91
- }]
90
+ getVideoTracks: () => [
91
+ {
92
+ applyConstraints: () => {},
93
+ },
94
+ ],
92
95
  };
93
96
 
94
97
  Object.defineProperty(global.window.navigator, 'mediaDevices', {
95
98
  writable: true,
96
99
  value: {
97
100
  getDisplayMedia: sinon.stub().returns(Promise.resolve(MediaStream)),
98
- enumerateDevices: sinon.stub().returns(Promise.resolve([
99
- {
100
- deviceId: '',
101
- kind: 'audioinput',
102
- label: '',
103
- groupId: '29d9339cc77bffdd24cb69ee80f6d3200481099bcd0f29267558672de0430777',
104
- },
105
- {
106
- deviceId: '',
107
- kind: 'videoinput',
108
- label: '',
109
- groupId: '08d4f8200e7e4a3425ecf75b7edea9ae4acd934019f2a52217554bcc8e46604d',
110
- },
111
- {
112
- deviceId: '',
113
- kind: 'audiooutput',
114
- label: '',
115
- groupId: '29d9339cc77bffdd24cb69ee80f6d3200481099bcd0f29267558672de0430777',
116
- }
117
- ])),
101
+ enumerateDevices: sinon.stub().returns(
102
+ Promise.resolve([
103
+ {
104
+ deviceId: '',
105
+ kind: 'audioinput',
106
+ label: '',
107
+ groupId: '29d9339cc77bffdd24cb69ee80f6d3200481099bcd0f29267558672de0430777',
108
+ },
109
+ {
110
+ deviceId: '',
111
+ kind: 'videoinput',
112
+ label: '',
113
+ groupId: '08d4f8200e7e4a3425ecf75b7edea9ae4acd934019f2a52217554bcc8e46604d',
114
+ },
115
+ {
116
+ deviceId: '',
117
+ kind: 'audiooutput',
118
+ label: '',
119
+ groupId: '29d9339cc77bffdd24cb69ee80f6d3200481099bcd0f29267558672de0430777',
120
+ },
121
+ ])
122
+ ),
118
123
  getSupportedConstraints: sinon.stub().returns({
119
- sampleRate: true
120
- })
124
+ sampleRate: true,
125
+ }),
121
126
  },
122
127
  });
123
128
 
124
129
  Object.defineProperty(global.window, 'MediaStream', {
125
130
  writable: true,
126
- value: MediaStream
131
+ value: MediaStream,
127
132
  });
128
133
  LoggerConfig.set({verboseEvents: true, enable: false});
129
134
  LoggerProxy.set(logger);
@@ -148,25 +153,25 @@ describe('plugin-meetings', () => {
148
153
  children: {
149
154
  meetings: Meetings,
150
155
  credentials: Credentials,
151
- support: Support
156
+ support: Support,
152
157
  },
153
158
  config: {
154
159
  credentials: {
155
- client_id: 'mock-client-id'
160
+ client_id: 'mock-client-id',
156
161
  },
157
162
  meetings: {
158
163
  reconnection: {
159
- enabled: false
164
+ enabled: false,
160
165
  },
161
166
  mediaSettings: {},
162
167
  metrics: {},
163
168
  stats: {},
164
- experimental: {enableUnifiedMeetings: true}
169
+ experimental: {enableUnifiedMeetings: true},
165
170
  },
166
171
  metrics: {
167
- type: ['behavioral']
168
- }
169
- }
172
+ type: ['behavioral'],
173
+ },
174
+ },
170
175
  });
171
176
 
172
177
  webex.internal.support.submitLogs = sinon.stub().returns(Promise.resolve());
@@ -174,7 +179,6 @@ describe('plugin-meetings', () => {
174
179
  webex.internal.metrics.submitClientMetrics = sinon.stub().returns(Promise.resolve());
175
180
  webex.meetings.uploadLogs = sinon.stub().returns(Promise.resolve());
176
181
 
177
-
178
182
  TriggerProxy.trigger = sinon.stub().returns(true);
179
183
  Metrics.postEvent = sinon.stub();
180
184
  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
 
@@ -433,7 +437,6 @@ describe('plugin-meetings', () => {
433
437
  it('should return a promise resolution', async () => {
434
438
  meeting.audio = {handleClientRequest};
435
439
 
436
-
437
440
  const audio = meeting.unmuteAudio();
438
441
 
439
442
  assert.exists(audio.then);
@@ -450,8 +453,8 @@ describe('plugin-meetings', () => {
450
453
  readyState: 'live',
451
454
  enabled: true,
452
455
  getSettings: () => ({
453
- sampleRate: 48000
454
- })
456
+ sampleRate: 48000,
457
+ }),
455
458
  });
456
459
 
457
460
  beforeEach(() => {
@@ -459,7 +462,7 @@ describe('plugin-meetings', () => {
459
462
  sinon.replace(meeting, 'addMedia', () => {
460
463
  sinon.stub(meeting.mediaProperties, 'audioTrack').value(fakeMediaTrack());
461
464
  sinon.stub(meeting.mediaProperties, 'mediaDirection').value({
462
- receiveAudio: true
465
+ receiveAudio: true,
463
466
  });
464
467
  });
465
468
  });
@@ -471,7 +474,7 @@ describe('plugin-meetings', () => {
471
474
  describe('before audio attached to meeting', () => {
472
475
  it('should throw no audio error', async () => {
473
476
  await meeting.enableBNR().catch((err) => {
474
- assert.equal(err.toString(), 'Error: Meeting doesn\'t have an audioTrack attached');
477
+ assert.equal(err.toString(), "Error: Meeting doesn't have an audioTrack attached");
475
478
  });
476
479
  });
477
480
  });
@@ -519,7 +522,7 @@ describe('plugin-meetings', () => {
519
522
 
520
523
  it('should throw no audio error', async () => {
521
524
  await meeting.disableBNR().catch((err) => {
522
- assert.equal(err.toString(), 'Error: Meeting doesn\'t have an audioTrack attached');
525
+ assert.equal(err.toString(), "Error: Meeting doesn't have an audioTrack attached");
523
526
  });
524
527
  });
525
528
  });
@@ -651,7 +654,11 @@ describe('plugin-meetings', () => {
651
654
  });
652
655
  describe('#getMediaStreams', () => {
653
656
  beforeEach(() => {
654
- sinon.stub(Media, 'getSupportedDevice').callsFake((options) => Promise.resolve({sendAudio: options.sendAudio, sendVideo: options.sendVideo}));
657
+ sinon
658
+ .stub(Media, 'getSupportedDevice')
659
+ .callsFake((options) =>
660
+ Promise.resolve({sendAudio: options.sendAudio, sendVideo: options.sendVideo})
661
+ );
655
662
  sinon.stub(Media, 'getUserMedia').returns(Promise.resolve(['stream1', 'stream2']));
656
663
  });
657
664
  afterEach(() => {
@@ -675,17 +682,20 @@ describe('plugin-meetings', () => {
675
682
  sinon.stub(meeting.mediaProperties, 'localQualityLevel').value('480p');
676
683
  await meeting.getMediaStreams(mediaDirection, audioVideoSettings);
677
684
 
678
- assert.calledWith(Media.getUserMedia, {
679
- ...mediaDirection,
680
- isSharing: false
681
- },
682
- {
683
- video: {
684
- width: {max: 640, ideal: 640},
685
- height: {max: 480, ideal: 480},
686
- deviceId: videoDevice
685
+ assert.calledWith(
686
+ Media.getUserMedia,
687
+ {
688
+ ...mediaDirection,
689
+ isSharing: false,
690
+ },
691
+ {
692
+ video: {
693
+ width: {max: 640, ideal: 640},
694
+ height: {max: 480, ideal: 480},
695
+ deviceId: videoDevice,
696
+ },
687
697
  }
688
- });
698
+ );
689
699
  });
690
700
  it('will set a new preferred video input device if passed in', async () => {
691
701
  // if audioVideo settings parameter specifies a new video device it
@@ -710,30 +720,33 @@ describe('plugin-meetings', () => {
710
720
  video: {
711
721
  width: {
712
722
  max: 400,
713
- ideal: 400
723
+ ideal: 400,
714
724
  },
715
725
  height: {
716
726
  max: 200,
717
- ideal: 200
727
+ ideal: 200,
718
728
  },
719
729
  frameRate: {
720
730
  ideal: 15,
721
- max: 30
731
+ max: 30,
722
732
  },
723
733
  facingMode: {
724
- ideal: 'user'
725
- }
726
- }
734
+ ideal: 'user',
735
+ },
736
+ },
727
737
  };
728
738
 
729
739
  sinon.stub(meeting.mediaProperties, 'localQualityLevel').value('200p');
730
740
  await meeting.getMediaStreams(mediaDirection, customAudioVideoSettings);
731
741
 
732
- assert.calledWith(Media.getUserMedia, {
733
- ...mediaDirection,
734
- isSharing: false
735
- },
736
- customAudioVideoSettings);
742
+ assert.calledWith(
743
+ Media.getUserMedia,
744
+ {
745
+ ...mediaDirection,
746
+ isSharing: false,
747
+ },
748
+ customAudioVideoSettings
749
+ );
737
750
  });
738
751
  it('should not access camera if sendVideo is false ', async () => {
739
752
  await meeting.getMediaStreams({sendAudio: true, sendVideo: false});
@@ -772,8 +785,7 @@ describe('plugin-meetings', () => {
772
785
 
773
786
  try {
774
787
  await meeting.receiveTranscription();
775
- }
776
- catch (err) {
788
+ } catch (err) {
777
789
  assert(err, {});
778
790
  }
779
791
  });
@@ -781,7 +793,7 @@ describe('plugin-meetings', () => {
781
793
  describe('#stopReceivingTranscription', () => {
782
794
  it('should get invoked', () => {
783
795
  meeting.transcription = {
784
- closeSocket: sinon.stub()
796
+ closeSocket: sinon.stub(),
785
797
  };
786
798
 
787
799
  meeting.stopReceivingTranscription();
@@ -816,7 +828,10 @@ describe('plugin-meetings', () => {
816
828
  it('should join the meeting and return promise', async () => {
817
829
  const join = meeting.join();
818
830
 
819
- assert.calledWithMatch(Metrics.postEvent, {event: eventType.CALL_INITIATED, data: {trigger: trigger.USER_INTERACTION, isRoapCallEnabled: true}});
831
+ assert.calledWithMatch(Metrics.postEvent, {
832
+ event: eventType.CALL_INITIATED,
833
+ data: {trigger: trigger.USER_INTERACTION, isRoapCallEnabled: true},
834
+ });
820
835
 
821
836
  assert.exists(join.then);
822
837
  await join;
@@ -864,8 +879,7 @@ describe('plugin-meetings', () => {
864
879
  try {
865
880
  await meeting.join();
866
881
  joinSucceeded = true;
867
- }
868
- catch (e) {
882
+ } catch (e) {
869
883
  assert.instanceOf(e, IntentToJoinError);
870
884
  }
871
885
  assert.isFalse(joinSucceeded);
@@ -913,7 +927,7 @@ describe('plugin-meetings', () => {
913
927
  describe('#addMedia', () => {
914
928
  const muteStateStub = {
915
929
  handleClientRequest: sinon.stub().returns(Promise.resolve(true)),
916
- applyClientStateLocally: sinon.stub().returns(Promise.resolve(true))
930
+ applyClientStateLocally: sinon.stub().returns(Promise.resolve(true)),
917
931
  };
918
932
 
919
933
  beforeEach(() => {
@@ -926,11 +940,16 @@ describe('plugin-meetings', () => {
926
940
  meeting.setMercuryListener = sinon.stub().returns(true);
927
941
  meeting.setRemoteStream = sinon.stub().returns(true);
928
942
  meeting.setMercuryListener = sinon.stub();
929
- meeting.roap.sendRoapMediaRequest = sinon.stub().returns(new Promise((resolve) => {
930
- meeting.mediaProperties.peerConnection.connectionState = CONSTANTS.CONNECTION_STATE.CONNECTED;
931
- resolve();
932
- }));
933
- meeting.roap.doTurnDiscovery = sinon.stub().resolves({turnServerInfo: {}, turnDiscoverySkippedReason: undefined});
943
+ meeting.roap.sendRoapMediaRequest = sinon.stub().returns(
944
+ new Promise((resolve) => {
945
+ meeting.mediaProperties.peerConnection.connectionState =
946
+ CONSTANTS.CONNECTION_STATE.CONNECTED;
947
+ resolve();
948
+ })
949
+ );
950
+ meeting.roap.doTurnDiscovery = sinon
951
+ .stub()
952
+ .resolves({turnServerInfo: {}, turnDiscoverySkippedReason: undefined});
934
953
  PeerConnectionManager.setContentSlides = sinon.stub().returns(true);
935
954
  });
936
955
 
@@ -959,8 +978,7 @@ describe('plugin-meetings', () => {
959
978
  try {
960
979
  await meeting.addMedia();
961
980
  assert.fail('addMedia should have thrown an exception.');
962
- }
963
- catch (err) {
981
+ } catch (err) {
964
982
  assert.instanceOf(err, UserInLobbyError);
965
983
  }
966
984
  });
@@ -972,38 +990,34 @@ describe('plugin-meetings', () => {
972
990
  assert.exists(err);
973
991
  assert.isNull(meeting.statsAnalyzer);
974
992
  assert(Metrics.sendBehavioralMetric.calledOnce);
975
- assert.calledWith(
976
- Metrics.sendBehavioralMetric,
977
- BEHAVIORAL_METRICS.ADD_MEDIA_FAILURE, {
978
- correlation_id: meeting.correlationId,
979
- locus_id: meeting.locusUrl.split('/').pop(),
980
- reason: err.message,
981
- stack: err.stack,
982
- code: err.code,
983
- turnDiscoverySkippedReason: undefined,
984
- turnServerUsed: true
985
- }
986
- );
993
+ assert.calledWith(Metrics.sendBehavioralMetric, BEHAVIORAL_METRICS.ADD_MEDIA_FAILURE, {
994
+ correlation_id: meeting.correlationId,
995
+ locus_id: meeting.locusUrl.split('/').pop(),
996
+ reason: err.message,
997
+ stack: err.stack,
998
+ code: err.code,
999
+ turnDiscoverySkippedReason: undefined,
1000
+ turnServerUsed: true,
1001
+ });
987
1002
  });
988
1003
  });
989
1004
 
990
1005
  it('checks metrics called with skipped reason config', async () => {
991
- meeting.roap.doTurnDiscovery = sinon.stub().resolves({turnServerInfo: undefined, turnDiscoverySkippedReason: 'config'});
1006
+ meeting.roap.doTurnDiscovery = sinon
1007
+ .stub()
1008
+ .resolves({turnServerInfo: undefined, turnDiscoverySkippedReason: 'config'});
992
1009
  meeting.meetingState = 'ACTIVE';
993
1010
  await meeting.addMedia().catch((err) => {
994
1011
  assert.exists(err);
995
1012
  assert(Metrics.sendBehavioralMetric.calledOnce);
996
- assert.calledWith(
997
- Metrics.sendBehavioralMetric,
998
- BEHAVIORAL_METRICS.ADD_MEDIA_FAILURE, {
999
- correlation_id: meeting.correlationId,
1000
- locus_id: meeting.locusUrl.split('/').pop(),
1001
- reason: err.message,
1002
- stack: err.stack,
1003
- turnDiscoverySkippedReason: 'config',
1004
- turnServerUsed: false
1005
- }
1006
- );
1013
+ assert.calledWith(Metrics.sendBehavioralMetric, BEHAVIORAL_METRICS.ADD_MEDIA_FAILURE, {
1014
+ correlation_id: meeting.correlationId,
1015
+ locus_id: meeting.locusUrl.split('/').pop(),
1016
+ reason: err.message,
1017
+ stack: err.stack,
1018
+ turnDiscoverySkippedReason: 'config',
1019
+ turnServerUsed: false,
1020
+ });
1007
1021
  });
1008
1022
  });
1009
1023
 
@@ -1014,17 +1028,14 @@ describe('plugin-meetings', () => {
1014
1028
  assert.exists(err);
1015
1029
  assert.isNull(meeting.mediaProperties.peerConnection);
1016
1030
  assert(Metrics.sendBehavioralMetric.calledOnce);
1017
- assert.calledWith(
1018
- Metrics.sendBehavioralMetric,
1019
- BEHAVIORAL_METRICS.ADD_MEDIA_FAILURE, {
1020
- correlation_id: meeting.correlationId,
1021
- locus_id: meeting.locusUrl.split('/').pop(),
1022
- reason: err.message,
1023
- stack: err.stack,
1024
- turnDiscoverySkippedReason: undefined,
1025
- turnServerUsed: true
1026
- }
1027
- );
1031
+ assert.calledWith(Metrics.sendBehavioralMetric, BEHAVIORAL_METRICS.ADD_MEDIA_FAILURE, {
1032
+ correlation_id: meeting.correlationId,
1033
+ locus_id: meeting.locusUrl.split('/').pop(),
1034
+ reason: err.message,
1035
+ stack: err.stack,
1036
+ turnDiscoverySkippedReason: undefined,
1037
+ turnServerUsed: true,
1038
+ });
1028
1039
  });
1029
1040
  });
1030
1041
 
@@ -1034,29 +1045,30 @@ describe('plugin-meetings', () => {
1034
1045
  try {
1035
1046
  await meeting.addMedia();
1036
1047
  assert.fail('addMedia should have thrown an exception.');
1037
- }
1038
- catch (err) {
1048
+ } catch (err) {
1039
1049
  assert.exists(err);
1040
1050
  }
1041
1051
 
1042
1052
  try {
1043
1053
  await meeting.addMedia({
1044
- mediaSettings: {}
1054
+ mediaSettings: {},
1045
1055
  });
1046
- }
1047
- catch (err) {
1056
+ } catch (err) {
1048
1057
  assert.fail('should not throw an error');
1049
1058
  }
1050
1059
  });
1051
1060
 
1052
1061
  it('if an error occurs after media request has already been sent, and the user waits until the server kicks them out, a UserNotJoinedError should be thrown when attempting to addMedia again', async () => {
1053
1062
  meeting.meetingState = 'ACTIVE';
1054
- meeting.roap.sendRoapMediaRequest = sinon.stub().returns(new Promise((resolve) => {
1055
- meeting.mediaProperties.peerConnection.connectionState = CONSTANTS.CONNECTION_STATE.CONNECTED;
1056
- resolve();
1057
- }).then(() => {
1058
- throw new Error('sample error thrown');
1059
- }));
1063
+ meeting.roap.sendRoapMediaRequest = sinon.stub().returns(
1064
+ new Promise((resolve) => {
1065
+ meeting.mediaProperties.peerConnection.connectionState =
1066
+ CONSTANTS.CONNECTION_STATE.CONNECTED;
1067
+ resolve();
1068
+ }).then(() => {
1069
+ throw new Error('sample error thrown');
1070
+ })
1071
+ );
1060
1072
  await meeting.addMedia().catch((err) => {
1061
1073
  assert.exists(err);
1062
1074
  });
@@ -1069,33 +1081,41 @@ describe('plugin-meetings', () => {
1069
1081
 
1070
1082
  it('if an error occurs after media request has already been sent, and the user does NOT wait until the server kicks them out, the user should be able to addMedia successfully', async () => {
1071
1083
  meeting.meetingState = 'ACTIVE';
1072
- meeting.roap.sendRoapMediaRequest = sinon.stub().returns(new Promise((resolve) => {
1073
- meeting.mediaProperties.peerConnection.connectionState = CONSTANTS.CONNECTION_STATE.CONNECTED;
1074
- resolve();
1075
- }).then(() => {
1076
- throw new Error('sample error thrown');
1077
- }));
1084
+ meeting.roap.sendRoapMediaRequest = sinon.stub().returns(
1085
+ new Promise((resolve) => {
1086
+ meeting.mediaProperties.peerConnection.connectionState =
1087
+ CONSTANTS.CONNECTION_STATE.CONNECTED;
1088
+ resolve();
1089
+ }).then(() => {
1090
+ throw new Error('sample error thrown');
1091
+ })
1092
+ );
1078
1093
  await meeting.addMedia().catch((err) => {
1079
1094
  assert.exists(err);
1080
1095
  });
1081
1096
 
1082
1097
  meeting.mediaProperties.peerConnection = {};
1083
- meeting.roap.sendRoapMediaRequest = sinon.stub().returns(new Promise((resolve) => {
1084
- meeting.mediaProperties.peerConnection.connectionState = CONSTANTS.CONNECTION_STATE.CONNECTED;
1085
- resolve();
1086
- }));
1098
+ meeting.roap.sendRoapMediaRequest = sinon.stub().returns(
1099
+ new Promise((resolve) => {
1100
+ meeting.mediaProperties.peerConnection.connectionState =
1101
+ CONSTANTS.CONNECTION_STATE.CONNECTED;
1102
+ resolve();
1103
+ })
1104
+ );
1087
1105
  await meeting.addMedia().catch((err) => {
1088
1106
  assert.fail('No error should appear: ', err);
1089
1107
  });
1090
1108
  });
1091
1109
 
1092
1110
  it('should attach the media and return promise', async () => {
1093
- meeting.roap.doTurnDiscovery = sinon.stub().resolves({turnServerInfo: undefined, turnDiscoverySkippedReason: undefined});
1111
+ meeting.roap.doTurnDiscovery = sinon
1112
+ .stub()
1113
+ .resolves({turnServerInfo: undefined, turnDiscoverySkippedReason: undefined});
1094
1114
 
1095
1115
  meeting.meetingState = 'ACTIVE';
1096
1116
  MediaUtil.createPeerConnection.resetHistory();
1097
1117
  const media = meeting.addMedia({
1098
- mediaSettings: {}
1118
+ mediaSettings: {},
1099
1119
  });
1100
1120
 
1101
1121
  assert.exists(media);
@@ -1110,8 +1130,8 @@ describe('plugin-meetings', () => {
1110
1130
  assert.calledOnce(MediaUtil.createPeerConnection);
1111
1131
  assert.calledWith(MediaUtil.createPeerConnection, undefined);
1112
1132
  /* statsAnalyzer is initiated inside of addMedia so there isn't
1113
- * a good way to mock it without mocking the constructor
1114
- */
1133
+ * a good way to mock it without mocking the constructor
1134
+ */
1115
1135
  });
1116
1136
 
1117
1137
  it('should pass the turn server info to the peer connection', async () => {
@@ -1122,17 +1142,16 @@ describe('plugin-meetings', () => {
1122
1142
  meeting.meetingState = 'ACTIVE';
1123
1143
  MediaUtil.createPeerConnection.resetHistory();
1124
1144
 
1125
-
1126
1145
  meeting.roap.doTurnDiscovery = sinon.stub().resolves({
1127
1146
  turnServerInfo: {
1128
1147
  url: FAKE_TURN_URL,
1129
1148
  username: FAKE_TURN_USER,
1130
- password: FAKE_TURN_PASSWORD
1149
+ password: FAKE_TURN_PASSWORD,
1131
1150
  },
1132
- turnServerSkippedReason: undefined
1151
+ turnServerSkippedReason: undefined,
1133
1152
  });
1134
1153
  const media = meeting.addMedia({
1135
- mediaSettings: {}
1154
+ mediaSettings: {},
1136
1155
  });
1137
1156
 
1138
1157
  assert.exists(media);
@@ -1143,16 +1162,18 @@ describe('plugin-meetings', () => {
1143
1162
  assert.calledWith(MediaUtil.createPeerConnection, {
1144
1163
  url: FAKE_TURN_URL,
1145
1164
  username: FAKE_TURN_USER,
1146
- password: FAKE_TURN_PASSWORD
1165
+ password: FAKE_TURN_PASSWORD,
1147
1166
  });
1148
1167
  });
1149
1168
 
1150
1169
  it('should attach the media and return promise', async () => {
1151
- meeting.roap.doTurnDiscovery = sinon.stub().resolves({turnServerInfo: undefined, turnDiscoverySkippedReason: undefined});
1170
+ meeting.roap.doTurnDiscovery = sinon
1171
+ .stub()
1172
+ .resolves({turnServerInfo: undefined, turnDiscoverySkippedReason: undefined});
1152
1173
  meeting.meetingState = 'ACTIVE';
1153
1174
  meeting.mediaProperties.peerConnection.connectionState = 'DISCONNECTED';
1154
1175
  const media = meeting.addMedia({
1155
- mediaSettings: {}
1176
+ mediaSettings: {},
1156
1177
  });
1157
1178
 
1158
1179
  assert.exists(media);
@@ -1167,9 +1188,10 @@ describe('plugin-meetings', () => {
1167
1188
 
1168
1189
  let errorThrown = false;
1169
1190
 
1170
- await meeting.addMedia({
1171
- mediaSettings: {}
1172
- })
1191
+ await meeting
1192
+ .addMedia({
1193
+ mediaSettings: {},
1194
+ })
1173
1195
  .catch((error) => {
1174
1196
  assert.equal(error.code, IceGatheringFailed.CODE);
1175
1197
  errorThrown = true;
@@ -1181,19 +1203,15 @@ describe('plugin-meetings', () => {
1181
1203
  it('should send ADD_MEDIA_SUCCESS metrics', async () => {
1182
1204
  meeting.meetingState = 'ACTIVE';
1183
1205
  await meeting.addMedia({
1184
- mediaSettings: {}
1206
+ mediaSettings: {},
1185
1207
  });
1186
1208
 
1187
1209
  assert.calledOnce(Metrics.sendBehavioralMetric);
1188
- assert.calledWith(
1189
- Metrics.sendBehavioralMetric,
1190
- BEHAVIORAL_METRICS.ADD_MEDIA_SUCCESS,
1191
- {
1192
- correlation_id: meeting.correlationId,
1193
- locus_id: meeting.locusUrl.split('/').pop(),
1194
- connectionType: 'udp'
1195
- }
1196
- );
1210
+ assert.calledWith(Metrics.sendBehavioralMetric, BEHAVIORAL_METRICS.ADD_MEDIA_SUCCESS, {
1211
+ correlation_id: meeting.correlationId,
1212
+ locus_id: meeting.locusUrl.split('/').pop(),
1213
+ connectionType: 'udp',
1214
+ });
1197
1215
  });
1198
1216
 
1199
1217
  describe('handles StatsAnalyzer events', () => {
@@ -1211,7 +1229,7 @@ describe('plugin-meetings', () => {
1211
1229
  sinon.stub(StatsAnalyzerModule, 'StatsAnalyzer').returns(statsAnalyzerStub);
1212
1230
 
1213
1231
  await meeting.addMedia({
1214
- mediaSettings: {}
1232
+ mediaSettings: {},
1215
1233
  });
1216
1234
  });
1217
1235
 
@@ -1220,51 +1238,79 @@ describe('plugin-meetings', () => {
1220
1238
  });
1221
1239
 
1222
1240
  it('LOCAL_MEDIA_STARTED triggers "meeting:media:local:start" event and sends metrics', async () => {
1223
- statsAnalyzerStub.emit({file: 'test', function: 'test'}, StatsAnalyzerModule.EVENTS.LOCAL_MEDIA_STARTED, {type: 'audio'});
1241
+ statsAnalyzerStub.emit(
1242
+ {file: 'test', function: 'test'},
1243
+ StatsAnalyzerModule.EVENTS.LOCAL_MEDIA_STARTED,
1244
+ {type: 'audio'}
1245
+ );
1224
1246
 
1225
1247
  assert.calledWith(
1226
1248
  TriggerProxy.trigger,
1227
1249
  sinon.match.instanceOf(Meeting),
1228
1250
  {
1229
1251
  file: 'meeting/index',
1230
- function: 'addMedia'
1252
+ function: 'addMedia',
1231
1253
  },
1232
1254
  EVENT_TRIGGERS.MEETING_MEDIA_LOCAL_STARTED,
1233
1255
  {
1234
- type: 'audio'
1256
+ type: 'audio',
1235
1257
  }
1236
1258
  );
1237
- assert.calledWithMatch(Metrics.postEvent, {event: eventType.SENDING_MEDIA_START, data: {mediaType: 'audio'}});
1259
+ assert.calledWithMatch(Metrics.postEvent, {
1260
+ event: eventType.SENDING_MEDIA_START,
1261
+ data: {mediaType: 'audio'},
1262
+ });
1238
1263
  });
1239
1264
 
1240
1265
  it('LOCAL_MEDIA_STOPPED triggers the right metrics', async () => {
1241
- statsAnalyzerStub.emit({file: 'test', function: 'test'}, StatsAnalyzerModule.EVENTS.LOCAL_MEDIA_STOPPED, {type: 'video'});
1266
+ statsAnalyzerStub.emit(
1267
+ {file: 'test', function: 'test'},
1268
+ StatsAnalyzerModule.EVENTS.LOCAL_MEDIA_STOPPED,
1269
+ {type: 'video'}
1270
+ );
1242
1271
 
1243
- assert.calledWithMatch(Metrics.postEvent, {event: eventType.SENDING_MEDIA_STOP, data: {mediaType: 'video'}});
1272
+ assert.calledWithMatch(Metrics.postEvent, {
1273
+ event: eventType.SENDING_MEDIA_STOP,
1274
+ data: {mediaType: 'video'},
1275
+ });
1244
1276
  });
1245
1277
 
1246
1278
  it('REMOTE_MEDIA_STARTED triggers "meeting:media:remote:start" event and sends metrics', async () => {
1247
- statsAnalyzerStub.emit({file: 'test', function: 'test'}, StatsAnalyzerModule.EVENTS.REMOTE_MEDIA_STARTED, {type: 'video'});
1279
+ statsAnalyzerStub.emit(
1280
+ {file: 'test', function: 'test'},
1281
+ StatsAnalyzerModule.EVENTS.REMOTE_MEDIA_STARTED,
1282
+ {type: 'video'}
1283
+ );
1248
1284
 
1249
1285
  assert.calledWith(
1250
1286
  TriggerProxy.trigger,
1251
1287
  sinon.match.instanceOf(Meeting),
1252
1288
  {
1253
1289
  file: 'meeting/index',
1254
- function: 'addMedia'
1290
+ function: 'addMedia',
1255
1291
  },
1256
1292
  EVENT_TRIGGERS.MEETING_MEDIA_REMOTE_STARTED,
1257
1293
  {
1258
- type: 'video'
1294
+ type: 'video',
1259
1295
  }
1260
1296
  );
1261
- assert.calledWithMatch(Metrics.postEvent, {event: eventType.RECEIVING_MEDIA_START, data: {mediaType: 'video'}});
1297
+ assert.calledWithMatch(Metrics.postEvent, {
1298
+ event: eventType.RECEIVING_MEDIA_START,
1299
+ data: {mediaType: 'video'},
1300
+ });
1262
1301
  });
1263
1302
 
1264
1303
  it('REMOTE_MEDIA_STOPPED triggers the right metrics', async () => {
1265
- statsAnalyzerStub.emit({file: 'test', function: 'test'}, StatsAnalyzerModule.EVENTS.REMOTE_MEDIA_STOPPED, {type: 'audio'});
1304
+ statsAnalyzerStub.emit(
1305
+ {file: 'test', function: 'test'},
1306
+ StatsAnalyzerModule.EVENTS.REMOTE_MEDIA_STOPPED,
1307
+ {type: 'audio'}
1308
+ );
1266
1309
 
1267
- assert.calledWithMatch(Metrics.postEvent, {event: eventType.RECEIVING_MEDIA_STOP, data: {mediaType: 'audio'}});
1310
+ assert.calledWithMatch(Metrics.postEvent, {
1311
+ event: eventType.RECEIVING_MEDIA_STOP,
1312
+ data: {mediaType: 'audio'},
1313
+ });
1268
1314
  });
1269
1315
 
1270
1316
  it('MEDIA_QUALITY triggers the right metrics', async () => {
@@ -1276,7 +1322,10 @@ describe('plugin-meetings', () => {
1276
1322
  {data: fakeData, networkType: 'wifi'}
1277
1323
  );
1278
1324
 
1279
- assert.calledWithMatch(Metrics.postEvent, {event: eventType.MEDIA_QUALITY, data: {intervalData: fakeData, networkType: 'wifi'}});
1325
+ assert.calledWithMatch(Metrics.postEvent, {
1326
+ event: eventType.MEDIA_QUALITY,
1327
+ data: {intervalData: fakeData, networkType: 'wifi'},
1328
+ });
1280
1329
  });
1281
1330
  });
1282
1331
  });
@@ -1339,7 +1388,9 @@ describe('plugin-meetings', () => {
1339
1388
  sandbox = sinon.createSandbox();
1340
1389
  meeting.meetingFiniteStateMachine.ring();
1341
1390
  meeting.meetingFiniteStateMachine.join();
1342
- meeting.meetingRequest.leaveMeeting = sinon.stub().returns(Promise.resolve({body: 'test'}));
1391
+ meeting.meetingRequest.leaveMeeting = sinon
1392
+ .stub()
1393
+ .returns(Promise.resolve({body: 'test'}));
1343
1394
  meeting.locusInfo.onFullLocus = sinon.stub().returns(true);
1344
1395
  // the 3 need to be promises because we do closeLocalStream.then(closeLocalShare.then) etc in the src code
1345
1396
  meeting.closeLocalStream = sinon.stub().returns(Promise.resolve());
@@ -1410,7 +1461,7 @@ describe('plugin-meetings', () => {
1410
1461
  correlationId: meeting.correlationId,
1411
1462
  selfId: meeting.selfId,
1412
1463
  resourceId: null,
1413
- deviceUrl: meeting.deviceUrl
1464
+ deviceUrl: meeting.deviceUrl,
1414
1465
  });
1415
1466
  });
1416
1467
  it('should leave the meeting on the resource', async () => {
@@ -1423,7 +1474,7 @@ describe('plugin-meetings', () => {
1423
1474
  correlationId: meeting.correlationId,
1424
1475
  selfId: meeting.selfId,
1425
1476
  resourceId: meeting.resourceId,
1426
- deviceUrl: meeting.deviceUrl
1477
+ deviceUrl: meeting.deviceUrl,
1427
1478
  });
1428
1479
  });
1429
1480
  });
@@ -1450,7 +1501,9 @@ describe('plugin-meetings', () => {
1450
1501
 
1451
1502
  beforeEach(() => {
1452
1503
  _mediaDirection = meeting.mediaProperties.mediaDirection || {};
1453
- sinon.stub(meeting.mediaProperties, 'mediaDirection').value({sendAudio: true, sendVideo: true, sendShare: false});
1504
+ sinon
1505
+ .stub(meeting.mediaProperties, 'mediaDirection')
1506
+ .value({sendAudio: true, sendVideo: true, sendShare: false});
1454
1507
  });
1455
1508
 
1456
1509
  afterEach(() => {
@@ -1487,7 +1540,11 @@ describe('plugin-meetings', () => {
1487
1540
  it('properly assigns default values', async () => {
1488
1541
  await meeting.shareScreen({sharePreferences: {highFrameRate: true}});
1489
1542
 
1490
- assert.calledWith(Media.getDisplayMedia, {sendShare: true, sendAudio: false, sharePreferences: {highFrameRate: true}});
1543
+ assert.calledWith(Media.getDisplayMedia, {
1544
+ sendShare: true,
1545
+ sendAudio: false,
1546
+ sharePreferences: {highFrameRate: true},
1547
+ });
1491
1548
  });
1492
1549
  });
1493
1550
 
@@ -1512,10 +1569,10 @@ describe('plugin-meetings', () => {
1512
1569
  track: {
1513
1570
  get readyState() {
1514
1571
  return _trackReadyState;
1515
- }
1516
- }
1517
- }
1518
- }
1572
+ },
1573
+ },
1574
+ },
1575
+ },
1519
1576
  });
1520
1577
  });
1521
1578
 
@@ -1573,18 +1630,17 @@ describe('plugin-meetings', () => {
1573
1630
  sendShare,
1574
1631
  receiveShare,
1575
1632
  stream,
1576
- skipSignalingCheck: true
1633
+ skipSignalingCheck: true,
1577
1634
  });
1578
1635
 
1579
1636
  assert.notCalled(meeting.canUpdateMedia);
1580
1637
  });
1581
1638
 
1582
-
1583
1639
  it('skips canUpdateMedia() check on contentTracks.onended', () => {
1584
1640
  const {mediaProperties} = meeting;
1585
1641
  const fakeTrack = {
1586
1642
  getSettings: sinon.stub().returns({}),
1587
- onended: sinon.stub()
1643
+ onended: sinon.stub(),
1588
1644
  };
1589
1645
 
1590
1646
  sandbox.stub(mediaProperties, 'setLocalShareTrack');
@@ -1598,12 +1654,11 @@ describe('plugin-meetings', () => {
1598
1654
  assert.calledWith(meeting.stopShare, {skipSignalingCheck: true});
1599
1655
  });
1600
1656
 
1601
-
1602
1657
  it('stopShare accepts and passes along optional parameters', () => {
1603
1658
  const args = {
1604
1659
  abc: 123,
1605
1660
  receiveShare: false,
1606
- sendShare: false
1661
+ sendShare: false,
1607
1662
  };
1608
1663
 
1609
1664
  sandbox.stub(meeting, 'updateShare').returns(Promise.resolve());
@@ -1646,8 +1701,8 @@ describe('plugin-meetings', () => {
1646
1701
  sandbox.stub(meeting, 'handleShareTrackEnded');
1647
1702
  sandbox.stub(meeting.mediaProperties, 'peerConnection').value({
1648
1703
  shareTransceiver: {
1649
- direction: SENDRECV
1650
- }
1704
+ direction: SENDRECV,
1705
+ },
1651
1706
  });
1652
1707
  sandbox.useFakeTimers();
1653
1708
 
@@ -1655,7 +1710,7 @@ describe('plugin-meetings', () => {
1655
1710
  sendShare,
1656
1711
  receiveShare,
1657
1712
  stream,
1658
- skipSignalingCheck: true
1713
+ skipSignalingCheck: true,
1659
1714
  });
1660
1715
  // simulate the setTimeout in code
1661
1716
  sandbox.clock.tick(delay);
@@ -1676,12 +1731,12 @@ describe('plugin-meetings', () => {
1676
1731
  sinon.match.instanceOf(Meeting),
1677
1732
  {
1678
1733
  file: 'meeting/index',
1679
- function: 'handleShareTrackEnded'
1734
+ function: 'handleShareTrackEnded',
1680
1735
  },
1681
1736
  EVENT_TRIGGERS.MEETING_STOPPED_SHARING_LOCAL,
1682
1737
  {
1683
1738
  stream,
1684
- type: EVENT_TYPES.LOCAL_SHARE
1739
+ type: EVENT_TYPES.LOCAL_SHARE,
1685
1740
  }
1686
1741
  );
1687
1742
  });
@@ -1694,20 +1749,22 @@ describe('plugin-meetings', () => {
1694
1749
  const {resolution} = config;
1695
1750
  const shareOptions = {
1696
1751
  sendShare: true,
1697
- sendAudio: false
1752
+ sendAudio: false,
1698
1753
  };
1699
1754
  const fireFoxOptions = {
1700
1755
  audio: false,
1701
1756
  video: {
1702
1757
  audio: shareOptions.sendAudio,
1703
- video: shareOptions.sendShare
1704
- }
1758
+ video: shareOptions.sendShare,
1759
+ },
1705
1760
  };
1706
1761
 
1707
1762
  const MediaStream = {
1708
- getVideoTracks: () => [{
1709
- applyConstraints: () => {}
1710
- }]
1763
+ getVideoTracks: () => [
1764
+ {
1765
+ applyConstraints: () => {},
1766
+ },
1767
+ ],
1711
1768
  };
1712
1769
 
1713
1770
  const MediaConstraint = {
@@ -1715,7 +1772,7 @@ describe('plugin-meetings', () => {
1715
1772
  aspectRatio: config.aspectRatio,
1716
1773
  frameRate: config.screenFrameRate,
1717
1774
  width: null,
1718
- height: null
1775
+ height: null,
1719
1776
  };
1720
1777
 
1721
1778
  const browserConditionalValue = (value) => {
@@ -1731,31 +1788,23 @@ describe('plugin-meetings', () => {
1731
1788
  if (!global.navigator) {
1732
1789
  global.navigator = {
1733
1790
  mediaDevices: {
1734
- getDisplayMedia: null
1735
- }
1791
+ getDisplayMedia: null,
1792
+ },
1736
1793
  };
1737
1794
  }
1738
1795
  _getDisplayMedia = global.navigator.mediaDevices.getDisplayMedia;
1739
- Object.defineProperty(
1740
- global.navigator.mediaDevices,
1741
- 'getDisplayMedia',
1742
- {
1743
- value: sinon.stub().returns(Promise.resolve(MediaStream)),
1744
- writable: true
1745
- }
1746
- );
1796
+ Object.defineProperty(global.navigator.mediaDevices, 'getDisplayMedia', {
1797
+ value: sinon.stub().returns(Promise.resolve(MediaStream)),
1798
+ writable: true,
1799
+ });
1747
1800
  });
1748
1801
 
1749
1802
  after(() => {
1750
1803
  // clean up for browser
1751
- Object.defineProperty(
1752
- global.navigator.mediaDevices,
1753
- 'getDisplayMedia',
1754
- {
1755
- value: _getDisplayMedia,
1756
- writable: true
1757
- }
1758
- );
1804
+ Object.defineProperty(global.navigator.mediaDevices, 'getDisplayMedia', {
1805
+ value: _getDisplayMedia,
1806
+ writable: true,
1807
+ });
1759
1808
  });
1760
1809
 
1761
1810
  // eslint-disable-next-line max-len
@@ -1767,39 +1816,48 @@ describe('plugin-meetings', () => {
1767
1816
  maxWidth: SHARE_WIDTH,
1768
1817
  maxHeight: SHARE_HEIGHT,
1769
1818
  idealWidth: SHARE_WIDTH,
1770
- idealHeight: SHARE_HEIGHT
1819
+ idealHeight: SHARE_HEIGHT,
1771
1820
  };
1772
1821
 
1773
1822
  // If sharePreferences.shareConstraints is defined it ignores
1774
1823
  // default SDK config settings
1775
- getDisplayMedia({
1776
- ...shareOptions,
1777
- sharePreferences: {shareConstraints}
1778
- }, config);
1824
+ getDisplayMedia(
1825
+ {
1826
+ ...shareOptions,
1827
+ sharePreferences: {shareConstraints},
1828
+ },
1829
+ config
1830
+ );
1779
1831
 
1780
1832
  // eslint-disable-next-line no-undef
1781
- assert.calledWith(navigator.mediaDevices.getDisplayMedia,
1833
+ assert.calledWith(
1834
+ navigator.mediaDevices.getDisplayMedia,
1782
1835
  browserConditionalValue({
1783
1836
  default: {
1784
- video: {...shareConstraints}
1837
+ video: {...shareConstraints},
1785
1838
  },
1786
1839
  // Firefox is being handled differently
1787
- firefox: fireFoxOptions
1788
- }));
1840
+ firefox: fireFoxOptions,
1841
+ })
1842
+ );
1789
1843
  });
1790
1844
 
1791
1845
  // eslint-disable-next-line max-len
1792
1846
  it('will use default resolution if shareConstraints is undefined and highFrameRate is defined', () => {
1793
1847
  // If highFrameRate is defined it ignores default SDK config settings
1794
- getDisplayMedia({
1795
- ...shareOptions,
1796
- sharePreferences: {
1797
- highFrameRate: true
1798
- }
1799
- }, config);
1848
+ getDisplayMedia(
1849
+ {
1850
+ ...shareOptions,
1851
+ sharePreferences: {
1852
+ highFrameRate: true,
1853
+ },
1854
+ },
1855
+ config
1856
+ );
1800
1857
 
1801
1858
  // eslint-disable-next-line no-undef
1802
- assert.calledWith(navigator.mediaDevices.getDisplayMedia,
1859
+ assert.calledWith(
1860
+ navigator.mediaDevices.getDisplayMedia,
1803
1861
  browserConditionalValue({
1804
1862
  default: {
1805
1863
  video: {
@@ -1810,11 +1868,12 @@ describe('plugin-meetings', () => {
1810
1868
  maxWidth: resolution.maxWidth,
1811
1869
  maxHeight: resolution.maxHeight,
1812
1870
  idealWidth: resolution.idealWidth,
1813
- idealHeight: resolution.idealHeight
1814
- }
1871
+ idealHeight: resolution.idealHeight,
1872
+ },
1815
1873
  },
1816
- firefox: fireFoxOptions
1817
- }));
1874
+ firefox: fireFoxOptions,
1875
+ })
1876
+ );
1818
1877
  });
1819
1878
 
1820
1879
  // eslint-disable-next-line max-len
@@ -1823,17 +1882,19 @@ describe('plugin-meetings', () => {
1823
1882
  const {screenResolution} = config;
1824
1883
 
1825
1884
  // eslint-disable-next-line no-undef
1826
- assert.calledWith(navigator.mediaDevices.getDisplayMedia,
1885
+ assert.calledWith(
1886
+ navigator.mediaDevices.getDisplayMedia,
1827
1887
  browserConditionalValue({
1828
1888
  default: {
1829
1889
  video: {
1830
1890
  ...MediaConstraint,
1831
1891
  width: screenResolution.idealWidth,
1832
- height: screenResolution.idealHeight
1833
- }
1892
+ height: screenResolution.idealHeight,
1893
+ },
1834
1894
  },
1835
- firefox: fireFoxOptions
1836
- }));
1895
+ firefox: fireFoxOptions,
1896
+ })
1897
+ );
1837
1898
  });
1838
1899
 
1839
1900
  // Test screenResolution
@@ -1846,14 +1907,15 @@ describe('plugin-meetings', () => {
1846
1907
  maxWidth: SHARE_WIDTH,
1847
1908
  maxHeight: SHARE_HEIGHT,
1848
1909
  idealWidth: SHARE_WIDTH,
1849
- idealHeight: SHARE_HEIGHT
1850
- }
1910
+ idealHeight: SHARE_HEIGHT,
1911
+ },
1851
1912
  };
1852
1913
 
1853
1914
  getDisplayMedia(shareOptions, customConfig);
1854
1915
 
1855
1916
  // eslint-disable-next-line no-undef
1856
- assert.calledWith(navigator.mediaDevices.getDisplayMedia,
1917
+ assert.calledWith(
1918
+ navigator.mediaDevices.getDisplayMedia,
1857
1919
  browserConditionalValue({
1858
1920
  default: {
1859
1921
  video: {
@@ -1863,11 +1925,12 @@ describe('plugin-meetings', () => {
1863
1925
  maxWidth: SHARE_WIDTH,
1864
1926
  maxHeight: SHARE_HEIGHT,
1865
1927
  idealWidth: SHARE_WIDTH,
1866
- idealHeight: SHARE_HEIGHT
1867
- }
1928
+ idealHeight: SHARE_HEIGHT,
1929
+ },
1868
1930
  },
1869
- firefox: fireFoxOptions
1870
- }));
1931
+ firefox: fireFoxOptions,
1932
+ })
1933
+ );
1871
1934
  });
1872
1935
 
1873
1936
  // Test screenFrameRate
@@ -1880,14 +1943,15 @@ describe('plugin-meetings', () => {
1880
1943
  maxWidth: SHARE_WIDTH,
1881
1944
  maxHeight: SHARE_HEIGHT,
1882
1945
  idealWidth: SHARE_WIDTH,
1883
- idealHeight: SHARE_HEIGHT
1884
- }
1946
+ idealHeight: SHARE_HEIGHT,
1947
+ },
1885
1948
  };
1886
1949
 
1887
1950
  getDisplayMedia(shareOptions, customConfig);
1888
1951
 
1889
1952
  // eslint-disable-next-line no-undef
1890
- assert.calledWith(navigator.mediaDevices.getDisplayMedia,
1953
+ assert.calledWith(
1954
+ navigator.mediaDevices.getDisplayMedia,
1891
1955
  browserConditionalValue({
1892
1956
  default: {
1893
1957
  video: {
@@ -1898,11 +1962,12 @@ describe('plugin-meetings', () => {
1898
1962
  maxWidth: SHARE_WIDTH,
1899
1963
  maxHeight: SHARE_HEIGHT,
1900
1964
  idealWidth: SHARE_WIDTH,
1901
- idealHeight: SHARE_HEIGHT
1902
- }
1965
+ idealHeight: SHARE_HEIGHT,
1966
+ },
1903
1967
  },
1904
- firefox: fireFoxOptions
1905
- }));
1968
+ firefox: fireFoxOptions,
1969
+ })
1970
+ );
1906
1971
  });
1907
1972
  });
1908
1973
 
@@ -1938,12 +2003,15 @@ describe('plugin-meetings', () => {
1938
2003
  MeetingUtil.updateTransceiver = sinon.stub();
1939
2004
  });
1940
2005
 
1941
- it('sets previousMediaDirection to an empty object', () => meeting.updateAudio({
1942
- sendAudio: true,
1943
- receiveAudio: true
1944
- }).then(() => {
1945
- assert.calledOnce(MeetingUtil.updateTransceiver);
1946
- }));
2006
+ it('sets previousMediaDirection to an empty object', () =>
2007
+ meeting
2008
+ .updateAudio({
2009
+ sendAudio: true,
2010
+ receiveAudio: true,
2011
+ })
2012
+ .then(() => {
2013
+ assert.calledOnce(MeetingUtil.updateTransceiver);
2014
+ }));
1947
2015
  });
1948
2016
  });
1949
2017
  });
@@ -1961,7 +2029,7 @@ describe('plugin-meetings', () => {
1961
2029
 
1962
2030
  meeting.locusInfo.self = {
1963
2031
  enableDTMF: true,
1964
- url: url2
2032
+ url: url2,
1965
2033
  };
1966
2034
 
1967
2035
  await meeting.sendDTMF(tones);
@@ -1969,7 +2037,7 @@ describe('plugin-meetings', () => {
1969
2037
  assert.calledWith(meeting.meetingRequest.sendDTMF, {
1970
2038
  locusUrl: meeting.locusInfo.self.url,
1971
2039
  deviceUrl: meeting.deviceUrl,
1972
- tones
2040
+ tones,
1973
2041
  });
1974
2042
  });
1975
2043
 
@@ -1983,7 +2051,7 @@ describe('plugin-meetings', () => {
1983
2051
  it('should throw an error', () => {
1984
2052
  meeting.locusInfo.self = {
1985
2053
  enableDTMF: false,
1986
- url: url2
2054
+ url: url2,
1987
2055
  };
1988
2056
 
1989
2057
  assert.isRejected(meeting.sendDTMF('123'));
@@ -2014,7 +2082,7 @@ describe('plugin-meetings', () => {
2014
2082
  receiveVideo: true,
2015
2083
  sendShare: true,
2016
2084
  receiveShare: true,
2017
- isSharing: true
2085
+ isSharing: true,
2018
2086
  };
2019
2087
 
2020
2088
  sandbox.stub(meeting, 'canUpdateMedia').returns(false);
@@ -2022,11 +2090,12 @@ describe('plugin-meetings', () => {
2022
2090
 
2023
2091
  let myPromiseResolved = false;
2024
2092
 
2025
- meeting.updateMedia({
2026
- localStream: mockLocalStream,
2027
- localShare: mockLocalShare,
2028
- mediaSettings
2029
- })
2093
+ meeting
2094
+ .updateMedia({
2095
+ localStream: mockLocalStream,
2096
+ localShare: mockLocalShare,
2097
+ mediaSettings,
2098
+ })
2030
2099
  .then(() => {
2031
2100
  myPromiseResolved = true;
2032
2101
  });
@@ -2043,7 +2112,11 @@ describe('plugin-meetings', () => {
2043
2112
  await testUtils.flushPromises();
2044
2113
 
2045
2114
  // and check that meeting.updateMedia is called with the original args
2046
- assert.calledWith(meeting.updateMedia, {localStream: mockLocalStream, localShare: mockLocalShare, mediaSettings});
2115
+ assert.calledWith(meeting.updateMedia, {
2116
+ localStream: mockLocalStream,
2117
+ localShare: mockLocalShare,
2118
+ mediaSettings,
2119
+ });
2047
2120
  assert.isTrue(myPromiseResolved);
2048
2121
  });
2049
2122
  });
@@ -2058,17 +2131,21 @@ describe('plugin-meetings', () => {
2058
2131
  sendAudio: true,
2059
2132
  sendVideo: true,
2060
2133
  sendShare: false,
2061
- receiveVideo: true
2134
+ receiveVideo: true,
2062
2135
  };
2063
2136
  meeting.getMediaStreams = sinon.stub().returns(Promise.resolve([]));
2064
2137
  meeting.updateVideo = sinon.stub().returns(Promise.resolve());
2065
2138
  meeting.mediaProperties.mediaDirection = mediaDirection;
2066
- meeting.mediaProperties.remoteVideoTrack = sinon.stub().returns({mockTrack: 'mockTrack'});
2139
+ meeting.mediaProperties.remoteVideoTrack = sinon
2140
+ .stub()
2141
+ .returns({mockTrack: 'mockTrack'});
2067
2142
 
2068
- meeting.meetingRequest.changeVideoLayoutDebounced = sinon.stub().returns(Promise.resolve());
2143
+ meeting.meetingRequest.changeVideoLayoutDebounced = sinon
2144
+ .stub()
2145
+ .returns(Promise.resolve());
2069
2146
 
2070
2147
  meeting.locusInfo.self = {
2071
- url: url2
2148
+ url: url2,
2072
2149
  };
2073
2150
  });
2074
2151
 
@@ -2097,11 +2174,11 @@ describe('plugin-meetings', () => {
2097
2174
  deviceUrl: meeting.deviceUrl,
2098
2175
  layoutType,
2099
2176
  main: undefined,
2100
- content: undefined
2177
+ content: undefined,
2101
2178
  });
2102
2179
  });
2103
2180
 
2104
- it('doesn\'t have layoutType which exists in the list of allowed layoutTypes should throw an error', async () => {
2181
+ it("doesn't have layoutType which exists in the list of allowed layoutTypes should throw an error", async () => {
2105
2182
  const layoutType = 'Invalid Layout';
2106
2183
 
2107
2184
  assert.isRejected(meeting.changeVideoLayout(layoutType));
@@ -2115,12 +2192,14 @@ describe('plugin-meetings', () => {
2115
2192
  deviceUrl: meeting.deviceUrl,
2116
2193
  layoutType: undefined,
2117
2194
  main: {width: 100, height: 200},
2118
- content: undefined
2195
+ content: undefined,
2119
2196
  });
2120
2197
  });
2121
2198
 
2122
2199
  it('throws if trying to send renderInfo for content when not receiving content', async () => {
2123
- assert.isRejected(meeting.changeVideoLayout(layoutTypeSingle, {content: {width: 1280, height: 720}}));
2200
+ assert.isRejected(
2201
+ meeting.changeVideoLayout(layoutTypeSingle, {content: {width: 1280, height: 720}})
2202
+ );
2124
2203
  });
2125
2204
 
2126
2205
  it('calls changeVideoLayoutDebounced with renderInfo for main and content', async () => {
@@ -2132,7 +2211,7 @@ describe('plugin-meetings', () => {
2132
2211
  deviceUrl: meeting.deviceUrl,
2133
2212
  layoutType: layoutTypeSingle,
2134
2213
  main: {width: 100, height: 200},
2135
- content: undefined
2214
+ content: undefined,
2136
2215
  });
2137
2216
 
2138
2217
  meeting.mediaProperties.mediaDirection.receiveShare = true;
@@ -2146,18 +2225,21 @@ describe('plugin-meetings', () => {
2146
2225
  deviceUrl: meeting.deviceUrl,
2147
2226
  layoutType: layoutTypeSingle,
2148
2227
  main: {width: 100, height: 200},
2149
- content: {width: 500, height: 600}
2228
+ content: {width: 500, height: 600},
2150
2229
  });
2151
2230
 
2152
2231
  // and now call with both
2153
- await meeting.changeVideoLayout(layoutTypeSingle, {main: {width: 300, height: 400}, content: {width: 700, height: 800}});
2232
+ await meeting.changeVideoLayout(layoutTypeSingle, {
2233
+ main: {width: 300, height: 400},
2234
+ content: {width: 700, height: 800},
2235
+ });
2154
2236
 
2155
2237
  assert.calledWith(meeting.meetingRequest.changeVideoLayoutDebounced, {
2156
2238
  locusUrl: meeting.locusInfo.self.url,
2157
2239
  deviceUrl: meeting.deviceUrl,
2158
2240
  layoutType: layoutTypeSingle,
2159
2241
  main: {width: 300, height: 400},
2160
- content: {width: 700, height: 800}
2242
+ content: {width: 700, height: 800},
2161
2243
  });
2162
2244
 
2163
2245
  // and now set just the layoutType, the previous main and content values should be used
@@ -2170,7 +2252,7 @@ describe('plugin-meetings', () => {
2170
2252
  deviceUrl: meeting.deviceUrl,
2171
2253
  layoutType,
2172
2254
  main: {width: 300, height: 400},
2173
- content: {width: 700, height: 800}
2255
+ content: {width: 700, height: 800},
2174
2256
  });
2175
2257
  });
2176
2258
 
@@ -2182,7 +2264,7 @@ describe('plugin-meetings', () => {
2182
2264
  deviceUrl: meeting.deviceUrl,
2183
2265
  layoutType: layoutTypeSingle,
2184
2266
  main: {width: 1024, height: 768},
2185
- content: undefined
2267
+ content: undefined,
2186
2268
  });
2187
2269
  meeting.meetingRequest.changeVideoLayoutDebounced.resetHistory();
2188
2270
 
@@ -2204,28 +2286,39 @@ describe('plugin-meetings', () => {
2204
2286
  meeting.mediaProperties.mediaDirection.receiveShare = true;
2205
2287
  meeting.mediaProperties.remoteShare = sinon.stub().returns({mockTrack: 'mockTrack'});
2206
2288
 
2207
- await meeting.changeVideoLayout(layoutTypeSingle, {main: {width: 500, height: 510}, content: {width: 1024, height: 768}});
2289
+ await meeting.changeVideoLayout(layoutTypeSingle, {
2290
+ main: {width: 500, height: 510},
2291
+ content: {width: 1024, height: 768},
2292
+ });
2208
2293
 
2209
2294
  assert.calledWith(meeting.meetingRequest.changeVideoLayoutDebounced, {
2210
2295
  locusUrl: meeting.locusInfo.self.url,
2211
2296
  deviceUrl: meeting.deviceUrl,
2212
2297
  layoutType: layoutTypeSingle,
2213
2298
  main: {width: 500, height: 510},
2214
- content: {width: 1024, height: 768}
2299
+ content: {width: 1024, height: 768},
2215
2300
  });
2216
2301
  meeting.meetingRequest.changeVideoLayoutDebounced.resetHistory();
2217
2302
 
2218
2303
  // now send main with width/height different by just 2px - it should be ignored
2219
- await meeting.changeVideoLayout(layoutTypeSingle, {content: {width: 1026, height: 768}});
2304
+ await meeting.changeVideoLayout(layoutTypeSingle, {
2305
+ content: {width: 1026, height: 768},
2306
+ });
2220
2307
  assert.notCalled(meeting.meetingRequest.changeVideoLayoutDebounced);
2221
2308
 
2222
- await meeting.changeVideoLayout(layoutTypeSingle, {content: {width: 1022, height: 768}});
2309
+ await meeting.changeVideoLayout(layoutTypeSingle, {
2310
+ content: {width: 1022, height: 768},
2311
+ });
2223
2312
  assert.notCalled(meeting.meetingRequest.changeVideoLayoutDebounced);
2224
2313
 
2225
- await meeting.changeVideoLayout(layoutTypeSingle, {content: {width: 1024, height: 770}});
2314
+ await meeting.changeVideoLayout(layoutTypeSingle, {
2315
+ content: {width: 1024, height: 770},
2316
+ });
2226
2317
  assert.notCalled(meeting.meetingRequest.changeVideoLayoutDebounced);
2227
2318
 
2228
- await meeting.changeVideoLayout(layoutTypeSingle, {content: {width: 1024, height: 766}});
2319
+ await meeting.changeVideoLayout(layoutTypeSingle, {
2320
+ content: {width: 1024, height: 766},
2321
+ });
2229
2322
  assert.notCalled(meeting.meetingRequest.changeVideoLayoutDebounced);
2230
2323
  });
2231
2324
 
@@ -2233,14 +2326,17 @@ describe('plugin-meetings', () => {
2233
2326
  meeting.mediaProperties.mediaDirection.receiveShare = true;
2234
2327
  meeting.mediaProperties.remoteShare = sinon.stub().returns({mockTrack: 'mockTrack'});
2235
2328
 
2236
- await meeting.changeVideoLayout(layoutTypeSingle, {main: {width: 500.5, height: 510.09}, content: {width: 1024.2, height: 768.85}});
2329
+ await meeting.changeVideoLayout(layoutTypeSingle, {
2330
+ main: {width: 500.5, height: 510.09},
2331
+ content: {width: 1024.2, height: 768.85},
2332
+ });
2237
2333
 
2238
2334
  assert.calledWith(meeting.meetingRequest.changeVideoLayoutDebounced, {
2239
2335
  locusUrl: meeting.locusInfo.self.url,
2240
2336
  deviceUrl: meeting.deviceUrl,
2241
2337
  layoutType: layoutTypeSingle,
2242
2338
  main: {width: 501, height: 510},
2243
- content: {width: 1024, height: 769}
2339
+ content: {width: 1024, height: 769},
2244
2340
  });
2245
2341
  });
2246
2342
  });
@@ -2252,7 +2348,7 @@ describe('plugin-meetings', () => {
2252
2348
  sendAudio: true,
2253
2349
  sendVideo: true,
2254
2350
  sendShare: false,
2255
- receiveVideo: true
2351
+ receiveVideo: true,
2256
2352
  };
2257
2353
 
2258
2354
  meeting.mediaProperties.mediaDirection = mediaDirection;
@@ -2266,7 +2362,7 @@ describe('plugin-meetings', () => {
2266
2362
  sendAudio: true,
2267
2363
  sendVideo: true,
2268
2364
  sendShare: false,
2269
- receiveVideo: false
2365
+ receiveVideo: false,
2270
2366
  };
2271
2367
 
2272
2368
  meeting.mediaProperties.mediaDirection = mediaDirection;
@@ -2280,8 +2376,8 @@ describe('plugin-meetings', () => {
2280
2376
 
2281
2377
  const fakeTrack = {getSettings: () => ({height: 720})};
2282
2378
  const USER_AGENT_CHROME_MAC =
2283
- 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) ' +
2284
- 'AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.85 Safari/537.36';
2379
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) ' +
2380
+ 'AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.85 Safari/537.36';
2285
2381
 
2286
2382
  beforeEach(() => {
2287
2383
  mediaDirection = {sendAudio: true, sendVideo: true, sendShare: false};
@@ -2297,34 +2393,36 @@ describe('plugin-meetings', () => {
2297
2393
  assert.exists(meeting.setLocalVideoQuality);
2298
2394
  });
2299
2395
 
2300
- it('should call getMediaStreams with the proper level', () => meeting.setLocalVideoQuality(CONSTANTS.QUALITY_LEVELS.LOW).then(() => {
2301
- delete mediaDirection.receiveVideo;
2302
- assert.calledWith(meeting.getMediaStreams,
2303
- mediaDirection,
2304
- CONSTANTS.VIDEO_RESOLUTIONS[CONSTANTS.QUALITY_LEVELS.LOW]);
2305
- }));
2396
+ it('should call getMediaStreams with the proper level', () =>
2397
+ meeting.setLocalVideoQuality(CONSTANTS.QUALITY_LEVELS.LOW).then(() => {
2398
+ delete mediaDirection.receiveVideo;
2399
+ assert.calledWith(
2400
+ meeting.getMediaStreams,
2401
+ mediaDirection,
2402
+ CONSTANTS.VIDEO_RESOLUTIONS[CONSTANTS.QUALITY_LEVELS.LOW]
2403
+ );
2404
+ }));
2306
2405
 
2307
2406
  it('when browser is chrome then it should stop previous video track', () => {
2308
2407
  meeting.mediaProperties.videoTrack = fakeTrack;
2309
- assert.equal(
2310
- BrowserDetection(USER_AGENT_CHROME_MAC).getBrowserName(),
2311
- 'Chrome'
2312
- );
2313
- meeting.setLocalVideoQuality(CONSTANTS.QUALITY_LEVELS.LOW)
2314
- .then(() => {
2315
- assert.calledWith(Media.stopTracks, fakeTrack);
2316
- });
2408
+ assert.equal(BrowserDetection(USER_AGENT_CHROME_MAC).getBrowserName(), 'Chrome');
2409
+ meeting.setLocalVideoQuality(CONSTANTS.QUALITY_LEVELS.LOW).then(() => {
2410
+ assert.calledWith(Media.stopTracks, fakeTrack);
2411
+ });
2317
2412
  });
2318
2413
 
2319
- it('should set mediaProperty with the proper level', () => meeting.setLocalVideoQuality(CONSTANTS.QUALITY_LEVELS.LOW).then(() => {
2320
- assert.equal(meeting.mediaProperties.localQualityLevel, CONSTANTS.QUALITY_LEVELS.LOW);
2321
- }));
2414
+ it('should set mediaProperty with the proper level', () =>
2415
+ meeting.setLocalVideoQuality(CONSTANTS.QUALITY_LEVELS.LOW).then(() => {
2416
+ assert.equal(meeting.mediaProperties.localQualityLevel, CONSTANTS.QUALITY_LEVELS.LOW);
2417
+ }));
2322
2418
 
2323
2419
  it('when device does not support 1080p then it should set localQualityLevel with highest possible resolution', () => {
2324
- meeting.setLocalVideoQuality(CONSTANTS.QUALITY_LEVELS['1080p'])
2325
- .then(() => {
2326
- assert.equal(meeting.mediaProperties.localQualityLevel, CONSTANTS.QUALITY_LEVELS['720p']);
2327
- });
2420
+ meeting.setLocalVideoQuality(CONSTANTS.QUALITY_LEVELS['1080p']).then(() => {
2421
+ assert.equal(
2422
+ meeting.mediaProperties.localQualityLevel,
2423
+ CONSTANTS.QUALITY_LEVELS['720p']
2424
+ );
2425
+ });
2328
2426
  });
2329
2427
 
2330
2428
  it('should error if set to a invalid level', () => {
@@ -2350,13 +2448,15 @@ describe('plugin-meetings', () => {
2350
2448
  assert.exists(meeting.setRemoteQualityLevel);
2351
2449
  });
2352
2450
 
2353
- it('should set mediaProperty with the proper level', () => meeting.setRemoteQualityLevel(CONSTANTS.QUALITY_LEVELS.LOW).then(() => {
2354
- assert.equal(meeting.mediaProperties.remoteQualityLevel, CONSTANTS.QUALITY_LEVELS.LOW);
2355
- }));
2451
+ it('should set mediaProperty with the proper level', () =>
2452
+ meeting.setRemoteQualityLevel(CONSTANTS.QUALITY_LEVELS.LOW).then(() => {
2453
+ assert.equal(meeting.mediaProperties.remoteQualityLevel, CONSTANTS.QUALITY_LEVELS.LOW);
2454
+ }));
2356
2455
 
2357
- it('should call updateMedia', () => meeting.setRemoteQualityLevel(CONSTANTS.QUALITY_LEVELS.LOW).then(() => {
2358
- assert.calledOnce(meeting.updateMedia);
2359
- }));
2456
+ it('should call updateMedia', () =>
2457
+ meeting.setRemoteQualityLevel(CONSTANTS.QUALITY_LEVELS.LOW).then(() => {
2458
+ assert.calledOnce(meeting.updateMedia);
2459
+ }));
2360
2460
 
2361
2461
  it('should error if set to a invalid level', () => {
2362
2462
  assert.isRejected(meeting.setRemoteQualityLevel('invalid'));
@@ -2370,8 +2470,12 @@ describe('plugin-meetings', () => {
2370
2470
 
2371
2471
  describe('#usePhoneAudio', () => {
2372
2472
  beforeEach(() => {
2373
- meeting.meetingRequest.dialIn = sinon.stub().returns(Promise.resolve({body: {locus: 'testData'}}));
2374
- meeting.meetingRequest.dialOut = sinon.stub().returns(Promise.resolve({body: {locus: 'testData'}}));
2473
+ meeting.meetingRequest.dialIn = sinon
2474
+ .stub()
2475
+ .returns(Promise.resolve({body: {locus: 'testData'}}));
2476
+ meeting.meetingRequest.dialOut = sinon
2477
+ .stub()
2478
+ .returns(Promise.resolve({body: {locus: 'testData'}}));
2375
2479
  meeting.locusInfo.onFullLocus = sinon.stub().returns(Promise.resolve());
2376
2480
  });
2377
2481
 
@@ -2383,7 +2487,7 @@ describe('plugin-meetings', () => {
2383
2487
  correlationId: meeting.correlationId,
2384
2488
  dialInUrl: DIAL_IN_URL,
2385
2489
  locusUrl: meeting.locusUrl,
2386
- clientUrl: meeting.deviceUrl
2490
+ clientUrl: meeting.deviceUrl,
2387
2491
  });
2388
2492
  assert.calledWith(meeting.locusInfo.onFullLocus, 'testData');
2389
2493
  assert.notCalled(meeting.meetingRequest.dialOut);
@@ -2398,7 +2502,7 @@ describe('plugin-meetings', () => {
2398
2502
  correlationId: meeting.correlationId,
2399
2503
  dialInUrl: DIAL_IN_URL,
2400
2504
  locusUrl: meeting.locusUrl,
2401
- clientUrl: meeting.deviceUrl
2505
+ clientUrl: meeting.deviceUrl,
2402
2506
  });
2403
2507
  assert.calledWith(meeting.locusInfo.onFullLocus, 'testData');
2404
2508
  assert.notCalled(meeting.meetingRequest.dialOut);
@@ -2415,7 +2519,7 @@ describe('plugin-meetings', () => {
2415
2519
  dialOutUrl: DIAL_OUT_URL,
2416
2520
  locusUrl: meeting.locusUrl,
2417
2521
  clientUrl: meeting.deviceUrl,
2418
- phoneNumber
2522
+ phoneNumber,
2419
2523
  });
2420
2524
  assert.calledWith(meeting.locusInfo.onFullLocus, 'testData');
2421
2525
  assert.notCalled(meeting.meetingRequest.dialIn);
@@ -2431,7 +2535,7 @@ describe('plugin-meetings', () => {
2431
2535
  dialOutUrl: DIAL_OUT_URL,
2432
2536
  locusUrl: meeting.locusUrl,
2433
2537
  clientUrl: meeting.deviceUrl,
2434
- phoneNumber
2538
+ phoneNumber,
2435
2539
  });
2436
2540
  assert.calledWith(meeting.locusInfo.onFullLocus, 'testData');
2437
2541
  assert.notCalled(meeting.meetingRequest.dialIn);
@@ -2442,11 +2546,14 @@ describe('plugin-meetings', () => {
2442
2546
 
2443
2547
  meeting.meetingRequest.dialIn = sinon.stub().returns(Promise.reject(error));
2444
2548
 
2445
- return meeting.usePhoneAudio().then(() => Promise.reject(new Error('Promise resolved when it should have rejected'))).catch((e) => {
2446
- assert.equal(e, error);
2549
+ return meeting
2550
+ .usePhoneAudio()
2551
+ .then(() => Promise.reject(new Error('Promise resolved when it should have rejected')))
2552
+ .catch((e) => {
2553
+ assert.equal(e, error);
2447
2554
 
2448
- return Promise.resolve();
2449
- });
2555
+ return Promise.resolve();
2556
+ });
2450
2557
  });
2451
2558
 
2452
2559
  it('rejects if the request failed (dial out)', async () => {
@@ -2454,11 +2561,14 @@ describe('plugin-meetings', () => {
2454
2561
 
2455
2562
  meeting.meetingRequest.dialOut = sinon.stub().returns(Promise.reject(error));
2456
2563
 
2457
- return meeting.usePhoneAudio('+441234567890').then(() => Promise.reject(new Error('Promise resolved when it should have rejected'))).catch((e) => {
2458
- assert.equal(e, error);
2564
+ return meeting
2565
+ .usePhoneAudio('+441234567890')
2566
+ .then(() => Promise.reject(new Error('Promise resolved when it should have rejected')))
2567
+ .catch((e) => {
2568
+ assert.equal(e, error);
2459
2569
 
2460
- return Promise.resolve();
2461
- });
2570
+ return Promise.resolve();
2571
+ });
2462
2572
  });
2463
2573
  });
2464
2574
 
@@ -2477,34 +2587,42 @@ describe('plugin-meetings', () => {
2477
2587
  locusUrl: 'some_locus_url',
2478
2588
  sipUrl: 'some_sip_url', // or sipMeetingUri
2479
2589
  meetingNumber: '123456', // this.config.experimental.enableUnifiedMeetings
2480
- hostId: 'some_host_id' // this.owner;
2590
+ hostId: 'some_host_id', // this.owner;
2481
2591
  };
2482
2592
  const FAKE_SDK_CAPTCHA_INFO = {
2483
2593
  captchaId: FAKE_CAPTCHA_ID,
2484
2594
  verificationImageURL: FAKE_CAPTCHA_IMAGE_URL,
2485
2595
  verificationAudioURL: FAKE_CAPTCHA_AUDIO_URL,
2486
- refreshURL: FAKE_CAPTCHA_REFRESH_URL
2596
+ refreshURL: FAKE_CAPTCHA_REFRESH_URL,
2487
2597
  };
2488
2598
  const FAKE_WBXAPPAPI_CAPTCHA_INFO = {
2489
2599
  captchaID: `${FAKE_CAPTCHA_ID}-2`,
2490
2600
  verificationImageURL: `${FAKE_CAPTCHA_IMAGE_URL}-2`,
2491
2601
  verificationAudioURL: `${FAKE_CAPTCHA_AUDIO_URL}-2`,
2492
- refreshURL: `${FAKE_CAPTCHA_REFRESH_URL}-2`
2602
+ refreshURL: `${FAKE_CAPTCHA_REFRESH_URL}-2`,
2493
2603
  };
2494
2604
 
2495
-
2496
2605
  it('calls meetingInfoProvider with all the right parameters and parses the result', async () => {
2497
- meeting.attrs.meetingInfoProvider = {fetchMeetingInfo: sinon.stub().resolves({body: FAKE_MEETING_INFO})};
2606
+ meeting.attrs.meetingInfoProvider = {
2607
+ fetchMeetingInfo: sinon.stub().resolves({body: FAKE_MEETING_INFO}),
2608
+ };
2498
2609
  meeting.requiredCaptcha = FAKE_SDK_CAPTCHA_INFO;
2499
2610
  meeting.destination = FAKE_DESTINATION;
2500
2611
  meeting.destinationType = FAKE_TYPE;
2501
2612
  meeting.parseMeetingInfo = sinon.stub().returns(undefined);
2502
2613
 
2503
2614
  await meeting.fetchMeetingInfo({
2504
- password: FAKE_PASSWORD, captchaCode: FAKE_CAPTCHA_CODE
2615
+ password: FAKE_PASSWORD,
2616
+ captchaCode: FAKE_CAPTCHA_CODE,
2505
2617
  });
2506
2618
 
2507
- assert.calledWith(meeting.attrs.meetingInfoProvider.fetchMeetingInfo, FAKE_DESTINATION, FAKE_TYPE, FAKE_PASSWORD, {code: FAKE_CAPTCHA_CODE, id: FAKE_CAPTCHA_ID});
2619
+ assert.calledWith(
2620
+ meeting.attrs.meetingInfoProvider.fetchMeetingInfo,
2621
+ FAKE_DESTINATION,
2622
+ FAKE_TYPE,
2623
+ FAKE_PASSWORD,
2624
+ {code: FAKE_CAPTCHA_CODE, id: FAKE_CAPTCHA_ID}
2625
+ );
2508
2626
 
2509
2627
  assert.calledWith(meeting.parseMeetingInfo, {body: FAKE_MEETING_INFO}, FAKE_DESTINATION);
2510
2628
  assert.deepEqual(meeting.meetingInfo, FAKE_MEETING_INFO);
@@ -2512,11 +2630,18 @@ describe('plugin-meetings', () => {
2512
2630
  assert.equal(meeting.meetingInfoFailureReason, MEETING_INFO_FAILURE_REASON.NONE);
2513
2631
  assert.equal(meeting.requiredCaptcha, null);
2514
2632
  assert.calledTwice(TriggerProxy.trigger);
2515
- assert.calledWith(TriggerProxy.trigger, meeting, {file: 'meetings', function: 'fetchMeetingInfo'}, 'meeting:meetingInfoAvailable');
2633
+ assert.calledWith(
2634
+ TriggerProxy.trigger,
2635
+ meeting,
2636
+ {file: 'meetings', function: 'fetchMeetingInfo'},
2637
+ 'meeting:meetingInfoAvailable'
2638
+ );
2516
2639
  });
2517
2640
 
2518
2641
  it('calls meetingInfoProvider with all the right parameters and parses the result when random delay is applied', async () => {
2519
- meeting.attrs.meetingInfoProvider = {fetchMeetingInfo: sinon.stub().resolves({body: FAKE_MEETING_INFO})};
2642
+ meeting.attrs.meetingInfoProvider = {
2643
+ fetchMeetingInfo: sinon.stub().resolves({body: FAKE_MEETING_INFO}),
2644
+ };
2520
2645
  meeting.destination = FAKE_DESTINATION;
2521
2646
  meeting.destinationType = FAKE_TYPE;
2522
2647
  meeting.parseMeetingInfo = sinon.stub().returns(undefined);
@@ -2533,7 +2658,13 @@ describe('plugin-meetings', () => {
2533
2658
  assert.isUndefined(meeting.fetchMeetingInfoTimeoutId);
2534
2659
 
2535
2660
  // meeting info provider
2536
- assert.calledWith(meeting.attrs.meetingInfoProvider.fetchMeetingInfo, FAKE_DESTINATION, FAKE_TYPE, null, null);
2661
+ assert.calledWith(
2662
+ meeting.attrs.meetingInfoProvider.fetchMeetingInfo,
2663
+ FAKE_DESTINATION,
2664
+ FAKE_TYPE,
2665
+ null,
2666
+ null
2667
+ );
2537
2668
 
2538
2669
  // parseMeeting info
2539
2670
  assert.calledWith(meeting.parseMeetingInfo, {body: FAKE_MEETING_INFO}, FAKE_DESTINATION);
@@ -2544,31 +2675,48 @@ describe('plugin-meetings', () => {
2544
2675
  assert.equal(meeting.passwordStatus, PASSWORD_STATUS.NOT_REQUIRED);
2545
2676
 
2546
2677
  assert.calledTwice(TriggerProxy.trigger);
2547
- assert.calledWith(TriggerProxy.trigger, meeting, {file: 'meetings', function: 'fetchMeetingInfo'}, 'meeting:meetingInfoAvailable');
2678
+ assert.calledWith(
2679
+ TriggerProxy.trigger,
2680
+ meeting,
2681
+ {file: 'meetings', function: 'fetchMeetingInfo'},
2682
+ 'meeting:meetingInfoAvailable'
2683
+ );
2548
2684
  });
2549
2685
 
2550
2686
  it('fails if captchaCode is provided when captcha not needed', async () => {
2551
- meeting.attrs.meetingInfoProvider = {fetchMeetingInfo: sinon.stub().resolves({body: FAKE_MEETING_INFO})};
2687
+ meeting.attrs.meetingInfoProvider = {
2688
+ fetchMeetingInfo: sinon.stub().resolves({body: FAKE_MEETING_INFO}),
2689
+ };
2552
2690
  meeting.requiredCaptcha = null;
2553
2691
  meeting.destination = FAKE_DESTINATION;
2554
2692
  meeting.destinationType = FAKE_TYPE;
2555
2693
 
2556
- await assert.isRejected(meeting.fetchMeetingInfo({
2557
- captchaCode: FAKE_CAPTCHA_CODE
2558
- }), Error, 'fetchMeetingInfo() called with captchaCode when captcha was not required');
2694
+ await assert.isRejected(
2695
+ meeting.fetchMeetingInfo({
2696
+ captchaCode: FAKE_CAPTCHA_CODE,
2697
+ }),
2698
+ Error,
2699
+ 'fetchMeetingInfo() called with captchaCode when captcha was not required'
2700
+ );
2559
2701
 
2560
2702
  assert.notCalled(meeting.attrs.meetingInfoProvider.fetchMeetingInfo);
2561
2703
  });
2562
2704
 
2563
2705
  it('fails if password is provided when not required', async () => {
2564
- meeting.attrs.meetingInfoProvider = {fetchMeetingInfo: sinon.stub().resolves({body: FAKE_MEETING_INFO})};
2706
+ meeting.attrs.meetingInfoProvider = {
2707
+ fetchMeetingInfo: sinon.stub().resolves({body: FAKE_MEETING_INFO}),
2708
+ };
2565
2709
  meeting.passwordStatus = PASSWORD_STATUS.NOT_REQUIRED;
2566
2710
  meeting.destination = FAKE_DESTINATION;
2567
2711
  meeting.destinationType = FAKE_TYPE;
2568
2712
 
2569
- await assert.isRejected(meeting.fetchMeetingInfo({
2570
- password: FAKE_PASSWORD
2571
- }), Error, 'fetchMeetingInfo() called with password when password was not required');
2713
+ await assert.isRejected(
2714
+ meeting.fetchMeetingInfo({
2715
+ password: FAKE_PASSWORD,
2716
+ }),
2717
+ Error,
2718
+ 'fetchMeetingInfo() called with password when password was not required'
2719
+ );
2572
2720
 
2573
2721
  assert.notCalled(meeting.attrs.meetingInfoProvider.fetchMeetingInfo);
2574
2722
  });
@@ -2577,15 +2725,26 @@ describe('plugin-meetings', () => {
2577
2725
  meeting.destination = FAKE_DESTINATION;
2578
2726
  meeting.destinationType = FAKE_TYPE;
2579
2727
  meeting.attrs.meetingInfoProvider = {
2580
- fetchMeetingInfo: sinon.stub().throws(new MeetingInfoV2PasswordError(403004, FAKE_MEETING_INFO))
2728
+ fetchMeetingInfo: sinon
2729
+ .stub()
2730
+ .throws(new MeetingInfoV2PasswordError(403004, FAKE_MEETING_INFO)),
2581
2731
  };
2582
2732
 
2583
2733
  await assert.isRejected(meeting.fetchMeetingInfo({}), PasswordError);
2584
2734
 
2585
- assert.calledWith(meeting.attrs.meetingInfoProvider.fetchMeetingInfo, FAKE_DESTINATION, FAKE_TYPE, null, null);
2735
+ assert.calledWith(
2736
+ meeting.attrs.meetingInfoProvider.fetchMeetingInfo,
2737
+ FAKE_DESTINATION,
2738
+ FAKE_TYPE,
2739
+ null,
2740
+ null
2741
+ );
2586
2742
 
2587
2743
  assert.deepEqual(meeting.meetingInfo, FAKE_MEETING_INFO);
2588
- assert.equal(meeting.meetingInfoFailureReason, MEETING_INFO_FAILURE_REASON.WRONG_PASSWORD);
2744
+ assert.equal(
2745
+ meeting.meetingInfoFailureReason,
2746
+ MEETING_INFO_FAILURE_REASON.WRONG_PASSWORD
2747
+ );
2589
2748
  assert.equal(meeting.requiredCaptcha, null);
2590
2749
  assert.equal(meeting.passwordStatus, PASSWORD_STATUS.REQUIRED);
2591
2750
  });
@@ -2594,25 +2753,38 @@ describe('plugin-meetings', () => {
2594
2753
  meeting.destination = FAKE_DESTINATION;
2595
2754
  meeting.destinationType = FAKE_TYPE;
2596
2755
  meeting.attrs.meetingInfoProvider = {
2597
- fetchMeetingInfo: sinon.stub().throws(new MeetingInfoV2CaptchaError(423005, FAKE_SDK_CAPTCHA_INFO))
2756
+ fetchMeetingInfo: sinon
2757
+ .stub()
2758
+ .throws(new MeetingInfoV2CaptchaError(423005, FAKE_SDK_CAPTCHA_INFO)),
2598
2759
  };
2599
2760
  meeting.requiredCaptcha = null;
2600
2761
 
2601
- await assert.isRejected(meeting.fetchMeetingInfo({
2602
- password: 'aaa'
2603
- }), CaptchaError);
2604
-
2605
- assert.calledWith(meeting.attrs.meetingInfoProvider.fetchMeetingInfo, FAKE_DESTINATION, FAKE_TYPE, 'aaa', null);
2762
+ await assert.isRejected(
2763
+ meeting.fetchMeetingInfo({
2764
+ password: 'aaa',
2765
+ }),
2766
+ CaptchaError
2767
+ );
2606
2768
 
2769
+ assert.calledWith(
2770
+ meeting.attrs.meetingInfoProvider.fetchMeetingInfo,
2771
+ FAKE_DESTINATION,
2772
+ FAKE_TYPE,
2773
+ 'aaa',
2774
+ null
2775
+ );
2607
2776
 
2608
2777
  assert.deepEqual(meeting.meetingInfo, {});
2609
- assert.equal(meeting.meetingInfoFailureReason, MEETING_INFO_FAILURE_REASON.WRONG_PASSWORD);
2778
+ assert.equal(
2779
+ meeting.meetingInfoFailureReason,
2780
+ MEETING_INFO_FAILURE_REASON.WRONG_PASSWORD
2781
+ );
2610
2782
  assert.equal(meeting.passwordStatus, PASSWORD_STATUS.REQUIRED);
2611
2783
  assert.deepEqual(meeting.requiredCaptcha, {
2612
2784
  captchaId: FAKE_CAPTCHA_ID,
2613
2785
  verificationImageURL: FAKE_CAPTCHA_IMAGE_URL,
2614
2786
  verificationAudioURL: FAKE_CAPTCHA_AUDIO_URL,
2615
- refreshURL: FAKE_CAPTCHA_REFRESH_URL
2787
+ refreshURL: FAKE_CAPTCHA_REFRESH_URL,
2616
2788
  });
2617
2789
  });
2618
2790
 
@@ -2620,15 +2792,27 @@ describe('plugin-meetings', () => {
2620
2792
  meeting.destination = FAKE_DESTINATION;
2621
2793
  meeting.destinationType = FAKE_TYPE;
2622
2794
  meeting.attrs.meetingInfoProvider = {
2623
- fetchMeetingInfo: sinon.stub().throws(new MeetingInfoV2CaptchaError(423005, FAKE_SDK_CAPTCHA_INFO))
2795
+ fetchMeetingInfo: sinon
2796
+ .stub()
2797
+ .throws(new MeetingInfoV2CaptchaError(423005, FAKE_SDK_CAPTCHA_INFO)),
2624
2798
  };
2625
2799
  meeting.requiredCaptcha = FAKE_SDK_CAPTCHA_INFO;
2626
2800
 
2627
- await assert.isRejected(meeting.fetchMeetingInfo({
2628
- password: 'aaa', captchaCode: 'bbb'
2629
- }), CaptchaError);
2801
+ await assert.isRejected(
2802
+ meeting.fetchMeetingInfo({
2803
+ password: 'aaa',
2804
+ captchaCode: 'bbb',
2805
+ }),
2806
+ CaptchaError
2807
+ );
2630
2808
 
2631
- assert.calledWith(meeting.attrs.meetingInfoProvider.fetchMeetingInfo, FAKE_DESTINATION, FAKE_TYPE, 'aaa', {code: 'bbb', id: FAKE_CAPTCHA_ID});
2809
+ assert.calledWith(
2810
+ meeting.attrs.meetingInfoProvider.fetchMeetingInfo,
2811
+ FAKE_DESTINATION,
2812
+ FAKE_TYPE,
2813
+ 'aaa',
2814
+ {code: 'bbb', id: FAKE_CAPTCHA_ID}
2815
+ );
2632
2816
 
2633
2817
  assert.deepEqual(meeting.meetingInfo, {});
2634
2818
  assert.equal(meeting.meetingInfoFailureReason, MEETING_INFO_FAILURE_REASON.WRONG_CAPTCHA);
@@ -2640,20 +2824,24 @@ describe('plugin-meetings', () => {
2640
2824
  meeting.destination = FAKE_DESTINATION;
2641
2825
  meeting.destinationType = FAKE_TYPE;
2642
2826
  meeting.attrs.meetingInfoProvider = {
2643
- fetchMeetingInfo: sinon.stub().resolves(
2644
- {
2645
- statusCode: 200,
2646
- body: FAKE_MEETING_INFO
2647
- }
2648
- )
2827
+ fetchMeetingInfo: sinon.stub().resolves({
2828
+ statusCode: 200,
2829
+ body: FAKE_MEETING_INFO,
2830
+ }),
2649
2831
  };
2650
2832
  meeting.passwordStatus = PASSWORD_STATUS.REQUIRED;
2651
2833
 
2652
2834
  await meeting.fetchMeetingInfo({
2653
- password: 'aaa'
2835
+ password: 'aaa',
2654
2836
  });
2655
2837
 
2656
- assert.calledWith(meeting.attrs.meetingInfoProvider.fetchMeetingInfo, FAKE_DESTINATION, FAKE_TYPE, 'aaa', null);
2838
+ assert.calledWith(
2839
+ meeting.attrs.meetingInfoProvider.fetchMeetingInfo,
2840
+ FAKE_DESTINATION,
2841
+ FAKE_TYPE,
2842
+ 'aaa',
2843
+ null
2844
+ );
2657
2845
 
2658
2846
  assert.deepEqual(meeting.meetingInfo, FAKE_MEETING_INFO);
2659
2847
  assert.equal(meeting.meetingInfoFailureReason, MEETING_INFO_FAILURE_REASON.NONE);
@@ -2667,36 +2855,50 @@ describe('plugin-meetings', () => {
2667
2855
  const refreshedCaptcha = {
2668
2856
  captchaID: FAKE_WBXAPPAPI_CAPTCHA_INFO.captchaID,
2669
2857
  verificationImageURL: FAKE_WBXAPPAPI_CAPTCHA_INFO.verificationImageURL,
2670
- verificationAudioURL: FAKE_WBXAPPAPI_CAPTCHA_INFO.verificationAudioURL
2858
+ verificationAudioURL: FAKE_WBXAPPAPI_CAPTCHA_INFO.verificationAudioURL,
2671
2859
  };
2672
2860
 
2673
2861
  meeting.attrs.meetingInfoProvider = {
2674
- fetchMeetingInfo: sinon.stub().throws(new MeetingInfoV2PasswordError(403004, FAKE_MEETING_INFO))
2862
+ fetchMeetingInfo: sinon
2863
+ .stub()
2864
+ .throws(new MeetingInfoV2PasswordError(403004, FAKE_MEETING_INFO)),
2675
2865
  };
2676
- meeting.meetingRequest.refreshCaptcha = sinon.stub().returns(Promise.resolve(
2677
- {
2678
- body: refreshedCaptcha
2679
- }
2680
- ));
2866
+ meeting.meetingRequest.refreshCaptcha = sinon.stub().returns(
2867
+ Promise.resolve({
2868
+ body: refreshedCaptcha,
2869
+ })
2870
+ );
2681
2871
  meeting.passwordStatus = PASSWORD_STATUS.REQUIRED;
2682
2872
  meeting.requiredCaptcha = FAKE_SDK_CAPTCHA_INFO;
2683
2873
  meeting.destination = FAKE_DESTINATION;
2684
2874
  meeting.destinationType = FAKE_TYPE;
2685
2875
 
2686
- await assert.isRejected(meeting.fetchMeetingInfo({
2687
- password: 'aaa', captchaCode: 'bbb'
2688
- }));
2876
+ await assert.isRejected(
2877
+ meeting.fetchMeetingInfo({
2878
+ password: 'aaa',
2879
+ captchaCode: 'bbb',
2880
+ })
2881
+ );
2689
2882
 
2690
- assert.calledWith(meeting.attrs.meetingInfoProvider.fetchMeetingInfo, FAKE_DESTINATION, FAKE_TYPE, 'aaa', {code: 'bbb', id: FAKE_CAPTCHA_ID});
2883
+ assert.calledWith(
2884
+ meeting.attrs.meetingInfoProvider.fetchMeetingInfo,
2885
+ FAKE_DESTINATION,
2886
+ FAKE_TYPE,
2887
+ 'aaa',
2888
+ {code: 'bbb', id: FAKE_CAPTCHA_ID}
2889
+ );
2691
2890
 
2692
2891
  assert.deepEqual(meeting.meetingInfo, FAKE_MEETING_INFO);
2693
- assert.equal(meeting.meetingInfoFailureReason, MEETING_INFO_FAILURE_REASON.WRONG_PASSWORD);
2892
+ assert.equal(
2893
+ meeting.meetingInfoFailureReason,
2894
+ MEETING_INFO_FAILURE_REASON.WRONG_PASSWORD
2895
+ );
2694
2896
  assert.equal(meeting.passwordStatus, PASSWORD_STATUS.REQUIRED);
2695
2897
  assert.deepEqual(meeting.requiredCaptcha, {
2696
2898
  captchaId: refreshedCaptcha.captchaID,
2697
2899
  verificationImageURL: refreshedCaptcha.verificationImageURL,
2698
2900
  verificationAudioURL: refreshedCaptcha.verificationAudioURL,
2699
- refreshURL: FAKE_SDK_CAPTCHA_INFO.refreshURL // refresh url doesn't change
2901
+ refreshURL: FAKE_SDK_CAPTCHA_INFO.refreshURL, // refresh url doesn't change
2700
2902
  });
2701
2903
  });
2702
2904
  });
@@ -2706,48 +2908,56 @@ describe('plugin-meetings', () => {
2706
2908
  assert.isRejected(meeting.refreshCaptcha(), Error);
2707
2909
  });
2708
2910
  it('sends correct request to captcha service refresh url', async () => {
2709
- const REFRESH_URL = 'https://something.webex.com/captchaservice/v1/captchas/refresh?blablabla=something&captchaID=xxx';
2710
- const EXPECTED_REFRESH_URL = 'https://something.webex.com/captchaservice/v1/captchas/refresh?blablabla=something&captchaID=xxx&siteFullName=something.webex.com';
2911
+ const REFRESH_URL =
2912
+ 'https://something.webex.com/captchaservice/v1/captchas/refresh?blablabla=something&captchaID=xxx';
2913
+ const EXPECTED_REFRESH_URL =
2914
+ 'https://something.webex.com/captchaservice/v1/captchas/refresh?blablabla=something&captchaID=xxx&siteFullName=something.webex.com';
2711
2915
 
2712
2916
  const FAKE_SDK_CAPTCHA_INFO = {
2713
2917
  captchaId: 'some id',
2714
2918
  verificationImageURL: 'some image url',
2715
2919
  verificationAudioURL: 'some audio url',
2716
- refreshURL: REFRESH_URL
2920
+ refreshURL: REFRESH_URL,
2717
2921
  };
2718
2922
 
2719
2923
  const FAKE_REFRESHED_CAPTCHA = {
2720
2924
  captchaID: 'some id',
2721
2925
  verificationImageURL: 'some image url',
2722
- verificationAudioURL: 'some audio url'
2926
+ verificationAudioURL: 'some audio url',
2723
2927
  };
2724
2928
 
2725
2929
  // setup the meeting so that a captcha is required
2726
2930
  meeting.attrs.meetingInfoProvider = {
2727
- fetchMeetingInfo: sinon.stub().throws(new MeetingInfoV2CaptchaError(423005, FAKE_SDK_CAPTCHA_INFO))
2931
+ fetchMeetingInfo: sinon
2932
+ .stub()
2933
+ .throws(new MeetingInfoV2CaptchaError(423005, FAKE_SDK_CAPTCHA_INFO)),
2728
2934
  };
2729
2935
 
2730
- await assert.isRejected(meeting.fetchMeetingInfo({
2731
- password: ''
2732
- }), CaptchaError);
2936
+ await assert.isRejected(
2937
+ meeting.fetchMeetingInfo({
2938
+ password: '',
2939
+ }),
2940
+ CaptchaError
2941
+ );
2733
2942
 
2734
2943
  assert.deepEqual(meeting.requiredCaptcha, FAKE_SDK_CAPTCHA_INFO);
2735
- meeting.meetingRequest.refreshCaptcha = sinon.stub().returns(Promise.resolve({body: FAKE_REFRESHED_CAPTCHA}));
2944
+ meeting.meetingRequest.refreshCaptcha = sinon
2945
+ .stub()
2946
+ .returns(Promise.resolve({body: FAKE_REFRESHED_CAPTCHA}));
2736
2947
 
2737
2948
  // test the captcha refresh
2738
2949
  await meeting.refreshCaptcha();
2739
2950
 
2740
- assert.calledWith(meeting.meetingRequest.refreshCaptcha,
2741
- {
2742
- captchaRefreshUrl: EXPECTED_REFRESH_URL,
2743
- captchaId: FAKE_SDK_CAPTCHA_INFO.captchaId
2744
- });
2951
+ assert.calledWith(meeting.meetingRequest.refreshCaptcha, {
2952
+ captchaRefreshUrl: EXPECTED_REFRESH_URL,
2953
+ captchaId: FAKE_SDK_CAPTCHA_INFO.captchaId,
2954
+ });
2745
2955
 
2746
2956
  assert.deepEqual(meeting.requiredCaptcha, {
2747
2957
  captchaId: FAKE_REFRESHED_CAPTCHA.captchaID,
2748
2958
  verificationImageURL: FAKE_REFRESHED_CAPTCHA.verificationImageURL,
2749
2959
  verificationAudioURL: FAKE_REFRESHED_CAPTCHA.verificationAudioURL,
2750
- refreshURL: FAKE_SDK_CAPTCHA_INFO.refreshURL // refresh url doesn't change
2960
+ refreshURL: FAKE_SDK_CAPTCHA_INFO.refreshURL, // refresh url doesn't change
2751
2961
  });
2752
2962
  });
2753
2963
  });
@@ -2761,7 +2971,7 @@ describe('plugin-meetings', () => {
2761
2971
  assert(Metrics.sendBehavioralMetric.calledOnce);
2762
2972
  assert.calledWith(
2763
2973
  Metrics.sendBehavioralMetric,
2764
- BEHAVIORAL_METRICS.VERIFY_PASSWORD_SUCCESS,
2974
+ BEHAVIORAL_METRICS.VERIFY_PASSWORD_SUCCESS
2765
2975
  );
2766
2976
  assert.equal(result.isPasswordValid, true);
2767
2977
  assert.equal(result.requiredCaptcha, null);
@@ -2836,7 +3046,9 @@ describe('plugin-meetings', () => {
2836
3046
  sandbox = sinon.createSandbox();
2837
3047
  meeting.meetingFiniteStateMachine.ring();
2838
3048
  meeting.meetingFiniteStateMachine.join();
2839
- meeting.meetingRequest.endMeetingForAll = sinon.stub().returns(Promise.resolve({body: 'test'}));
3049
+ meeting.meetingRequest.endMeetingForAll = sinon
3050
+ .stub()
3051
+ .returns(Promise.resolve({body: 'test'}));
2840
3052
  meeting.locusInfo.onFullLocus = sinon.stub().returns(true);
2841
3053
  meeting.closeLocalStream = sinon.stub().returns(Promise.resolve());
2842
3054
  meeting.closeLocalShare = sinon.stub().returns(Promise.resolve());
@@ -2890,7 +3102,11 @@ describe('plugin-meetings', () => {
2890
3102
  sandbox.stub(meeting.mediaProperties, 'unsetMediaTracks');
2891
3103
 
2892
3104
  sandbox.stub(meeting.reconnectionManager, 'reconnectMedia').returns(Promise.resolve());
2893
- sandbox.stub(MeetingUtil, 'joinMeeting').returns(Promise.resolve(MeetingUtil.parseLocusJoin({body: {locus, mediaConnections: []}})));
3105
+ sandbox
3106
+ .stub(MeetingUtil, 'joinMeeting')
3107
+ .returns(
3108
+ Promise.resolve(MeetingUtil.parseLocusJoin({body: {locus, mediaConnections: []}}))
3109
+ );
2894
3110
  });
2895
3111
 
2896
3112
  afterEach(() => {
@@ -2901,8 +3117,7 @@ describe('plugin-meetings', () => {
2901
3117
  it('should throw an error if resourceId not passed', async () => {
2902
3118
  try {
2903
3119
  await meeting.moveTo();
2904
- }
2905
- catch (err) {
3120
+ } catch (err) {
2906
3121
  assert.instanceOf(err, ParameterError);
2907
3122
  assert.equal(err.sdkMessage, 'Cannot move call without a resourceId.');
2908
3123
  }
@@ -2919,17 +3134,17 @@ describe('plugin-meetings', () => {
2919
3134
  share: true,
2920
3135
  share_audio: false,
2921
3136
  video: false,
2922
- whiteboard: false
3137
+ whiteboard: false,
2923
3138
  },
2924
3139
  tx: {
2925
3140
  audio: false,
2926
3141
  share: false,
2927
3142
  share_audio: false,
2928
3143
  video: false,
2929
- whiteboard: false
2930
- }
2931
- }
2932
- }
3144
+ whiteboard: false,
3145
+ },
3146
+ },
3147
+ },
2933
3148
  });
2934
3149
  assert.calledWithMatch(Metrics.postEvent, {event: eventType.MOVE_MEDIA});
2935
3150
  });
@@ -2938,17 +3153,19 @@ describe('plugin-meetings', () => {
2938
3153
  sinon.spy(MeetingUtil, 'joinMeetingOptions');
2939
3154
  await meeting.moveTo('resourceId');
2940
3155
 
2941
- assert.calledWith(MeetingUtil.joinMeetingOptions, meeting, {resourceId: 'resourceId', moveToResource: true});
3156
+ assert.calledWith(MeetingUtil.joinMeetingOptions, meeting, {
3157
+ resourceId: 'resourceId',
3158
+ moveToResource: true,
3159
+ });
2942
3160
  });
2943
3161
 
2944
3162
  it('should reconnectMedia after DX joins after moveTo', async () => {
2945
3163
  await meeting.moveTo('resourceId');
2946
3164
 
2947
-
2948
3165
  await meeting.locusInfo.emitScoped(
2949
3166
  {
2950
3167
  file: 'locus-info',
2951
- function: 'updateSelf'
3168
+ function: 'updateSelf',
2952
3169
  },
2953
3170
  'SELF_OBSERVING'
2954
3171
  );
@@ -2964,36 +3181,30 @@ describe('plugin-meetings', () => {
2964
3181
  assert.called(meeting.mediaProperties.setMediaDirection);
2965
3182
  assert.called(meeting.mediaProperties.unsetMediaTracks);
2966
3183
 
2967
- assert.calledWith(meeting.reconnectionManager.reconnectMedia,
2968
- {
2969
- mediaDirection: {
2970
- sendVideo: false,
2971
- receiveVideo: false,
2972
- sendAudio: false,
2973
- receiveAudio: false,
2974
- sendShare: false,
2975
- receiveShare: true
2976
- }
2977
- });
3184
+ assert.calledWith(meeting.reconnectionManager.reconnectMedia, {
3185
+ mediaDirection: {
3186
+ sendVideo: false,
3187
+ receiveVideo: false,
3188
+ sendAudio: false,
3189
+ receiveAudio: false,
3190
+ sendShare: false,
3191
+ receiveShare: true,
3192
+ },
3193
+ });
2978
3194
  });
2979
3195
 
2980
3196
  it('should throw an error if moveTo call fails', async () => {
2981
3197
  MeetingUtil.joinMeeting = sinon.stub().returns(Promise.reject());
2982
3198
  try {
2983
3199
  await meeting.moveTo('resourceId');
2984
- }
2985
- catch {
3200
+ } catch {
2986
3201
  assert.calledOnce(Metrics.sendBehavioralMetric);
2987
- assert.calledWith(
2988
- Metrics.sendBehavioralMetric,
2989
- BEHAVIORAL_METRICS.MOVE_TO_FAILURE,
2990
- {
2991
- correlation_id: meeting.correlationId,
2992
- locus_id: meeting.locusUrl.split('/').pop(),
2993
- reason: sinon.match.any,
2994
- stack: sinon.match.any
2995
- }
2996
- );
3202
+ assert.calledWith(Metrics.sendBehavioralMetric, BEHAVIORAL_METRICS.MOVE_TO_FAILURE, {
3203
+ correlation_id: meeting.correlationId,
3204
+ locus_id: meeting.locusUrl.split('/').pop(),
3205
+ reason: sinon.match.any,
3206
+ stack: sinon.match.any,
3207
+ });
2997
3208
  }
2998
3209
  Metrics.sendBehavioralMetric.reset();
2999
3210
  meeting.reconnectionManager.reconnectMedia = sinon.stub().returns(Promise.reject());
@@ -3003,23 +3214,18 @@ describe('plugin-meetings', () => {
3003
3214
  await meeting.locusInfo.emitScoped(
3004
3215
  {
3005
3216
  file: 'locus-info',
3006
- function: 'updateSelf'
3217
+ function: 'updateSelf',
3007
3218
  },
3008
3219
  'SELF_OBSERVING'
3009
3220
  );
3010
- }
3011
- catch {
3221
+ } catch {
3012
3222
  assert.calledOnce(Metrics.sendBehavioralMetric);
3013
- assert.calledWith(
3014
- Metrics.sendBehavioralMetric,
3015
- BEHAVIORAL_METRICS.MOVE_TO_FAILURE,
3016
- {
3017
- correlation_id: meeting.correlationId,
3018
- locus_id: meeting.locusUrl.split('/').pop(),
3019
- reason: sinon.match.any,
3020
- stack: sinon.match.any
3021
- }
3022
- );
3223
+ assert.calledWith(Metrics.sendBehavioralMetric, BEHAVIORAL_METRICS.MOVE_TO_FAILURE, {
3224
+ correlation_id: meeting.correlationId,
3225
+ locus_id: meeting.locusUrl.split('/').pop(),
3226
+ reason: sinon.match.any,
3227
+ stack: sinon.match.any,
3228
+ });
3023
3229
  }
3024
3230
  });
3025
3231
  });
@@ -3029,7 +3235,11 @@ describe('plugin-meetings', () => {
3029
3235
 
3030
3236
  beforeEach(() => {
3031
3237
  sandbox = sinon.createSandbox();
3032
- sandbox.stub(MeetingUtil, 'joinMeeting').returns(Promise.resolve(MeetingUtil.parseLocusJoin({body: {locus, mediaConnections: []}})));
3238
+ sandbox
3239
+ .stub(MeetingUtil, 'joinMeeting')
3240
+ .returns(
3241
+ Promise.resolve(MeetingUtil.parseLocusJoin({body: {locus, mediaConnections: []}}))
3242
+ );
3033
3243
  sandbox.stub(MeetingUtil, 'leaveMeeting').returns(Promise.resolve());
3034
3244
  });
3035
3245
 
@@ -3041,8 +3251,7 @@ describe('plugin-meetings', () => {
3041
3251
  it('should throw an error if resourceId not passed', async () => {
3042
3252
  try {
3043
3253
  await meeting.moveFrom();
3044
- }
3045
- catch (err) {
3254
+ } catch (err) {
3046
3255
  assert.instanceOf(err, ParameterError);
3047
3256
 
3048
3257
  assert.equal(err.sdkMessage, 'Cannot move call without a resourceId.');
@@ -3063,33 +3272,25 @@ describe('plugin-meetings', () => {
3063
3272
  assert.calledWith(MeetingUtil.leaveMeeting, meeting, {
3064
3273
  resourceId: 'resourceId',
3065
3274
  correlationId: meeting.correlationId,
3066
- moveMeeting: true
3275
+ moveMeeting: true,
3067
3276
  });
3068
3277
 
3069
3278
  assert.calledOnce(Metrics.sendBehavioralMetric);
3070
- assert.calledWith(
3071
- Metrics.sendBehavioralMetric,
3072
- BEHAVIORAL_METRICS.MOVE_FROM_SUCCESS,
3073
- );
3279
+ assert.calledWith(Metrics.sendBehavioralMetric, BEHAVIORAL_METRICS.MOVE_FROM_SUCCESS);
3074
3280
  });
3075
3281
 
3076
3282
  it('should throw an error if moveFrom call fails', async () => {
3077
3283
  MeetingUtil.joinMeeting = sinon.stub().returns(Promise.reject());
3078
3284
  try {
3079
3285
  await meeting.moveFrom('resourceId');
3080
- }
3081
- catch {
3286
+ } catch {
3082
3287
  assert.calledOnce(Metrics.sendBehavioralMetric);
3083
- assert.calledWith(
3084
- Metrics.sendBehavioralMetric,
3085
- BEHAVIORAL_METRICS.MOVE_FROM_FAILURE,
3086
- {
3087
- correlation_id: meeting.correlationId,
3088
- locus_id: meeting.locusUrl.split('/').pop(),
3089
- reason: sinon.match.any,
3090
- stack: sinon.match.any
3091
- }
3092
- );
3288
+ assert.calledWith(Metrics.sendBehavioralMetric, BEHAVIORAL_METRICS.MOVE_FROM_FAILURE, {
3289
+ correlation_id: meeting.correlationId,
3290
+ locus_id: meeting.locusUrl.split('/').pop(),
3291
+ reason: sinon.match.any,
3292
+ stack: sinon.match.any,
3293
+ });
3093
3294
  }
3094
3295
  });
3095
3296
  });
@@ -3158,7 +3359,9 @@ describe('plugin-meetings', () => {
3158
3359
  meeting.config.reconnection.enabled = true;
3159
3360
  meeting.currentMediaStatus = {audio: true};
3160
3361
  meeting.reconnectionManager = new ReconnectionManager(meeting);
3161
- meeting.reconnectionManager.reconnect = sinon.stub().returns(Promise.reject(new Error()));
3362
+ meeting.reconnectionManager.reconnect = sinon
3363
+ .stub()
3364
+ .returns(Promise.reject(new Error()));
3162
3365
  meeting.reconnectionManager.reset = sinon.stub().returns(true);
3163
3366
  });
3164
3367
 
@@ -3183,7 +3386,7 @@ describe('plugin-meetings', () => {
3183
3386
  correlation_id: meeting.correlationId,
3184
3387
  locus_id: meeting.locusUrl.split('/').pop(),
3185
3388
  reason: sinon.match.any,
3186
- stack: sinon.match.any
3389
+ stack: sinon.match.any,
3187
3390
  }
3188
3391
  );
3189
3392
  });
@@ -3195,7 +3398,7 @@ describe('plugin-meetings', () => {
3195
3398
  sinon.match.instanceOf(Meeting),
3196
3399
  {file: 'meeting/index', function: 'reconnect'},
3197
3400
  EVENTS.REQUEST_UPLOAD_LOGS,
3198
- sinon.match.instanceOf(Meeting),
3401
+ sinon.match.instanceOf(Meeting)
3199
3402
  );
3200
3403
  });
3201
3404
 
@@ -3279,8 +3482,8 @@ describe('plugin-meetings', () => {
3279
3482
  height: 1980,
3280
3483
  width: 1080,
3281
3484
  displaySurface: true,
3282
- cursor: true
3283
- })
3485
+ cursor: true,
3486
+ }),
3284
3487
  };
3285
3488
  const getVideoTracks = sinon.stub().returns([track]);
3286
3489
 
@@ -3312,21 +3515,36 @@ describe('plugin-meetings', () => {
3312
3515
  meeting.setRemoteStream(pc);
3313
3516
  pc.ontrack({track: 'track', transceiver: {mid: '0'}});
3314
3517
  assert.equal(TriggerProxy.trigger.getCall(1).args[2], 'media:ready');
3315
- assert.deepEqual(TriggerProxy.trigger.getCall(1).args[3], {type: 'remoteAudio', stream: true});
3518
+ assert.deepEqual(TriggerProxy.trigger.getCall(1).args[3], {
3519
+ type: 'remoteAudio',
3520
+ stream: true,
3521
+ });
3316
3522
 
3317
3523
  pc.ontrack({track: 'track', transceiver: {mid: '1'}});
3318
3524
  assert.equal(TriggerProxy.trigger.getCall(2).args[2], 'media:ready');
3319
- assert.deepEqual(TriggerProxy.trigger.getCall(2).args[3], {type: 'remoteVideo', stream: true});
3525
+ assert.deepEqual(TriggerProxy.trigger.getCall(2).args[3], {
3526
+ type: 'remoteVideo',
3527
+ stream: true,
3528
+ });
3320
3529
 
3321
3530
  pc.ontrack({transceiver: {mid: '2'}, track: 'track'});
3322
3531
  assert.equal(TriggerProxy.trigger.getCall(3).args[2], 'media:ready');
3323
- assert.deepEqual(TriggerProxy.trigger.getCall(3).args[3], {type: 'remoteShare', stream: true});
3324
-
3532
+ assert.deepEqual(TriggerProxy.trigger.getCall(3).args[3], {
3533
+ type: 'remoteShare',
3534
+ stream: true,
3535
+ });
3325
3536
 
3326
3537
  // special case for safari
3327
- pc.ontrack({target: {audioTransceiver: {receiver: {track: {id: 'trackId'}}}}, transceiver: {}, track: {id: 'trackId'}});
3538
+ pc.ontrack({
3539
+ target: {audioTransceiver: {receiver: {track: {id: 'trackId'}}}},
3540
+ transceiver: {},
3541
+ track: {id: 'trackId'},
3542
+ });
3328
3543
  assert.equal(TriggerProxy.trigger.getCall(1).args[2], 'media:ready');
3329
- assert.deepEqual(TriggerProxy.trigger.getCall(1).args[3], {type: 'remoteAudio', stream: true});
3544
+ assert.deepEqual(TriggerProxy.trigger.getCall(1).args[3], {
3545
+ type: 'remoteAudio',
3546
+ stream: true,
3547
+ });
3330
3548
  });
3331
3549
  });
3332
3550
  describe('#setUpLocusInfoSelfListener', () => {
@@ -3366,11 +3584,12 @@ describe('plugin-meetings', () => {
3366
3584
 
3367
3585
  meeting.members = {locusUrlUpdate: sinon.stub().returns(Promise.resolve(test1))};
3368
3586
 
3369
- meeting.locusInfo.emit({function: 'test', file: 'test'}, 'LOCUS_INFO_UPDATE_URL', newLocusUrl);
3370
- assert.calledWith(
3371
- meeting.members.locusUrlUpdate,
3587
+ meeting.locusInfo.emit(
3588
+ {function: 'test', file: 'test'},
3589
+ 'LOCUS_INFO_UPDATE_URL',
3372
3590
  newLocusUrl
3373
3591
  );
3592
+ assert.calledWith(meeting.members.locusUrlUpdate, newLocusUrl);
3374
3593
  assert.equal(meeting.locusUrl, newLocusUrl);
3375
3594
  assert(meeting.locusId, '12345');
3376
3595
  done();
@@ -3379,7 +3598,11 @@ describe('plugin-meetings', () => {
3379
3598
  describe('#setUpLocusInfoMediaInactiveListener', () => {
3380
3599
  it('listens to disconnect due to un activity ', (done) => {
3381
3600
  TriggerProxy.trigger.reset();
3382
- meeting.locusInfo.emit({function: 'test', file: 'test'}, EVENTS.DISCONNECT_DUE_TO_INACTIVITY, {reason: 'inactive'});
3601
+ meeting.locusInfo.emit(
3602
+ {function: 'test', file: 'test'},
3603
+ EVENTS.DISCONNECT_DUE_TO_INACTIVITY,
3604
+ {reason: 'inactive'}
3605
+ );
3383
3606
  assert.calledTwice(TriggerProxy.trigger);
3384
3607
 
3385
3608
  assert.calledWith(
@@ -3406,7 +3629,11 @@ describe('plugin-meetings', () => {
3406
3629
  sinon.stub(meeting, 'reconnect');
3407
3630
 
3408
3631
  meeting.config.reconnection.autoRejoin = true;
3409
- meeting.locusInfo.emit({function: 'test', file: 'test'}, EVENTS.DISCONNECT_DUE_TO_INACTIVITY, {reason: 'inactive'});
3632
+ meeting.locusInfo.emit(
3633
+ {function: 'test', file: 'test'},
3634
+ EVENTS.DISCONNECT_DUE_TO_INACTIVITY,
3635
+ {reason: 'inactive'}
3636
+ );
3410
3637
  assert.calledOnce(TriggerProxy.trigger);
3411
3638
 
3412
3639
  assert.calledWith(
@@ -3431,7 +3658,10 @@ describe('plugin-meetings', () => {
3431
3658
  sinon.stub(meeting.reconnectionManager, 'cleanUp');
3432
3659
  sinon.spy(MeetingUtil, 'cleanUp');
3433
3660
 
3434
- meeting.locusInfo.emit({function: 'test', file: 'test'}, EVENTS.DESTROY_MEETING, {shouldLeave: false, reason: 'ended'});
3661
+ meeting.locusInfo.emit({function: 'test', file: 'test'}, EVENTS.DESTROY_MEETING, {
3662
+ shouldLeave: false,
3663
+ reason: 'ended',
3664
+ });
3435
3665
  assert.calledOnce(TriggerProxy.trigger);
3436
3666
  assert.calledOnce(MeetingUtil.cleanUp);
3437
3667
  assert.calledWith(
@@ -3439,12 +3669,12 @@ describe('plugin-meetings', () => {
3439
3669
  meeting,
3440
3670
  {
3441
3671
  file: 'meeting/index',
3442
- function: 'setUpLocusInfoMeetingListener'
3672
+ function: 'setUpLocusInfoMeetingListener',
3443
3673
  },
3444
3674
  EVENTS.DESTROY_MEETING,
3445
3675
  {
3446
3676
  reason: 'ended',
3447
- meetingId: meeting.id
3677
+ meetingId: meeting.id,
3448
3678
  }
3449
3679
  );
3450
3680
  done();
@@ -3470,7 +3700,9 @@ describe('plugin-meetings', () => {
3470
3700
  });
3471
3701
  beforeEach(() => {
3472
3702
  meeting.selfId = 'some self id';
3473
- meeting.locusInfo.mediaShares = [{name: 'content', url: url1, floor: {beneficiary: {id: meeting.selfId}}}];
3703
+ meeting.locusInfo.mediaShares = [
3704
+ {name: 'content', url: url1, floor: {beneficiary: {id: meeting.selfId}}},
3705
+ ];
3474
3706
  meeting.locusInfo.self = {url: url2};
3475
3707
  meeting.mediaProperties = {mediaDirection: {sendShare: true}};
3476
3708
  meeting.meetingRequest.changeMeetingFloor = sinon.stub().returns(Promise.resolve());
@@ -3573,8 +3805,8 @@ describe('plugin-meetings', () => {
3573
3805
  permissionToken: 'abc',
3574
3806
  sipMeetingUri: test1,
3575
3807
  sipUrl: test1,
3576
- owner: test2
3577
- }
3808
+ owner: test2,
3809
+ },
3578
3810
  };
3579
3811
 
3580
3812
  meeting.parseMeetingInfo(FAKE_MEETING_INFO);
@@ -3585,7 +3817,7 @@ describe('plugin-meetings', () => {
3585
3817
  meetingNumber: '12345',
3586
3818
  meetingJoinUrl: url2,
3587
3819
  owner: test2,
3588
- permissionToken: 'abc'
3820
+ permissionToken: 'abc',
3589
3821
  };
3590
3822
 
3591
3823
  checkParseMeetingInfo(expectedInfoToParse);
@@ -3599,8 +3831,8 @@ describe('plugin-meetings', () => {
3599
3831
  info: {
3600
3832
  webExMeetingId: 'locusMeetingId',
3601
3833
  sipUri: 'locusSipUri',
3602
- owner: 'locusOwner'
3603
- }
3834
+ owner: 'locusOwner',
3835
+ },
3604
3836
  };
3605
3837
  const FAKE_MEETING_INFO = {
3606
3838
  body: {
@@ -3611,8 +3843,8 @@ describe('plugin-meetings', () => {
3611
3843
  permissionToken: 'abc',
3612
3844
  sipMeetingUri: test1,
3613
3845
  sipUrl: test1,
3614
- owner: test2
3615
- }
3846
+ owner: test2,
3847
+ },
3616
3848
  };
3617
3849
 
3618
3850
  meeting.parseMeetingInfo(FAKE_MEETING_INFO, FAKE_LOCUS_MEETING);
@@ -3623,7 +3855,7 @@ describe('plugin-meetings', () => {
3623
3855
  meetingNumber: 'locusMeetingId',
3624
3856
  meetingJoinUrl: url2,
3625
3857
  owner: 'locusOwner',
3626
- permissionToken: 'abc'
3858
+ permissionToken: 'abc',
3627
3859
  };
3628
3860
 
3629
3861
  checkParseMeetingInfo(expectedInfoToParse);
@@ -3640,8 +3872,8 @@ describe('plugin-meetings', () => {
3640
3872
  permissionToken: 'abc',
3641
3873
  sipMeetingUri: test1,
3642
3874
  sipUrl: test1,
3643
- owner: test2
3644
- }
3875
+ owner: test2,
3876
+ },
3645
3877
  };
3646
3878
 
3647
3879
  meeting.parseMeetingInfo(FAKE_MEETING_INFO);
@@ -3652,7 +3884,7 @@ describe('plugin-meetings', () => {
3652
3884
  meetingNumber: '12345',
3653
3885
  meetingJoinUrl: url2,
3654
3886
  owner: test2,
3655
- permissionToken: 'abc'
3887
+ permissionToken: 'abc',
3656
3888
  };
3657
3889
 
3658
3890
  checkParseMeetingInfo(expectedInfoToParse);
@@ -3670,8 +3902,8 @@ describe('plugin-meetings', () => {
3670
3902
  permissionToken: 'abc',
3671
3903
  sipMeetingUri: test1,
3672
3904
  sipUrl: test1,
3673
- owner: test2
3674
- }
3905
+ owner: test2,
3906
+ },
3675
3907
  };
3676
3908
 
3677
3909
  meeting.parseMeetingInfo(FAKE_MEETING_INFO, FAKE_STRING_DESTINATION);
@@ -3682,7 +3914,7 @@ describe('plugin-meetings', () => {
3682
3914
  meetingNumber: '12345',
3683
3915
  meetingJoinUrl: url2,
3684
3916
  owner: test2,
3685
- permissionToken: 'abc'
3917
+ permissionToken: 'abc',
3686
3918
  };
3687
3919
 
3688
3920
  checkParseMeetingInfo(expectedInfoToParse);
@@ -3698,7 +3930,11 @@ describe('plugin-meetings', () => {
3698
3930
  meeting.type = 'CALL';
3699
3931
  meeting.parseLocus({url: url1, participants: [{id: uuid1}], self: {id: uuid2}});
3700
3932
  assert.calledOnce(meeting.setLocus);
3701
- assert.calledWith(meeting.setLocus, {url: url1, participants: [{id: uuid1}], self: {id: uuid2}});
3933
+ assert.calledWith(meeting.setLocus, {
3934
+ url: url1,
3935
+ participants: [{id: uuid1}],
3936
+ self: {id: uuid2},
3937
+ });
3702
3938
  assert.calledOnce(MeetingUtil.getLocusPartner);
3703
3939
  assert.calledWith(MeetingUtil.getLocusPartner, [{id: uuid1}], {id: uuid2});
3704
3940
  assert.deepEqual(meeting.partner, {person: {sipUrl: uuid3}});
@@ -3754,7 +3990,7 @@ describe('plugin-meetings', () => {
3754
3990
  meeting,
3755
3991
  {
3756
3992
  file: 'meeting/index',
3757
- function: 'setUpLocusInfoAssignHostListener'
3993
+ function: 'setUpLocusInfoAssignHostListener',
3758
3994
  },
3759
3995
  'meeting:actionsUpdate',
3760
3996
  meeting.inMeetingActions.get()
@@ -3794,7 +4030,10 @@ describe('plugin-meetings', () => {
3794
4030
  inMeetingActionsSetSpy = sinon.spy(meeting.inMeetingActions, 'set');
3795
4031
  canUserRaiseHandSpy = sinon.spy(MeetingUtil, 'canUserRaiseHand');
3796
4032
  canUserLowerAllHandsSpy = sinon.spy(MeetingUtil, 'canUserLowerAllHands');
3797
- bothLeaveAndEndMeetingAvailableSpy = sinon.spy(MeetingUtil, 'bothLeaveAndEndMeetingAvailable');
4033
+ bothLeaveAndEndMeetingAvailableSpy = sinon.spy(
4034
+ MeetingUtil,
4035
+ 'bothLeaveAndEndMeetingAvailable'
4036
+ );
3798
4037
  canUserLowerSomeoneElsesHandSpy = sinon.spy(MeetingUtil, 'canUserLowerSomeoneElsesHand');
3799
4038
  waitingForOthersToJoinSpy = sinon.spy(MeetingUtil, 'waitingForOthersToJoin');
3800
4039
  });
@@ -3805,7 +4044,6 @@ describe('plugin-meetings', () => {
3805
4044
  waitingForOthersToJoinSpy.restore();
3806
4045
  });
3807
4046
 
3808
-
3809
4047
  it('registers the correct MEETING_INFO_UPDATED event', () => {
3810
4048
  meeting.setUpLocusInfoMeetingInfoListener();
3811
4049
 
@@ -3818,8 +4056,8 @@ describe('plugin-meetings', () => {
3818
4056
 
3819
4057
  const payload = {
3820
4058
  info: {
3821
- userDisplayHints: ['LOCK_CONTROL_UNLOCK']
3822
- }
4059
+ userDisplayHints: ['LOCK_CONTROL_UNLOCK'],
4060
+ },
3823
4061
  };
3824
4062
 
3825
4063
  callback(payload);
@@ -3841,7 +4079,7 @@ describe('plugin-meetings', () => {
3841
4079
  meeting,
3842
4080
  {
3843
4081
  file: 'meeting/index',
3844
- function: 'setUpLocusInfoMeetingInfoListener'
4082
+ function: 'setUpLocusInfoMeetingInfoListener',
3845
4083
  },
3846
4084
  'meeting:actionsUpdate',
3847
4085
  meeting.inMeetingActions.get()
@@ -3866,7 +4104,7 @@ describe('plugin-meetings', () => {
3866
4104
  locusId: uuid1,
3867
4105
  selfId: uuid2,
3868
4106
  mediaId: uuid3,
3869
- host: {id: uuid4}
4107
+ host: {id: uuid4},
3870
4108
  });
3871
4109
  assert.calledOnce(meeting.locusInfo.initialSetup);
3872
4110
  assert.calledWith(meeting.locusInfo.initialSetup, {
@@ -3875,7 +4113,7 @@ describe('plugin-meetings', () => {
3875
4113
  locusId: uuid1,
3876
4114
  selfId: uuid2,
3877
4115
  mediaId: uuid3,
3878
- host: {id: uuid4}
4116
+ host: {id: uuid4},
3879
4117
  });
3880
4118
  assert.equal(meeting.mediaConnections, test1);
3881
4119
  assert.equal(meeting.locusUrl, url1);
@@ -3924,7 +4162,7 @@ describe('plugin-meetings', () => {
3924
4162
  });
3925
4163
  it('should send the whiteboard share', async () => {
3926
4164
  const whiteboardShare = meeting.startWhiteboardShare({
3927
- channelUrl: url2
4165
+ channelUrl: url2,
3928
4166
  });
3929
4167
 
3930
4168
  assert.exists(whiteboardShare.then);
@@ -3964,18 +4202,35 @@ describe('plugin-meetings', () => {
3964
4202
  const USER_IDS = {
3965
4203
  ME: '9528d952-e4de-46cf-8157-fd4823b98377',
3966
4204
  REMOTE_A: '5be7e7b0-b304-48da-8083-83bd72b5300d',
3967
- REMOTE_B: 'd4d102a1-17ce-4e17-9b08-bded3de467e4'
4205
+ REMOTE_B: 'd4d102a1-17ce-4e17-9b08-bded3de467e4',
3968
4206
  };
3969
4207
 
3970
4208
  const RESOURCE_URLS = {
3971
- WHITEBOARD_A: 'https://board-a.wbx2.com/board/api/v1/channels/49cfb550-5517-11eb-a2af-1b9e4bc3da13',
3972
- WHITEBOARD_B: 'https://board-a.wbx2.com/board/api/v1/channels/977a7330-54f4-11eb-b1ef-91f5eefc7bf3'
4209
+ WHITEBOARD_A:
4210
+ 'https://board-a.wbx2.com/board/api/v1/channels/49cfb550-5517-11eb-a2af-1b9e4bc3da13',
4211
+ WHITEBOARD_B:
4212
+ 'https://board-a.wbx2.com/board/api/v1/channels/977a7330-54f4-11eb-b1ef-91f5eefc7bf3',
3973
4213
  };
3974
4214
 
3975
- const generateContent = (beneficiaryId = null, disposition = null) => ({beneficiaryId, disposition});
3976
- const generateWhiteboard = (beneficiaryId = null, disposition = null, resourceUrl = null) => ({beneficiaryId, disposition, resourceUrl});
3977
-
3978
- const generateData = (payload, isGranting, isContent, beneficiaryId, resourceUrl, isAccepting, otherBeneficiaryId) => {
4215
+ const generateContent = (beneficiaryId = null, disposition = null) => ({
4216
+ beneficiaryId,
4217
+ disposition,
4218
+ });
4219
+ const generateWhiteboard = (
4220
+ beneficiaryId = null,
4221
+ disposition = null,
4222
+ resourceUrl = null
4223
+ ) => ({beneficiaryId, disposition, resourceUrl});
4224
+
4225
+ const generateData = (
4226
+ payload,
4227
+ isGranting,
4228
+ isContent,
4229
+ beneficiaryId,
4230
+ resourceUrl,
4231
+ isAccepting,
4232
+ otherBeneficiaryId
4233
+ ) => {
3979
4234
  const newPayload = cloneDeep(payload);
3980
4235
 
3981
4236
  newPayload.previous = cloneDeep(payload.current);
@@ -3986,15 +4241,15 @@ describe('plugin-meetings', () => {
3986
4241
  eventName: EVENT_TRIGGERS.MEMBERS_CONTENT_UPDATE,
3987
4242
  eventPayload: {
3988
4243
  activeSharingId: null,
3989
- endedSharingId: null
3990
- }
3991
- }
4244
+ endedSharingId: null,
4245
+ },
4246
+ },
3992
4247
  };
3993
4248
 
3994
4249
  let shareStatus = null;
3995
4250
  const activeSharingId = {
3996
4251
  whiteboard: null,
3997
- content: null
4252
+ content: null,
3998
4253
  };
3999
4254
 
4000
4255
  if (isGranting) {
@@ -4004,68 +4259,72 @@ describe('plugin-meetings', () => {
4004
4259
 
4005
4260
  if (isEqual(newPayload.current, newPayload.previous)) {
4006
4261
  eventTrigger.member = null;
4007
- }
4008
- else {
4262
+ } else {
4009
4263
  if (newPayload.current.whiteboard.beneficiaryId) {
4010
4264
  if (newPayload.current.whiteboard.disposition === FLOOR_ACTION.GRANTED) {
4011
4265
  newPayload.current.whiteboard.disposition = FLOOR_ACTION.RELEASED;
4012
4266
  eventTrigger.share.push({
4013
4267
  eventName: EVENT_TRIGGERS.MEETING_STOPPED_SHARING_WHITEBOARD,
4014
- functionName: 'stopWhiteboardShare'
4268
+ functionName: 'stopWhiteboardShare',
4015
4269
  });
4016
- eventTrigger.member.eventPayload.endedSharingId = newPayload.current.whiteboard.beneficiaryId;
4270
+ eventTrigger.member.eventPayload.endedSharingId =
4271
+ newPayload.current.whiteboard.beneficiaryId;
4017
4272
  }
4018
4273
  }
4019
4274
 
4020
4275
  if (newPayload.previous.content.beneficiaryId) {
4021
- if (newPayload.previous.content.beneficiaryId !== newPayload.current.content.beneficiaryId) {
4276
+ if (
4277
+ newPayload.previous.content.beneficiaryId !==
4278
+ newPayload.current.content.beneficiaryId
4279
+ ) {
4022
4280
  if (newPayload.previous.content.beneficiaryId === USER_IDS.ME) {
4023
4281
  eventTrigger.share.push({
4024
4282
  eventName: EVENT_TRIGGERS.MEETING_STOPPED_SHARING_LOCAL,
4025
- functionName: 'localShare'
4283
+ functionName: 'stopFloorRequest',
4026
4284
  });
4027
- }
4028
- else if (newPayload.current.content.beneficiaryId === USER_IDS.ME) {
4285
+ } else if (newPayload.current.content.beneficiaryId === USER_IDS.ME) {
4029
4286
  eventTrigger.share.push({
4030
4287
  eventName: EVENT_TRIGGERS.MEETING_STOPPED_SHARING_REMOTE,
4031
- functionName: 'remoteShare'
4288
+ functionName: 'remoteShare',
4032
4289
  });
4033
4290
  }
4034
- eventTrigger.member.eventPayload.endedSharingId = newPayload.previous.content.beneficiaryId;
4291
+ eventTrigger.member.eventPayload.endedSharingId =
4292
+ newPayload.previous.content.beneficiaryId;
4035
4293
  }
4036
4294
  }
4037
4295
 
4038
4296
  if (isAccepting) {
4039
4297
  eventTrigger.share.push({
4040
4298
  eventName: EVENT_TRIGGERS.MEETING_STOPPED_SHARING_WHITEBOARD,
4041
- functionName: 'stopWhiteboardShare'
4299
+ functionName: 'stopWhiteboardShare',
4042
4300
  });
4043
4301
  }
4044
4302
 
4045
4303
  if (beneficiaryId === USER_IDS.ME) {
4046
4304
  eventTrigger.share.push({
4047
4305
  eventName: EVENT_TRIGGERS.MEETING_STARTED_SHARING_LOCAL,
4048
- functionName: 'share'
4306
+ functionName: 'share',
4049
4307
  });
4050
- }
4051
- else {
4308
+ } else {
4052
4309
  eventTrigger.share.push({
4053
4310
  eventName: EVENT_TRIGGERS.MEETING_STARTED_SHARING_REMOTE,
4054
4311
  functionName: 'remoteShare',
4055
- eventPayload: {memberId: beneficiaryId}
4312
+ eventPayload: {memberId: beneficiaryId},
4056
4313
  });
4057
4314
  }
4058
4315
  }
4059
4316
 
4060
4317
  if (beneficiaryId === USER_IDS.ME) {
4061
4318
  shareStatus = SHARE_STATUS.LOCAL_SHARE_ACTIVE;
4062
- }
4063
- else {
4319
+ } else {
4064
4320
  shareStatus = SHARE_STATUS.REMOTE_SHARE_ACTIVE;
4065
4321
  }
4066
- }
4067
- else {
4068
- newPayload.current.whiteboard = generateWhiteboard(beneficiaryId, FLOOR_ACTION.GRANTED, resourceUrl);
4322
+ } else {
4323
+ newPayload.current.whiteboard = generateWhiteboard(
4324
+ beneficiaryId,
4325
+ FLOOR_ACTION.GRANTED,
4326
+ resourceUrl
4327
+ );
4069
4328
 
4070
4329
  if (newPayload.current.content.beneficiaryId) {
4071
4330
  if (newPayload.current.content.disposition === FLOOR_ACTION.GRANTED) {
@@ -4073,41 +4332,48 @@ describe('plugin-meetings', () => {
4073
4332
  if (newPayload.current.content.beneficiaryId === USER_IDS.ME) {
4074
4333
  eventTrigger.share.push({
4075
4334
  eventName: EVENT_TRIGGERS.MEETING_STOPPED_SHARING_LOCAL,
4076
- functionName: 'localShare'
4335
+ functionName: 'stopFloorRequest',
4077
4336
  });
4078
- }
4079
- else {
4337
+ } else {
4080
4338
  eventTrigger.share.push({
4081
4339
  eventName: EVENT_TRIGGERS.MEETING_STOPPED_SHARING_REMOTE,
4082
- functionName: 'remoteShare'
4340
+ functionName: 'remoteShare',
4083
4341
  });
4084
4342
  }
4085
4343
 
4086
- eventTrigger.member.eventPayload.endedSharingId = newPayload.current.content.beneficiaryId;
4344
+ eventTrigger.member.eventPayload.endedSharingId =
4345
+ newPayload.current.content.beneficiaryId;
4087
4346
  }
4088
4347
  }
4089
4348
 
4090
4349
  if (newPayload.previous.content.beneficiaryId) {
4091
- if (newPayload.previous.content.beneficiaryId !== newPayload.current.content.beneficiaryId) {
4350
+ if (
4351
+ newPayload.previous.content.beneficiaryId !==
4352
+ newPayload.current.content.beneficiaryId
4353
+ ) {
4092
4354
  if (newPayload.previous.content.beneficiaryId === USER_IDS.ME) {
4093
4355
  eventTrigger.share.push({
4094
4356
  eventName: EVENT_TRIGGERS.MEETING_STOPPED_SHARING_LOCAL,
4095
- functionName: 'localShare'
4357
+ functionName: 'stopFloorRequest',
4096
4358
  });
4097
- }
4098
- else if (newPayload.current.content.beneficiaryId === USER_IDS.ME) {
4359
+ } else if (newPayload.current.content.beneficiaryId === USER_IDS.ME) {
4099
4360
  eventTrigger.share.push({
4100
4361
  eventName: EVENT_TRIGGERS.MEETING_STOPPED_SHARING_REMOTE,
4101
- functionName: 'remoteShare'
4362
+ functionName: 'remoteShare',
4102
4363
  });
4103
4364
  }
4104
- eventTrigger.member.eventPayload.endedSharingId = newPayload.previous.content.beneficiaryId;
4365
+ eventTrigger.member.eventPayload.endedSharingId =
4366
+ newPayload.previous.content.beneficiaryId;
4105
4367
  }
4106
4368
  }
4107
4369
 
4108
4370
  if (newPayload.previous.whiteboard.beneficiaryId) {
4109
- if (newPayload.previous.whiteboard.beneficiaryId !== newPayload.current.whiteboard.beneficiaryId) {
4110
- eventTrigger.member.eventPayload.endedSharingId = newPayload.previous.whiteboard.beneficiaryId;
4371
+ if (
4372
+ newPayload.previous.whiteboard.beneficiaryId !==
4373
+ newPayload.current.whiteboard.beneficiaryId
4374
+ ) {
4375
+ eventTrigger.member.eventPayload.endedSharingId =
4376
+ newPayload.previous.whiteboard.beneficiaryId;
4111
4377
  }
4112
4378
  }
4113
4379
 
@@ -4116,7 +4382,7 @@ describe('plugin-meetings', () => {
4116
4382
  eventTrigger.share.push({
4117
4383
  eventName: EVENT_TRIGGERS.MEETING_STARTED_SHARING_WHITEBOARD,
4118
4384
  functionName: 'startWhiteboardShare',
4119
- eventPayload: {resourceUrl, memberId: beneficiaryId}
4385
+ eventPayload: {resourceUrl, memberId: beneficiaryId},
4120
4386
  });
4121
4387
 
4122
4388
  shareStatus = SHARE_STATUS.WHITEBOARD_SHARE_ACTIVE;
@@ -4125,8 +4391,7 @@ describe('plugin-meetings', () => {
4125
4391
  if (eventTrigger.member) {
4126
4392
  eventTrigger.member.eventPayload.activeSharingId = beneficiaryId;
4127
4393
  }
4128
- }
4129
- else {
4394
+ } else {
4130
4395
  eventTrigger.member.eventPayload.endedSharingId = beneficiaryId;
4131
4396
 
4132
4397
  if (isContent) {
@@ -4135,19 +4400,17 @@ describe('plugin-meetings', () => {
4135
4400
  if (beneficiaryId === USER_IDS.ME) {
4136
4401
  eventTrigger.share.push({
4137
4402
  eventName: EVENT_TRIGGERS.MEETING_STOPPED_SHARING_LOCAL,
4138
- functionName: 'localShare'
4403
+ functionName: 'stopFloorRequest',
4139
4404
  });
4140
- }
4141
- else {
4405
+ } else {
4142
4406
  eventTrigger.share.push({
4143
4407
  eventName: EVENT_TRIGGERS.MEETING_STOPPED_SHARING_REMOTE,
4144
- functionName: 'remoteShare'
4408
+ functionName: 'remoteShare',
4145
4409
  });
4146
4410
  }
4147
4411
 
4148
4412
  shareStatus = SHARE_STATUS.NO_SHARE;
4149
- }
4150
- else {
4413
+ } else {
4151
4414
  newPayload.current.whiteboard.disposition = FLOOR_ACTION.RELEASED;
4152
4415
 
4153
4416
  if (isAccepting) {
@@ -4157,15 +4420,14 @@ describe('plugin-meetings', () => {
4157
4420
  eventTrigger.share.push({
4158
4421
  eventName: EVENT_TRIGGERS.MEETING_STARTED_SHARING_WHITEBOARD,
4159
4422
  functionName: 'startWhiteboardShare',
4160
- eventPayload: {resourceUrl, memberId: beneficiaryId}
4423
+ eventPayload: {resourceUrl, memberId: beneficiaryId},
4161
4424
  });
4162
4425
 
4163
4426
  shareStatus = SHARE_STATUS.WHITEBOARD_SHARE_ACTIVE;
4164
- }
4165
- else {
4427
+ } else {
4166
4428
  eventTrigger.share.push({
4167
4429
  eventName: EVENT_TRIGGERS.MEETING_STOPPED_SHARING_WHITEBOARD,
4168
- functionName: 'stopWhiteboardShare'
4430
+ functionName: 'stopWhiteboardShare',
4169
4431
  });
4170
4432
 
4171
4433
  shareStatus = SHARE_STATUS.NO_SHARE;
@@ -4174,22 +4436,24 @@ describe('plugin-meetings', () => {
4174
4436
  }
4175
4437
 
4176
4438
  return {
4177
- payload: newPayload, eventTrigger, shareStatus, activeSharingId
4439
+ payload: newPayload,
4440
+ eventTrigger,
4441
+ shareStatus,
4442
+ activeSharingId,
4178
4443
  };
4179
4444
  };
4180
4445
 
4181
4446
  const blankPayload = {
4182
4447
  previous: {
4183
4448
  content: generateContent(),
4184
- whiteboard: generateWhiteboard()
4449
+ whiteboard: generateWhiteboard(),
4185
4450
  },
4186
4451
  current: {
4187
4452
  content: generateContent(),
4188
- whiteboard: generateWhiteboard()
4189
- }
4453
+ whiteboard: generateWhiteboard(),
4454
+ },
4190
4455
  };
4191
4456
 
4192
-
4193
4457
  const payloadTestHelper = (data) => {
4194
4458
  assert.equal(meeting.shareStatus, SHARE_STATUS.NO_SHARE);
4195
4459
 
@@ -4197,23 +4461,33 @@ describe('plugin-meetings', () => {
4197
4461
  let callCounter = 1;
4198
4462
 
4199
4463
  data.forEach((d, index) => {
4200
- meeting.locusInfo.emit({function: 'test', file: 'test'}, EVENTS.LOCUS_INFO_UPDATE_MEDIA_SHARES, d.payload);
4464
+ meeting.locusInfo.emit(
4465
+ {function: 'test', file: 'test'},
4466
+ EVENTS.LOCUS_INFO_UPDATE_MEDIA_SHARES,
4467
+ d.payload
4468
+ );
4201
4469
 
4202
4470
  assert.equal(meeting.shareStatus, data[index].shareStatus);
4203
4471
 
4204
- callCounter += data[index].eventTrigger.share.length + (data[index].eventTrigger.member ? 1 : 0);
4472
+ callCounter +=
4473
+ data[index].eventTrigger.share.length + (data[index].eventTrigger.member ? 1 : 0);
4205
4474
 
4206
4475
  assert.callCount(TriggerProxy.trigger, callCounter);
4207
4476
 
4208
- assert.equal(meeting.members.mediaShareWhiteboardId, data[index].activeSharingId.whiteboard);
4209
- assert.equal(meeting.members.mediaShareContentId, data[index].activeSharingId.content);
4477
+ assert.equal(
4478
+ meeting.members.mediaShareWhiteboardId,
4479
+ data[index].activeSharingId.whiteboard
4480
+ );
4481
+ assert.equal(
4482
+ meeting.members.mediaShareContentId,
4483
+ data[index].activeSharingId.content
4484
+ );
4210
4485
  });
4211
4486
 
4212
4487
  assert.callCount(TriggerProxy.trigger, callCounter);
4213
4488
 
4214
4489
  // Start with 1 to ignore members:update trigger
4215
4490
 
4216
-
4217
4491
  let i = 1;
4218
4492
  let offset = 2;
4219
4493
 
@@ -4225,21 +4499,24 @@ describe('plugin-meetings', () => {
4225
4499
  for (let idx = 0; idx < share.length; idx += 1) {
4226
4500
  const shareCallArgs = TriggerProxy.trigger.getCall(i + idx).args;
4227
4501
  const {functionName, eventName, eventPayload} = share[idx];
4228
- const fileName = functionName === 'remoteShare' ? 'meetings/index' : 'meeting/index';
4502
+ const fileName =
4503
+ functionName === 'remoteShare' ? 'meetings/index' : 'meeting/index';
4229
4504
 
4230
4505
  assert.deepEqual(shareCallArgs[1], {
4231
4506
  file: fileName,
4232
- function: functionName
4507
+ function: functionName,
4233
4508
  });
4234
4509
 
4235
-
4236
4510
  assert.equal(shareCallArgs[2], eventName);
4237
4511
 
4238
4512
  if (functionName === 'startWhiteboardShare') {
4239
4513
  assert.deepEqual(shareCallArgs[3], eventPayload);
4240
4514
  }
4241
4515
 
4242
- if (functionName === 'remoteShare' && eventName === EVENT_TRIGGERS.MEETING_STARTED_SHARING_REMOTE) {
4516
+ if (
4517
+ functionName === 'remoteShare' &&
4518
+ eventName === EVENT_TRIGGERS.MEETING_STARTED_SHARING_REMOTE
4519
+ ) {
4243
4520
  assert.deepEqual(shareCallArgs[3], eventPayload);
4244
4521
  }
4245
4522
  }
@@ -4250,7 +4527,7 @@ describe('plugin-meetings', () => {
4250
4527
 
4251
4528
  assert.deepEqual(memberCallArgs[1], {
4252
4529
  file: 'members',
4253
- function: 'locusMediaSharesUpdate'
4530
+ function: 'locusMediaSharesUpdate',
4254
4531
  });
4255
4532
  assert.equal(memberCallArgs[2], member.eventName);
4256
4533
 
@@ -4264,9 +4541,8 @@ describe('plugin-meetings', () => {
4264
4541
 
4265
4542
  if (share.length + 1 > offset) {
4266
4543
  offset = (offset + share.length + 1) / 2;
4267
- }
4268
- else if (share.length + 1 < offset) {
4269
- offset = (share.length + 1) + 0.5;
4544
+ } else if (share.length + 1 < offset) {
4545
+ offset = share.length + 1 + 0.5;
4270
4546
  }
4271
4547
  }
4272
4548
  };
@@ -4277,40 +4553,100 @@ describe('plugin-meetings', () => {
4277
4553
 
4278
4554
  describe('Whiteboard A --> Whiteboard B', () => {
4279
4555
  it('Scenario #1: you share both whiteboards', () => {
4280
- const data1 = generateData(blankPayload, true, false, USER_IDS.ME, RESOURCE_URLS.WHITEBOARD_A);
4281
- const data2 = generateData(data1.payload, true, false, USER_IDS.ME, RESOURCE_URLS.WHITEBOARD_B);
4556
+ const data1 = generateData(
4557
+ blankPayload,
4558
+ true,
4559
+ false,
4560
+ USER_IDS.ME,
4561
+ RESOURCE_URLS.WHITEBOARD_A
4562
+ );
4563
+ const data2 = generateData(
4564
+ data1.payload,
4565
+ true,
4566
+ false,
4567
+ USER_IDS.ME,
4568
+ RESOURCE_URLS.WHITEBOARD_B
4569
+ );
4282
4570
  const data3 = generateData(data2.payload, false, false, USER_IDS.ME);
4283
4571
 
4284
4572
  payloadTestHelper([data1, data2, data3]);
4285
4573
  });
4286
4574
 
4287
4575
  it('Scenario #2: you share whiteboard A and remote person A shares whiteboard B', () => {
4288
- const data1 = generateData(blankPayload, true, false, USER_IDS.ME, RESOURCE_URLS.WHITEBOARD_A);
4289
- const data2 = generateData(data1.payload, true, false, USER_IDS.REMOTE_A, RESOURCE_URLS.WHITEBOARD_B);
4576
+ const data1 = generateData(
4577
+ blankPayload,
4578
+ true,
4579
+ false,
4580
+ USER_IDS.ME,
4581
+ RESOURCE_URLS.WHITEBOARD_A
4582
+ );
4583
+ const data2 = generateData(
4584
+ data1.payload,
4585
+ true,
4586
+ false,
4587
+ USER_IDS.REMOTE_A,
4588
+ RESOURCE_URLS.WHITEBOARD_B
4589
+ );
4290
4590
  const data3 = generateData(data2.payload, false, false, USER_IDS.REMOTE_A);
4291
4591
 
4292
4592
  payloadTestHelper([data1, data2, data3]);
4293
4593
  });
4294
4594
 
4295
4595
  it('Scenario #3: remote person A shares whiteboard A and you share whiteboard B', () => {
4296
- const data1 = generateData(blankPayload, true, false, USER_IDS.REMOTE_A, RESOURCE_URLS.WHITEBOARD_A);
4297
- const data2 = generateData(data1.payload, true, false, USER_IDS.ME, RESOURCE_URLS.WHITEBOARD_B);
4596
+ const data1 = generateData(
4597
+ blankPayload,
4598
+ true,
4599
+ false,
4600
+ USER_IDS.REMOTE_A,
4601
+ RESOURCE_URLS.WHITEBOARD_A
4602
+ );
4603
+ const data2 = generateData(
4604
+ data1.payload,
4605
+ true,
4606
+ false,
4607
+ USER_IDS.ME,
4608
+ RESOURCE_URLS.WHITEBOARD_B
4609
+ );
4298
4610
  const data3 = generateData(data2.payload, false, false, USER_IDS.ME);
4299
4611
 
4300
4612
  payloadTestHelper([data1, data2, data3]);
4301
4613
  });
4302
4614
 
4303
4615
  it('Scenario #4: remote person A shares both whiteboards', () => {
4304
- const data1 = generateData(blankPayload, true, false, USER_IDS.REMOTE_A, RESOURCE_URLS.WHITEBOARD_A);
4305
- const data2 = generateData(data1.payload, true, false, USER_IDS.REMOTE_A, RESOURCE_URLS.WHITEBOARD_B);
4616
+ const data1 = generateData(
4617
+ blankPayload,
4618
+ true,
4619
+ false,
4620
+ USER_IDS.REMOTE_A,
4621
+ RESOURCE_URLS.WHITEBOARD_A
4622
+ );
4623
+ const data2 = generateData(
4624
+ data1.payload,
4625
+ true,
4626
+ false,
4627
+ USER_IDS.REMOTE_A,
4628
+ RESOURCE_URLS.WHITEBOARD_B
4629
+ );
4306
4630
  const data3 = generateData(data2.payload, false, false, USER_IDS.REMOTE_A);
4307
4631
 
4308
4632
  payloadTestHelper([data1, data2, data3]);
4309
4633
  });
4310
4634
 
4311
4635
  it('Scenario #5: remote person A shares whiteboard A and remote person B shares whiteboard B', () => {
4312
- const data1 = generateData(blankPayload, true, false, USER_IDS.REMOTE_A, RESOURCE_URLS.WHITEBOARD_A);
4313
- const data2 = generateData(data1.payload, true, false, USER_IDS.REMOTE_B, RESOURCE_URLS.WHITEBOARD_B);
4636
+ const data1 = generateData(
4637
+ blankPayload,
4638
+ true,
4639
+ false,
4640
+ USER_IDS.REMOTE_A,
4641
+ RESOURCE_URLS.WHITEBOARD_A
4642
+ );
4643
+ const data2 = generateData(
4644
+ data1.payload,
4645
+ true,
4646
+ false,
4647
+ USER_IDS.REMOTE_B,
4648
+ RESOURCE_URLS.WHITEBOARD_B
4649
+ );
4314
4650
  const data3 = generateData(data2.payload, false, false, USER_IDS.REMOTE_B);
4315
4651
 
4316
4652
  payloadTestHelper([data1, data2, data3]);
@@ -4319,45 +4655,155 @@ describe('plugin-meetings', () => {
4319
4655
 
4320
4656
  describe('Whiteboard A --> Desktop', () => {
4321
4657
  it('Scenario #1: you share whiteboard and then share desktop', () => {
4322
- const data1 = generateData(blankPayload, true, false, USER_IDS.ME, RESOURCE_URLS.WHITEBOARD_A);
4323
- const data2 = generateData(data1.payload, false, false, USER_IDS.ME, RESOURCE_URLS.WHITEBOARD_A, true, USER_IDS.ME);
4324
- const data3 = generateData(data2.payload, true, true, USER_IDS.ME, undefined, true, USER_IDS.ME);
4658
+ const data1 = generateData(
4659
+ blankPayload,
4660
+ true,
4661
+ false,
4662
+ USER_IDS.ME,
4663
+ RESOURCE_URLS.WHITEBOARD_A
4664
+ );
4665
+ const data2 = generateData(
4666
+ data1.payload,
4667
+ false,
4668
+ false,
4669
+ USER_IDS.ME,
4670
+ RESOURCE_URLS.WHITEBOARD_A,
4671
+ true,
4672
+ USER_IDS.ME
4673
+ );
4674
+ const data3 = generateData(
4675
+ data2.payload,
4676
+ true,
4677
+ true,
4678
+ USER_IDS.ME,
4679
+ undefined,
4680
+ true,
4681
+ USER_IDS.ME
4682
+ );
4325
4683
  const data4 = generateData(data3.payload, false, true, USER_IDS.ME);
4326
4684
 
4327
4685
  payloadTestHelper([data1, data2, data3, data4]);
4328
4686
  });
4329
4687
 
4330
4688
  it('Scenario #2: you share whiteboard A and remote person A shares desktop', () => {
4331
- const data1 = generateData(blankPayload, true, false, USER_IDS.ME, RESOURCE_URLS.WHITEBOARD_A);
4332
- const data2 = generateData(data1.payload, false, false, USER_IDS.ME, RESOURCE_URLS.WHITEBOARD_A, true, USER_IDS.REMOTE_A);
4333
- const data3 = generateData(data2.payload, true, true, USER_IDS.REMOTE_A, undefined, true, USER_IDS.ME);
4689
+ const data1 = generateData(
4690
+ blankPayload,
4691
+ true,
4692
+ false,
4693
+ USER_IDS.ME,
4694
+ RESOURCE_URLS.WHITEBOARD_A
4695
+ );
4696
+ const data2 = generateData(
4697
+ data1.payload,
4698
+ false,
4699
+ false,
4700
+ USER_IDS.ME,
4701
+ RESOURCE_URLS.WHITEBOARD_A,
4702
+ true,
4703
+ USER_IDS.REMOTE_A
4704
+ );
4705
+ const data3 = generateData(
4706
+ data2.payload,
4707
+ true,
4708
+ true,
4709
+ USER_IDS.REMOTE_A,
4710
+ undefined,
4711
+ true,
4712
+ USER_IDS.ME
4713
+ );
4334
4714
  const data4 = generateData(data3.payload, false, true, USER_IDS.REMOTE_A);
4335
4715
 
4336
4716
  payloadTestHelper([data1, data2, data3, data4]);
4337
4717
  });
4338
4718
 
4339
4719
  it('Scenario #3: remote person A shares whiteboard and you share desktop', () => {
4340
- const data1 = generateData(blankPayload, true, false, USER_IDS.REMOTE_A, RESOURCE_URLS.WHITEBOARD_A);
4341
- const data2 = generateData(data1.payload, false, false, USER_IDS.REMOTE_A, RESOURCE_URLS.WHITEBOARD_A, true, USER_IDS.ME);
4342
- const data3 = generateData(data2.payload, true, true, USER_IDS.ME, undefined, true, USER_IDS.REMOTE_A);
4720
+ const data1 = generateData(
4721
+ blankPayload,
4722
+ true,
4723
+ false,
4724
+ USER_IDS.REMOTE_A,
4725
+ RESOURCE_URLS.WHITEBOARD_A
4726
+ );
4727
+ const data2 = generateData(
4728
+ data1.payload,
4729
+ false,
4730
+ false,
4731
+ USER_IDS.REMOTE_A,
4732
+ RESOURCE_URLS.WHITEBOARD_A,
4733
+ true,
4734
+ USER_IDS.ME
4735
+ );
4736
+ const data3 = generateData(
4737
+ data2.payload,
4738
+ true,
4739
+ true,
4740
+ USER_IDS.ME,
4741
+ undefined,
4742
+ true,
4743
+ USER_IDS.REMOTE_A
4744
+ );
4343
4745
  const data4 = generateData(data3.payload, false, true, USER_IDS.ME);
4344
4746
 
4345
4747
  payloadTestHelper([data1, data2, data3, data4]);
4346
4748
  });
4347
4749
 
4348
4750
  it('Scenario #4: remote person A shares whiteboard and then shares desktop', () => {
4349
- const data1 = generateData(blankPayload, true, false, USER_IDS.REMOTE_A, RESOURCE_URLS.WHITEBOARD_A);
4350
- const data2 = generateData(data1.payload, false, false, USER_IDS.REMOTE_A, RESOURCE_URLS.WHITEBOARD_A, true, USER_IDS.REMOTE_A);
4351
- const data3 = generateData(data2.payload, true, true, USER_IDS.REMOTE_A, undefined, true, USER_IDS.REMOTE_A);
4751
+ const data1 = generateData(
4752
+ blankPayload,
4753
+ true,
4754
+ false,
4755
+ USER_IDS.REMOTE_A,
4756
+ RESOURCE_URLS.WHITEBOARD_A
4757
+ );
4758
+ const data2 = generateData(
4759
+ data1.payload,
4760
+ false,
4761
+ false,
4762
+ USER_IDS.REMOTE_A,
4763
+ RESOURCE_URLS.WHITEBOARD_A,
4764
+ true,
4765
+ USER_IDS.REMOTE_A
4766
+ );
4767
+ const data3 = generateData(
4768
+ data2.payload,
4769
+ true,
4770
+ true,
4771
+ USER_IDS.REMOTE_A,
4772
+ undefined,
4773
+ true,
4774
+ USER_IDS.REMOTE_A
4775
+ );
4352
4776
  const data4 = generateData(data3.payload, false, true, USER_IDS.REMOTE_A);
4353
4777
 
4354
4778
  payloadTestHelper([data1, data2, data3, data4]);
4355
4779
  });
4356
4780
 
4357
4781
  it('Scenario #5: remote person A shares whiteboard and remote person B shares desktop', () => {
4358
- const data1 = generateData(blankPayload, true, false, USER_IDS.REMOTE_A, RESOURCE_URLS.WHITEBOARD_A);
4359
- const data2 = generateData(data1.payload, false, false, USER_IDS.REMOTE_A, RESOURCE_URLS.WHITEBOARD_A, true, USER_IDS.REMOTE_B);
4360
- const data3 = generateData(data2.payload, true, true, USER_IDS.REMOTE_B, undefined, true, USER_IDS.REMOTE_A);
4782
+ const data1 = generateData(
4783
+ blankPayload,
4784
+ true,
4785
+ false,
4786
+ USER_IDS.REMOTE_A,
4787
+ RESOURCE_URLS.WHITEBOARD_A
4788
+ );
4789
+ const data2 = generateData(
4790
+ data1.payload,
4791
+ false,
4792
+ false,
4793
+ USER_IDS.REMOTE_A,
4794
+ RESOURCE_URLS.WHITEBOARD_A,
4795
+ true,
4796
+ USER_IDS.REMOTE_B
4797
+ );
4798
+ const data3 = generateData(
4799
+ data2.payload,
4800
+ true,
4801
+ true,
4802
+ USER_IDS.REMOTE_B,
4803
+ undefined,
4804
+ true,
4805
+ USER_IDS.REMOTE_A
4806
+ );
4361
4807
  const data4 = generateData(data3.payload, false, true, USER_IDS.REMOTE_B);
4362
4808
 
4363
4809
  payloadTestHelper([data1, data2, data3, data4]);
@@ -4367,7 +4813,13 @@ describe('plugin-meetings', () => {
4367
4813
  describe('Desktop --> Whiteboard A', () => {
4368
4814
  it('Scenario #1: you share desktop and then share whiteboard', () => {
4369
4815
  const data1 = generateData(blankPayload, true, true, USER_IDS.ME);
4370
- const data2 = generateData(data1.payload, true, false, USER_IDS.ME, RESOURCE_URLS.WHITEBOARD_A);
4816
+ const data2 = generateData(
4817
+ data1.payload,
4818
+ true,
4819
+ false,
4820
+ USER_IDS.ME,
4821
+ RESOURCE_URLS.WHITEBOARD_A
4822
+ );
4371
4823
  const data3 = generateData(data2.payload, false, false, USER_IDS.ME);
4372
4824
 
4373
4825
  payloadTestHelper([data1, data2, data3]);
@@ -4375,7 +4827,13 @@ describe('plugin-meetings', () => {
4375
4827
 
4376
4828
  it('Scenario #2: you share desktop and remote person A shares whiteboard', () => {
4377
4829
  const data1 = generateData(blankPayload, true, true, USER_IDS.ME);
4378
- const data2 = generateData(data1.payload, true, false, USER_IDS.REMOTE_A, RESOURCE_URLS.WHITEBOARD_A);
4830
+ const data2 = generateData(
4831
+ data1.payload,
4832
+ true,
4833
+ false,
4834
+ USER_IDS.REMOTE_A,
4835
+ RESOURCE_URLS.WHITEBOARD_A
4836
+ );
4379
4837
  const data3 = generateData(data2.payload, false, false, USER_IDS.REMOTE_A);
4380
4838
 
4381
4839
  payloadTestHelper([data1, data2, data3]);
@@ -4383,7 +4841,13 @@ describe('plugin-meetings', () => {
4383
4841
 
4384
4842
  it('Scenario #3: remote person A shares desktop and you share whiteboard', () => {
4385
4843
  const data1 = generateData(blankPayload, true, true, USER_IDS.REMOTE_A);
4386
- const data2 = generateData(data1.payload, true, false, USER_IDS.REMOTE_A, RESOURCE_URLS.WHITEBOARD_A);
4844
+ const data2 = generateData(
4845
+ data1.payload,
4846
+ true,
4847
+ false,
4848
+ USER_IDS.REMOTE_A,
4849
+ RESOURCE_URLS.WHITEBOARD_A
4850
+ );
4387
4851
  const data3 = generateData(data2.payload, false, false, USER_IDS.REMOTE_A);
4388
4852
 
4389
4853
  payloadTestHelper([data1, data2, data3]);
@@ -4391,7 +4855,13 @@ describe('plugin-meetings', () => {
4391
4855
 
4392
4856
  it('Scenario #4: remote person A shares desktop and then shares whiteboard', () => {
4393
4857
  const data1 = generateData(blankPayload, true, true, USER_IDS.REMOTE_A);
4394
- const data2 = generateData(data1.payload, true, false, USER_IDS.ME, RESOURCE_URLS.WHITEBOARD_A);
4858
+ const data2 = generateData(
4859
+ data1.payload,
4860
+ true,
4861
+ false,
4862
+ USER_IDS.ME,
4863
+ RESOURCE_URLS.WHITEBOARD_A
4864
+ );
4395
4865
  const data3 = generateData(data2.payload, false, false, USER_IDS.ME);
4396
4866
 
4397
4867
  payloadTestHelper([data1, data2, data3]);
@@ -4399,7 +4869,13 @@ describe('plugin-meetings', () => {
4399
4869
 
4400
4870
  it('Scenario #5: remote person A shares desktop and remote person B shares whiteboard', () => {
4401
4871
  const data1 = generateData(blankPayload, true, true, USER_IDS.REMOTE_A);
4402
- const data2 = generateData(data1.payload, true, false, USER_IDS.REMOTE_A, RESOURCE_URLS.WHITEBOARD_A);
4872
+ const data2 = generateData(
4873
+ data1.payload,
4874
+ true,
4875
+ false,
4876
+ USER_IDS.REMOTE_A,
4877
+ RESOURCE_URLS.WHITEBOARD_A
4878
+ );
4403
4879
  const data3 = generateData(data2.payload, false, false, USER_IDS.REMOTE_A);
4404
4880
 
4405
4881
  payloadTestHelper([data1, data2, data3]);
@@ -4475,17 +4951,21 @@ describe('plugin-meetings', () => {
4475
4951
  assert.isNull(meeting.keepAliveTimerId);
4476
4952
  meeting.joinedWith = {
4477
4953
  keepAliveUrl: defaultKeepAliveUrl,
4478
- keepAliveSecs: defaultKeepAliveSecs
4954
+ keepAliveSecs: defaultKeepAliveSecs,
4479
4955
  };
4480
4956
  meeting.startKeepAlive();
4481
4957
  assert.isNumber(meeting.keepAliveTimerId.id);
4482
4958
  await testUtils.flushPromises();
4483
4959
  assert.notCalled(meeting.meetingRequest.keepAlive);
4484
4960
  await progressTime(defaultExpectedInterval);
4485
- assert.calledOnceWithExactly(meeting.meetingRequest.keepAlive, {keepAliveUrl: defaultKeepAliveUrl});
4961
+ assert.calledOnceWithExactly(meeting.meetingRequest.keepAlive, {
4962
+ keepAliveUrl: defaultKeepAliveUrl,
4963
+ });
4486
4964
  await progressTime(defaultExpectedInterval);
4487
4965
  assert.calledTwice(meeting.meetingRequest.keepAlive);
4488
- assert.alwaysCalledWithExactly(meeting.meetingRequest.keepAlive, {keepAliveUrl: defaultKeepAliveUrl});
4966
+ assert.alwaysCalledWithExactly(meeting.meetingRequest.keepAlive, {
4967
+ keepAliveUrl: defaultKeepAliveUrl,
4968
+ });
4489
4969
  });
4490
4970
  it('startKeepAlive handles existing keepAliveTimerId', async () => {
4491
4971
  meeting.meetingRequest.keepAlive = sinon.stub().returns(Promise.resolve());
@@ -4494,7 +4974,7 @@ describe('plugin-meetings', () => {
4494
4974
  meeting.keepAliveTimerId = 7;
4495
4975
  meeting.joinedWith = {
4496
4976
  keepAliveUrl: defaultKeepAliveUrl,
4497
- keepAliveSecs: defaultKeepAliveSecs
4977
+ keepAliveSecs: defaultKeepAliveSecs,
4498
4978
  };
4499
4979
  meeting.startKeepAlive();
4500
4980
  assert.equal(meeting.keepAliveTimerId, 7);
@@ -4507,7 +4987,7 @@ describe('plugin-meetings', () => {
4507
4987
 
4508
4988
  assert.isNull(meeting.keepAliveTimerId);
4509
4989
  meeting.joinedWith = {
4510
- keepAliveSecs: defaultKeepAliveSecs
4990
+ keepAliveSecs: defaultKeepAliveSecs,
4511
4991
  };
4512
4992
  meeting.startKeepAlive();
4513
4993
  assert.isNull(meeting.keepAliveTimerId);
@@ -4520,7 +5000,7 @@ describe('plugin-meetings', () => {
4520
5000
 
4521
5001
  assert.isNull(meeting.keepAliveTimerId);
4522
5002
  meeting.joinedWith = {
4523
- keepAliveUrl: defaultKeepAliveUrl
5003
+ keepAliveUrl: defaultKeepAliveUrl,
4524
5004
  };
4525
5005
  meeting.startKeepAlive();
4526
5006
  assert.isNull(meeting.keepAliveTimerId);
@@ -4534,7 +5014,7 @@ describe('plugin-meetings', () => {
4534
5014
  assert.isNull(meeting.keepAliveTimerId);
4535
5015
  meeting.joinedWith = {
4536
5016
  keepAliveUrl: defaultKeepAliveUrl,
4537
- keepAliveSecs: 1
5017
+ keepAliveSecs: 1,
4538
5018
  };
4539
5019
  meeting.startKeepAlive();
4540
5020
  assert.isNull(meeting.keepAliveTimerId);
@@ -4547,14 +5027,16 @@ describe('plugin-meetings', () => {
4547
5027
  assert.isNull(meeting.keepAliveTimerId);
4548
5028
  meeting.joinedWith = {
4549
5029
  keepAliveUrl: defaultKeepAliveUrl,
4550
- keepAliveSecs: defaultKeepAliveSecs
5030
+ keepAliveSecs: defaultKeepAliveSecs,
4551
5031
  };
4552
5032
  meeting.startKeepAlive();
4553
5033
  assert.isNumber(meeting.keepAliveTimerId.id);
4554
5034
  await testUtils.flushPromises();
4555
5035
  assert.notCalled(meeting.meetingRequest.keepAlive);
4556
5036
  await progressTime(defaultExpectedInterval);
4557
- assert.calledOnceWithExactly(meeting.meetingRequest.keepAlive, {keepAliveUrl: defaultKeepAliveUrl});
5037
+ assert.calledOnceWithExactly(meeting.meetingRequest.keepAlive, {
5038
+ keepAliveUrl: defaultKeepAliveUrl,
5039
+ });
4558
5040
  assert.isNull(meeting.keepAliveTimerId);
4559
5041
  await progressTime(defaultExpectedInterval);
4560
5042
  assert.calledOnce(meeting.meetingRequest.keepAlive);
@@ -4584,12 +5066,14 @@ describe('plugin-meetings', () => {
4584
5066
  assert.isNull(meeting.keepAliveTimerId);
4585
5067
  meeting.joinedWith = {
4586
5068
  keepAliveUrl: defaultKeepAliveUrl,
4587
- keepAliveSecs: defaultKeepAliveSecs
5069
+ keepAliveSecs: defaultKeepAliveSecs,
4588
5070
  };
4589
5071
  meeting.startKeepAlive();
4590
5072
  assert.isNumber(meeting.keepAliveTimerId.id);
4591
5073
  await progressTime(defaultExpectedInterval);
4592
- assert.calledOnceWithExactly(meeting.meetingRequest.keepAlive, {keepAliveUrl: defaultKeepAliveUrl});
5074
+ assert.calledOnceWithExactly(meeting.meetingRequest.keepAlive, {
5075
+ keepAliveUrl: defaultKeepAliveUrl,
5076
+ });
4593
5077
 
4594
5078
  meeting.stopKeepAlive();
4595
5079
  assert.isNull(meeting.keepAliveTimerId);
@@ -4627,8 +5111,8 @@ describe('plugin-meetings', () => {
4627
5111
  tone: {
4628
5112
  type: 'light_skin_tone',
4629
5113
  codepoints: '1F3FB',
4630
- shortcodes: ':skin-tone-2:'
4631
- }
5114
+ shortcodes: ':skin-tone-2:',
5115
+ },
4632
5116
  },
4633
5117
  participantId: meeting.members.selfId,
4634
5118
  });
@@ -4637,7 +5121,11 @@ describe('plugin-meetings', () => {
4637
5121
  it('should fail sending a reaction if data channel is undefined', async () => {
4638
5122
  meeting.locusInfo.controls = {reactions: {reactionChannelUrl: undefined}};
4639
5123
 
4640
- await assert.isRejected(meeting.sendReaction('thumbs_down', 'light'), Error, 'Error sending reaction, service url not found.');
5124
+ await assert.isRejected(
5125
+ meeting.sendReaction('thumbs_down', 'light'),
5126
+ Error,
5127
+ 'Error sending reaction, service url not found.'
5128
+ );
4641
5129
 
4642
5130
  assert.notCalled(meeting.meetingRequest.sendReaction);
4643
5131
  });
@@ -4645,7 +5133,11 @@ describe('plugin-meetings', () => {
4645
5133
  it('should fail sending a reaction if reactionType is invalid ', async () => {
4646
5134
  meeting.locusInfo.controls = {reactions: {reactionChannelUrl: 'Fake URL'}};
4647
5135
 
4648
- await assert.isRejected(meeting.sendReaction('invalid_reaction', 'light'), Error, 'invalid_reaction is not a valid reaction.');
5136
+ await assert.isRejected(
5137
+ meeting.sendReaction('invalid_reaction', 'light'),
5138
+ Error,
5139
+ 'invalid_reaction is not a valid reaction.'
5140
+ );
4649
5141
 
4650
5142
  assert.notCalled(meeting.meetingRequest.sendReaction);
4651
5143
  });
@@ -4663,7 +5155,7 @@ describe('plugin-meetings', () => {
4663
5155
  type: 'thumb_down',
4664
5156
  codepoints: '1F44E',
4665
5157
  shortcodes: ':thumbsdown:',
4666
- tone: {type: 'normal_skin_tone', codepoints: '', shortcodes: ''}
5158
+ tone: {type: 'normal_skin_tone', codepoints: '', shortcodes: ''},
4667
5159
  },
4668
5160
  participantId: meeting.members.selfId,
4669
5161
  });
@@ -4682,7 +5174,7 @@ describe('plugin-meetings', () => {
4682
5174
  type: 'thumb_down',
4683
5175
  codepoints: '1F44E',
4684
5176
  shortcodes: ':thumbsdown:',
4685
- tone: {type: 'normal_skin_tone', codepoints: '', shortcodes: ''}
5177
+ tone: {type: 'normal_skin_tone', codepoints: '', shortcodes: ''},
4686
5178
  },
4687
5179
  participantId: meeting.members.selfId,
4688
5180
  });