@webex/plugin-meetings 3.12.0-next.170 → 3.12.0-next.172
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.
- package/dist/aiEnableRequest/index.js +1 -1
- package/dist/annotation/index.js +53 -17
- package/dist/annotation/index.js.map +1 -1
- package/dist/breakouts/breakout.js +1 -1
- package/dist/breakouts/index.js +35 -9
- package/dist/breakouts/index.js.map +1 -1
- package/dist/interceptors/dataChannelAuthToken.js +41 -59
- package/dist/interceptors/dataChannelAuthToken.js.map +1 -1
- package/dist/interpretation/index.js +1 -1
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/meeting/index.js +327 -292
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/util.js +5 -1
- package/dist/meeting/util.js.map +1 -1
- package/dist/meetings/index.js +4 -1
- package/dist/meetings/index.js.map +1 -1
- package/dist/types/annotation/index.d.ts +19 -0
- package/dist/types/meeting/index.d.ts +46 -12
- package/dist/types/meeting/util.d.ts +3 -1
- package/dist/webinar/index.js +298 -255
- package/dist/webinar/index.js.map +1 -1
- package/package.json +13 -13
- package/src/annotation/index.ts +55 -25
- package/src/breakouts/index.ts +33 -11
- package/src/interceptors/dataChannelAuthToken.ts +48 -77
- package/src/meeting/index.ts +296 -289
- package/src/meeting/util.ts +2 -2
- package/src/meetings/index.ts +2 -1
- package/src/webinar/index.ts +168 -188
- package/test/unit/spec/annotation/index.ts +214 -182
- package/test/unit/spec/breakouts/index.ts +126 -25
- package/test/unit/spec/interceptors/dataChannelAuthToken.ts +81 -99
- package/test/unit/spec/meeting/index.js +939 -705
- package/test/unit/spec/meeting/utils.js +16 -2
- package/test/unit/spec/meetings/index.js +5 -0
- package/test/unit/spec/webinar/index.ts +886 -718
|
@@ -641,13 +641,87 @@ describe('plugin-meetings', () => {
|
|
|
641
641
|
});
|
|
642
642
|
});
|
|
643
643
|
|
|
644
|
+
describe('#registerLLMChannel', () => {
|
|
645
|
+
it('registers an LLM channel', () => {
|
|
646
|
+
const mockChannel = {
|
|
647
|
+
isConnected: sinon.stub().returns(true),
|
|
648
|
+
on: sinon.stub(),
|
|
649
|
+
off: sinon.stub(),
|
|
650
|
+
};
|
|
651
|
+
|
|
652
|
+
breakouts.registerLLMChannel(mockChannel);
|
|
653
|
+
|
|
654
|
+
assert.equal(breakouts._llmChannel, mockChannel);
|
|
655
|
+
});
|
|
656
|
+
|
|
657
|
+
it('cleans up previous channel before registering new one', () => {
|
|
658
|
+
const oldChannel = {
|
|
659
|
+
isConnected: sinon.stub().returns(true),
|
|
660
|
+
on: sinon.stub(),
|
|
661
|
+
off: sinon.stub(),
|
|
662
|
+
};
|
|
663
|
+
const newChannel = {
|
|
664
|
+
isConnected: sinon.stub().returns(false),
|
|
665
|
+
on: sinon.stub(),
|
|
666
|
+
off: sinon.stub(),
|
|
667
|
+
};
|
|
668
|
+
|
|
669
|
+
breakouts.registerLLMChannel(oldChannel);
|
|
670
|
+
// After registering connected channel, hasSubscribedToMessage becomes true
|
|
671
|
+
assert.equal(breakouts.hasSubscribedToMessage, true);
|
|
672
|
+
|
|
673
|
+
const stopListeningSpy = sinon.spy(breakouts, 'stopListening');
|
|
674
|
+
breakouts.registerLLMChannel(newChannel);
|
|
675
|
+
|
|
676
|
+
// Should have called stopListening to clean up old channel
|
|
677
|
+
assert.calledWith(stopListeningSpy, oldChannel);
|
|
678
|
+
assert.equal(breakouts._llmChannel, newChannel);
|
|
679
|
+
// Since newChannel is not connected, hasSubscribedToMessage stays false
|
|
680
|
+
assert.equal(breakouts.hasSubscribedToMessage, false);
|
|
681
|
+
});
|
|
682
|
+
});
|
|
683
|
+
|
|
684
|
+
describe('#unregisterLLMChannel', () => {
|
|
685
|
+
it('unregisters the LLM channel', () => {
|
|
686
|
+
const mockChannel = {
|
|
687
|
+
isConnected: sinon.stub().returns(true),
|
|
688
|
+
on: sinon.stub(),
|
|
689
|
+
off: sinon.stub(),
|
|
690
|
+
};
|
|
691
|
+
|
|
692
|
+
breakouts.registerLLMChannel(mockChannel);
|
|
693
|
+
breakouts.hasSubscribedToMessage = true;
|
|
694
|
+
|
|
695
|
+
breakouts.unregisterLLMChannel();
|
|
696
|
+
|
|
697
|
+
assert.equal(breakouts._llmChannel, undefined);
|
|
698
|
+
assert.equal(breakouts.hasSubscribedToMessage, false);
|
|
699
|
+
});
|
|
700
|
+
|
|
701
|
+
it('does nothing if no channel is registered', () => {
|
|
702
|
+
breakouts.unregisterLLMChannel();
|
|
703
|
+
assert.equal(breakouts._llmChannel, undefined);
|
|
704
|
+
});
|
|
705
|
+
});
|
|
706
|
+
|
|
644
707
|
describe('#listenToBroadcastMessages', () => {
|
|
645
|
-
it('do not subscribe message if
|
|
646
|
-
|
|
647
|
-
breakouts.listenTo = sinon.stub();
|
|
708
|
+
it('do not subscribe message if no channel registered', () => {
|
|
709
|
+
const listenToSpy = sinon.spy(breakouts, 'listenTo');
|
|
648
710
|
breakouts.locusUrlUpdate('newUrl');
|
|
649
711
|
assert.equal(breakouts.locusUrl, 'newUrl');
|
|
650
|
-
assert.notCalled(
|
|
712
|
+
assert.notCalled(listenToSpy);
|
|
713
|
+
});
|
|
714
|
+
|
|
715
|
+
it('do not subscribe message if channel not connected', () => {
|
|
716
|
+
const mockChannel = {
|
|
717
|
+
isConnected: sinon.stub().returns(false),
|
|
718
|
+
on: sinon.stub(),
|
|
719
|
+
off: sinon.stub(),
|
|
720
|
+
};
|
|
721
|
+
breakouts._llmChannel = mockChannel;
|
|
722
|
+
const listenToSpy = sinon.spy(breakouts, 'listenTo');
|
|
723
|
+
breakouts.listenToBroadcastMessages();
|
|
724
|
+
assert.notCalled(listenToSpy);
|
|
651
725
|
});
|
|
652
726
|
|
|
653
727
|
it('do not subscribe message if the connected llm does not belong to this meeting', () => {
|
|
@@ -660,32 +734,54 @@ describe('plugin-meetings', () => {
|
|
|
660
734
|
});
|
|
661
735
|
|
|
662
736
|
it('do not subscribe message if already done', () => {
|
|
663
|
-
|
|
737
|
+
const mockChannel = {
|
|
738
|
+
isConnected: sinon.stub().returns(true),
|
|
739
|
+
on: sinon.stub(),
|
|
740
|
+
off: sinon.stub(),
|
|
741
|
+
};
|
|
742
|
+
breakouts._llmChannel = mockChannel;
|
|
664
743
|
breakouts.hasSubscribedToMessage = true;
|
|
665
|
-
|
|
666
|
-
breakouts.
|
|
667
|
-
assert.
|
|
668
|
-
|
|
744
|
+
const listenToSpy = sinon.spy(breakouts, 'listenTo');
|
|
745
|
+
breakouts.listenToBroadcastMessages();
|
|
746
|
+
assert.notCalled(listenToSpy);
|
|
747
|
+
});
|
|
748
|
+
|
|
749
|
+
it('subscribes to breakout.message events on connected channel', () => {
|
|
750
|
+
const mockChannel = {
|
|
751
|
+
isConnected: sinon.stub().returns(true),
|
|
752
|
+
on: sinon.stub(),
|
|
753
|
+
off: sinon.stub(),
|
|
754
|
+
};
|
|
755
|
+
breakouts._llmChannel = mockChannel;
|
|
756
|
+
const listenToSpy = sinon.spy(breakouts, 'listenTo');
|
|
757
|
+
breakouts.listenToBroadcastMessages();
|
|
758
|
+
|
|
759
|
+
assert.calledOnce(listenToSpy);
|
|
760
|
+
assert.calledWith(listenToSpy, mockChannel, 'event:breakout.message', sinon.match.func);
|
|
761
|
+
assert.equal(breakouts.hasSubscribedToMessage, true);
|
|
669
762
|
});
|
|
670
763
|
|
|
671
764
|
it('triggers message event when a message received', () => {
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
.
|
|
676
|
-
|
|
677
|
-
|
|
765
|
+
const mockChannel = {
|
|
766
|
+
isConnected: sinon.stub().returns(true),
|
|
767
|
+
on: sinon.stub(),
|
|
768
|
+
off: sinon.stub(),
|
|
769
|
+
};
|
|
770
|
+
breakouts._llmChannel = mockChannel;
|
|
771
|
+
const listenToSpy = sinon.spy(breakouts, 'listenTo');
|
|
772
|
+
breakouts.listenToBroadcastMessages();
|
|
678
773
|
|
|
679
|
-
|
|
774
|
+
// Get the callback passed to listenTo
|
|
775
|
+
const callback = listenToSpy.getCall(0).args[2];
|
|
680
776
|
|
|
681
777
|
let message;
|
|
682
|
-
|
|
683
778
|
breakouts.listenTo(breakouts, BREAKOUTS.EVENTS.MESSAGE, (event) => {
|
|
684
779
|
message = event;
|
|
685
780
|
});
|
|
686
781
|
|
|
687
782
|
breakouts.currentBreakoutSession.sessionId = 'sessionId';
|
|
688
783
|
|
|
784
|
+
// Simulate the LLM channel event
|
|
689
785
|
callback({
|
|
690
786
|
data: {
|
|
691
787
|
senderUserId: 'senderUserId',
|
|
@@ -703,20 +799,25 @@ describe('plugin-meetings', () => {
|
|
|
703
799
|
});
|
|
704
800
|
|
|
705
801
|
it('re-checks the subscription when the llm emits online', () => {
|
|
706
|
-
const onlineCall = webex.internal.llm.on
|
|
707
|
-
.getCalls()
|
|
708
|
-
.find((c) => c.args[0] === 'online');
|
|
802
|
+
const onlineCall = webex.internal.llm.on.getCalls().find((c) => c.args[0] === 'online');
|
|
709
803
|
assert.exists(onlineCall, 'expected an online listener to be registered');
|
|
710
804
|
const onlineHandler = onlineCall.args[1];
|
|
711
805
|
|
|
712
|
-
|
|
713
|
-
|
|
806
|
+
// Set up _llmChannel so listenToBroadcastMessages can subscribe
|
|
807
|
+
const mockChannel = {
|
|
808
|
+
isConnected: sinon.stub().returns(true),
|
|
809
|
+
on: sinon.stub(),
|
|
810
|
+
off: sinon.stub(),
|
|
811
|
+
};
|
|
812
|
+
breakouts._llmChannel = mockChannel;
|
|
813
|
+
|
|
814
|
+
const listenToSpy = sinon.spy(breakouts, 'listenTo');
|
|
714
815
|
|
|
715
816
|
onlineHandler.call(breakouts);
|
|
716
817
|
|
|
717
|
-
const call =
|
|
818
|
+
const call = listenToSpy
|
|
718
819
|
.getCalls()
|
|
719
|
-
.find((c) => c.args[0] === 'event:breakout.message');
|
|
820
|
+
.find((c) => c.args[0] === mockChannel && c.args[1] === 'event:breakout.message');
|
|
720
821
|
assert.exists(call, 'expected broadcast message subscription after online');
|
|
721
822
|
assert.isTrue(breakouts.hasSubscribedToMessage);
|
|
722
823
|
});
|
|
@@ -1658,7 +1759,7 @@ describe('plugin-meetings', () => {
|
|
|
1658
1759
|
state: 'LOCKED',
|
|
1659
1760
|
};
|
|
1660
1761
|
|
|
1661
|
-
await
|
|
1762
|
+
await assert.isRejected(breakouts.lockBreakout(), Error, 'Breakout already locked');
|
|
1662
1763
|
});
|
|
1663
1764
|
|
|
1664
1765
|
it('lock breakout without editLock', async () => {
|
|
@@ -6,8 +6,10 @@ import {WebexHttpError} from '@webex/webex-core';
|
|
|
6
6
|
import DataChannelAuthTokenInterceptor from '@webex/plugin-meetings/src/interceptors/dataChannelAuthToken';
|
|
7
7
|
import LoggerProxy from '@webex/plugin-meetings/src/common/logs/logger-proxy';
|
|
8
8
|
import * as utils from '@webex/plugin-meetings/src/interceptors/utils';
|
|
9
|
-
import {
|
|
10
|
-
|
|
9
|
+
import {
|
|
10
|
+
DATA_CHANNEL_AUTH_HEADER,
|
|
11
|
+
MAX_RETRY,
|
|
12
|
+
} from '@webex/plugin-meetings/src/interceptors/constant';
|
|
11
13
|
|
|
12
14
|
describe('plugin-meetings', () => {
|
|
13
15
|
describe('Interceptors', () => {
|
|
@@ -247,24 +249,16 @@ describe('plugin-meetings', () => {
|
|
|
247
249
|
dataChannelTokenType: 'llm-practice-session',
|
|
248
250
|
},
|
|
249
251
|
}),
|
|
252
|
+
setLLMChannelDataToken: sinon.stub(),
|
|
250
253
|
};
|
|
251
254
|
|
|
252
255
|
llmMock = {
|
|
253
256
|
isDataChannelTokenEnabled: sinon.stub().resolves(true),
|
|
254
|
-
|
|
255
|
-
getLocusUrlByDatachannelUrl: sinon.stub(),
|
|
256
|
-
getOwnerMeetingId: sinon.stub().returns(undefined),
|
|
257
|
-
refreshDataChannelToken: sinon.stub().resolves({
|
|
258
|
-
body: {
|
|
259
|
-
datachannelToken: 'token-from-llm-fallback',
|
|
260
|
-
dataChannelTokenType: 'llm-default-session',
|
|
261
|
-
},
|
|
262
|
-
}),
|
|
263
|
-
setDatachannelToken: sinon.stub(),
|
|
257
|
+
getChannelByDatachannelUrl: sinon.stub().returns(undefined),
|
|
264
258
|
};
|
|
265
259
|
|
|
266
260
|
meetingsMock = {
|
|
267
|
-
|
|
261
|
+
getAllMeetings: sinon.stub().returns({}),
|
|
268
262
|
};
|
|
269
263
|
|
|
270
264
|
const context = {
|
|
@@ -275,96 +269,41 @@ describe('plugin-meetings', () => {
|
|
|
275
269
|
dispatcherInterceptor = Reflect.apply(DataChannelAuthTokenInterceptor.create, context, []);
|
|
276
270
|
});
|
|
277
271
|
|
|
278
|
-
it('routes
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
.withArgs('llm-practice-session')
|
|
282
|
-
.resolves({
|
|
272
|
+
it('routes request URL to matching channel', async () => {
|
|
273
|
+
const mockChannel = {
|
|
274
|
+
refreshDataChannelToken: sinon.stub().resolves({
|
|
283
275
|
body: {
|
|
284
|
-
datachannelToken: 'token-from-
|
|
276
|
+
datachannelToken: 'token-from-channel',
|
|
285
277
|
dataChannelTokenType: 'llm-practice-session',
|
|
286
278
|
},
|
|
287
|
-
})
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
expect(token).to.equal('token-from-ps-session');
|
|
292
|
-
sinon.assert.calledOnceWithExactly(llmMock.refreshDataChannelToken, 'llm-practice-session');
|
|
293
|
-
sinon.assert.calledOnceWithExactly(
|
|
294
|
-
llmMock.setDatachannelToken,
|
|
295
|
-
'token-from-ps-session',
|
|
296
|
-
'llm-practice-session',
|
|
297
|
-
undefined
|
|
298
|
-
);
|
|
299
|
-
});
|
|
300
|
-
|
|
301
|
-
it('routes non-PS URL to default session handler', async () => {
|
|
302
|
-
llmMock.getSessionIdByDatachannelUrl.withArgs(DEFAULT_DATACHANNEL_URL).returns('llm-default-session');
|
|
303
|
-
llmMock.refreshDataChannelToken
|
|
304
|
-
.withArgs('llm-default-session')
|
|
305
|
-
.resolves({
|
|
306
|
-
body: {
|
|
307
|
-
datachannelToken: 'token-from-default-session',
|
|
308
|
-
dataChannelTokenType: 'llm-default-session',
|
|
309
|
-
},
|
|
310
|
-
});
|
|
311
|
-
|
|
312
|
-
const token = await dispatcherInterceptor._refreshDataChannelToken(DEFAULT_DATACHANNEL_URL);
|
|
313
|
-
|
|
314
|
-
expect(token).to.equal('token-from-default-session');
|
|
315
|
-
sinon.assert.calledOnceWithExactly(llmMock.refreshDataChannelToken, 'llm-default-session');
|
|
316
|
-
sinon.assert.calledOnceWithExactly(
|
|
317
|
-
llmMock.setDatachannelToken,
|
|
318
|
-
'token-from-default-session',
|
|
319
|
-
'llm-default-session',
|
|
320
|
-
undefined
|
|
321
|
-
);
|
|
322
|
-
});
|
|
323
|
-
|
|
324
|
-
it('falls back to default refresh when URL does not match any session or meeting route', async () => {
|
|
325
|
-
llmMock.getSessionIdByDatachannelUrl.withArgs(PS_DATACHANNEL_URL).returns(undefined);
|
|
326
|
-
llmMock.getLocusUrlByDatachannelUrl.withArgs(PS_DATACHANNEL_URL).returns(undefined);
|
|
327
|
-
llmMock.refreshDataChannelToken.withArgs(undefined).resolves({
|
|
328
|
-
body: {
|
|
329
|
-
datachannelToken: 'token-from-default-fallback',
|
|
330
|
-
dataChannelTokenType: 'llm-default-session',
|
|
331
|
-
},
|
|
332
|
-
});
|
|
279
|
+
}),
|
|
280
|
+
setDatachannelToken: sinon.stub(),
|
|
281
|
+
};
|
|
282
|
+
llmMock.getChannelByDatachannelUrl.withArgs(PS_DATACHANNEL_URL).returns(mockChannel);
|
|
333
283
|
|
|
334
284
|
const token = await dispatcherInterceptor._refreshDataChannelToken(PS_DATACHANNEL_URL);
|
|
335
285
|
|
|
336
|
-
expect(token).to.equal('token-from-
|
|
337
|
-
sinon.assert.calledOnceWithExactly(llmMock.refreshDataChannelToken, undefined);
|
|
286
|
+
expect(token).to.equal('token-from-channel');
|
|
338
287
|
sinon.assert.calledOnceWithExactly(
|
|
339
|
-
llmMock.
|
|
340
|
-
|
|
341
|
-
'llm-default-session',
|
|
342
|
-
undefined
|
|
288
|
+
llmMock.getChannelByDatachannelUrl,
|
|
289
|
+
PS_DATACHANNEL_URL
|
|
343
290
|
);
|
|
291
|
+
sinon.assert.calledOnceWithExactly(mockChannel.refreshDataChannelToken);
|
|
292
|
+
sinon.assert.calledOnceWithExactly(mockChannel.setDatachannelToken, 'token-from-channel');
|
|
344
293
|
});
|
|
345
294
|
|
|
346
|
-
it('falls back to meeting lookup
|
|
347
|
-
llmMock.
|
|
348
|
-
llmMock.getLocusUrlByDatachannelUrl.withArgs(PS_DATACHANNEL_URL).returns('https://locus-a.example.com');
|
|
349
|
-
meetingsMock.getMeetingByType.withArgs(LOCUS_URL, 'https://locus-a.example.com').returns(meetingA);
|
|
295
|
+
it('falls back to meeting lookup when no channel matches', async () => {
|
|
296
|
+
llmMock.getChannelByDatachannelUrl.returns(undefined);
|
|
350
297
|
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
'token-from-meeting-a',
|
|
359
|
-
'llm-practice-session',
|
|
360
|
-
'meeting-a'
|
|
361
|
-
);
|
|
362
|
-
});
|
|
298
|
+
// Import the static method for matching datachannel URLs
|
|
299
|
+
const LLMChannel = require('@webex/internal-plugin-llm').default;
|
|
300
|
+
sinon
|
|
301
|
+
.stub(LLMChannel, 'matchesDatachannelRequestUrl')
|
|
302
|
+
.callsFake((requestUrl, datachannelUrl) => {
|
|
303
|
+
return requestUrl === PS_DATACHANNEL_URL && datachannelUrl === PS_DATACHANNEL_URL;
|
|
304
|
+
});
|
|
363
305
|
|
|
364
|
-
|
|
365
|
-
llmMock.getSessionIdByDatachannelUrl.withArgs(PS_DATACHANNEL_URL).returns(undefined);
|
|
366
|
-
llmMock.getLocusUrlByDatachannelUrl.withArgs(PS_DATACHANNEL_URL).returns(undefined);
|
|
367
|
-
meetingsMock.getAllMeetings = sinon.stub().returns({
|
|
306
|
+
meetingsMock.getAllMeetings.returns({
|
|
368
307
|
'meeting-a': {
|
|
369
308
|
...meetingA,
|
|
370
309
|
locusInfo: {
|
|
@@ -380,25 +319,68 @@ describe('plugin-meetings', () => {
|
|
|
380
319
|
|
|
381
320
|
expect(token).to.equal('token-from-meeting-a');
|
|
382
321
|
sinon.assert.calledOnceWithExactly(meetingA.refreshDataChannelToken);
|
|
383
|
-
sinon.assert.notCalled(llmMock.refreshDataChannelToken);
|
|
384
322
|
sinon.assert.calledOnceWithExactly(
|
|
385
|
-
|
|
386
|
-
'token-from-meeting-a'
|
|
387
|
-
'llm-practice-session',
|
|
388
|
-
'meeting-a'
|
|
323
|
+
meetingA.setLLMChannelDataToken,
|
|
324
|
+
'token-from-meeting-a'
|
|
389
325
|
);
|
|
326
|
+
|
|
327
|
+
LLMChannel.matchesDatachannelRequestUrl.restore();
|
|
390
328
|
});
|
|
391
329
|
|
|
392
|
-
it('throws when
|
|
393
|
-
llmMock.
|
|
394
|
-
|
|
330
|
+
it('throws when no channel or meeting matches', async () => {
|
|
331
|
+
llmMock.getChannelByDatachannelUrl.returns(undefined);
|
|
332
|
+
meetingsMock.getAllMeetings.returns({});
|
|
395
333
|
|
|
396
334
|
await assert.isRejected(
|
|
397
335
|
dispatcherInterceptor._refreshDataChannelToken(
|
|
398
336
|
'https://unknown-datachannel.example.com/registrations'
|
|
399
337
|
),
|
|
338
|
+
/No LLM channel or meeting found for request URL/
|
|
339
|
+
);
|
|
340
|
+
});
|
|
341
|
+
|
|
342
|
+
it('throws when channel refresh returns no payload', async () => {
|
|
343
|
+
const mockChannel = {
|
|
344
|
+
refreshDataChannelToken: sinon.stub().resolves(null),
|
|
345
|
+
setDatachannelToken: sinon.stub(),
|
|
346
|
+
};
|
|
347
|
+
llmMock.getChannelByDatachannelUrl.returns(mockChannel);
|
|
348
|
+
|
|
349
|
+
await assert.isRejected(
|
|
350
|
+
dispatcherInterceptor._refreshDataChannelToken(PS_DATACHANNEL_URL),
|
|
351
|
+
/DataChannel token refresh returned no payload/
|
|
352
|
+
);
|
|
353
|
+
});
|
|
354
|
+
|
|
355
|
+
it('throws when meeting refresh returns no payload', async () => {
|
|
356
|
+
llmMock.getChannelByDatachannelUrl.returns(undefined);
|
|
357
|
+
|
|
358
|
+
const LLMChannel = require('@webex/internal-plugin-llm').default;
|
|
359
|
+
sinon.stub(LLMChannel, 'matchesDatachannelRequestUrl').returns(true);
|
|
360
|
+
|
|
361
|
+
const meetingWithNoPayload = {
|
|
362
|
+
id: 'meeting-b',
|
|
363
|
+
refreshDataChannelToken: sinon.stub().resolves(null),
|
|
364
|
+
setLLMChannelDataToken: sinon.stub(),
|
|
365
|
+
};
|
|
366
|
+
|
|
367
|
+
meetingsMock.getAllMeetings.returns({
|
|
368
|
+
'meeting-b': {
|
|
369
|
+
...meetingWithNoPayload,
|
|
370
|
+
locusInfo: {
|
|
371
|
+
info: {
|
|
372
|
+
datachannelUrl: PS_DATACHANNEL_URL,
|
|
373
|
+
},
|
|
374
|
+
},
|
|
375
|
+
},
|
|
376
|
+
});
|
|
377
|
+
|
|
378
|
+
await assert.isRejected(
|
|
379
|
+
dispatcherInterceptor._refreshDataChannelToken(PS_DATACHANNEL_URL),
|
|
400
380
|
/DataChannel token refresh returned no payload/
|
|
401
381
|
);
|
|
382
|
+
|
|
383
|
+
LLMChannel.matchesDatachannelRequestUrl.restore();
|
|
402
384
|
});
|
|
403
385
|
});
|
|
404
386
|
});
|