@webex/plugin-meetings 3.10.0-next.28 → 3.10.0-next.29

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.
@@ -299,5 +299,55 @@ describe('plugin-meetings', () => {
299
299
  const sdp2 = 'v=0\r\no=HOMER 0 1 IN IP4 23.89.67.81\r\ns=-\r\nc=IN IP4 23.89.67.81\r\nb=TIAS:128000\r\nt=0 0\r\na=ice-lite\r\n'
300
300
  assert.equal(MeetingsUtil.getMediaServer(sdp2), 'homer');
301
301
  });
302
- })
302
+ });
303
+
304
+ describe('#getCorrelationIdForDevice', () => {
305
+ it('should return correlationId if device with matching url is found', () => {
306
+ const locusSelf = {
307
+ devices: [
308
+ {url: 'deviceUrl1', correlationId: 'correlationId1'},
309
+ {url: 'deviceUrl2', correlationId: 'correlationId2'},
310
+ ],
311
+ };
312
+
313
+ const correlationId = MeetingsUtil.getCorrelationIdForDevice('deviceUrl1', locusSelf);
314
+ assert.equal(correlationId, 'correlationId1');
315
+ });
316
+
317
+ it('should return false if no device with matching url is found', () => {
318
+ const locusSelf = {
319
+ devices: [
320
+ {url: 'deviceUrl1', correlationId: 'correlationId1'},
321
+ {url: 'deviceUrl2', correlationId: 'correlationId2'},
322
+ ],
323
+ };
324
+
325
+ const correlationId = MeetingsUtil.getCorrelationIdForDevice('deviceUrl3', locusSelf);
326
+ assert.equal(correlationId, false);
327
+ });
328
+
329
+ it('should return false if device with matching url has no correlationId', () => {
330
+ const locusSelf = {
331
+ devices: [{url: 'deviceUrl1'}, {url: 'deviceUrl2', correlationId: 'correlationId2'}],
332
+ };
333
+
334
+ const correlationId = MeetingsUtil.getCorrelationIdForDevice('deviceUrl1', locusSelf);
335
+ assert.equal(correlationId, false);
336
+ });
337
+
338
+ it('should return false if locusSelf has no devices', () => {
339
+ const locusSelf = {};
340
+
341
+ const correlationId = MeetingsUtil.getCorrelationIdForDevice('deviceUrl1', locusSelf);
342
+ assert.equal(correlationId, false);
343
+ });
344
+
345
+ it('should return false if locusSelf is null or undefined', () => {
346
+ let correlationId = MeetingsUtil.getCorrelationIdForDevice('deviceUrl1', null);
347
+ assert.equal(correlationId, false);
348
+
349
+ correlationId = MeetingsUtil.getCorrelationIdForDevice('deviceUrl1', undefined);
350
+ assert.equal(correlationId, false);
351
+ });
352
+ });
303
353
  });