@webex/plugin-meetings 3.11.0 → 3.12.0-llmrefactor.2
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/AGENTS.md +9 -0
- package/dist/aiEnableRequest/index.js +197 -0
- package/dist/aiEnableRequest/index.js.map +1 -0
- package/dist/aiEnableRequest/utils.js +36 -0
- package/dist/aiEnableRequest/utils.js.map +1 -0
- package/dist/annotation/index.js +60 -15
- package/dist/annotation/index.js.map +1 -1
- package/dist/breakouts/breakout.js +8 -3
- package/dist/breakouts/breakout.js.map +1 -1
- package/dist/breakouts/events.js +29 -14
- package/dist/breakouts/events.js.map +1 -1
- package/dist/breakouts/index.js +128 -7
- package/dist/breakouts/index.js.map +1 -1
- package/dist/common/errors/webex-errors.js +49 -5
- package/dist/common/errors/webex-errors.js.map +1 -1
- package/dist/config.js +8 -3
- package/dist/config.js.map +1 -1
- package/dist/constants.js +60 -11
- package/dist/constants.js.map +1 -1
- package/dist/controls-options-manager/constants.js +11 -1
- package/dist/controls-options-manager/constants.js.map +1 -1
- package/dist/controls-options-manager/index.js +67 -29
- package/dist/controls-options-manager/index.js.map +1 -1
- package/dist/controls-options-manager/util.js +91 -0
- package/dist/controls-options-manager/util.js.map +1 -1
- package/dist/hashTree/constants.js +16 -2
- package/dist/hashTree/constants.js.map +1 -1
- package/dist/hashTree/hashTree.js +18 -0
- package/dist/hashTree/hashTree.js.map +1 -1
- package/dist/hashTree/hashTreeParser.js +1655 -538
- package/dist/hashTree/hashTreeParser.js.map +1 -1
- package/dist/hashTree/types.js +4 -2
- package/dist/hashTree/types.js.map +1 -1
- package/dist/hashTree/utils.js +52 -0
- package/dist/hashTree/utils.js.map +1 -1
- package/dist/index.js +18 -2
- package/dist/index.js.map +1 -1
- package/dist/interceptors/constant.js +12 -0
- package/dist/interceptors/constant.js.map +1 -0
- package/dist/interceptors/dataChannelAuthToken.js +332 -0
- package/dist/interceptors/dataChannelAuthToken.js.map +1 -0
- package/dist/interceptors/index.js +7 -0
- package/dist/interceptors/index.js.map +1 -1
- package/dist/interceptors/locusRetry.js +23 -8
- package/dist/interceptors/locusRetry.js.map +1 -1
- package/dist/interceptors/utils.js +27 -0
- package/dist/interceptors/utils.js.map +1 -0
- package/dist/interpretation/index.js +11 -2
- package/dist/interpretation/index.js.map +1 -1
- package/dist/interpretation/interpretation.types.js +7 -0
- package/dist/interpretation/interpretation.types.js.map +1 -0
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/locus-info/controlsUtils.js +9 -4
- package/dist/locus-info/controlsUtils.js.map +1 -1
- package/dist/locus-info/index.js +914 -212
- package/dist/locus-info/index.js.map +1 -1
- package/dist/locus-info/infoUtils.js +36 -5
- package/dist/locus-info/infoUtils.js.map +1 -1
- package/dist/locus-info/selfUtils.js +1 -0
- package/dist/locus-info/selfUtils.js.map +1 -1
- package/dist/locus-info/types.js +19 -0
- package/dist/locus-info/types.js.map +1 -1
- package/dist/media/MediaConnectionAwaiter.js +72 -3
- package/dist/media/MediaConnectionAwaiter.js.map +1 -1
- package/dist/media/index.js +8 -2
- package/dist/media/index.js.map +1 -1
- package/dist/media/properties.js +8 -7
- package/dist/media/properties.js.map +1 -1
- package/dist/meeting/in-meeting-actions.js +11 -1
- package/dist/meeting/in-meeting-actions.js.map +1 -1
- package/dist/meeting/index.js +2287 -1118
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/locusMediaRequest.js +229 -82
- package/dist/meeting/locusMediaRequest.js.map +1 -1
- package/dist/meeting/muteState.js +10 -1
- package/dist/meeting/muteState.js.map +1 -1
- package/dist/meeting/request.js +55 -2
- package/dist/meeting/request.js.map +1 -1
- package/dist/meeting/request.type.js.map +1 -1
- package/dist/meeting/util.js +168 -5
- package/dist/meeting/util.js.map +1 -1
- package/dist/meeting-info/meeting-info-v2.js +2 -2
- package/dist/meeting-info/meeting-info-v2.js.map +1 -1
- package/dist/meetings/index.js +369 -162
- package/dist/meetings/index.js.map +1 -1
- package/dist/meetings/meetings.types.js +6 -1
- package/dist/meetings/meetings.types.js.map +1 -1
- package/dist/meetings/request.js +39 -0
- package/dist/meetings/request.js.map +1 -1
- package/dist/meetings/util.js +116 -18
- package/dist/meetings/util.js.map +1 -1
- package/dist/member/index.js +20 -0
- package/dist/member/index.js.map +1 -1
- package/dist/member/types.js.map +1 -1
- package/dist/member/util.js +40 -0
- package/dist/member/util.js.map +1 -1
- package/dist/members/index.js +101 -43
- package/dist/members/index.js.map +1 -1
- package/dist/members/util.js +8 -1
- package/dist/members/util.js.map +1 -1
- package/dist/metrics/constants.js +12 -1
- package/dist/metrics/constants.js.map +1 -1
- package/dist/multistream/codec/constants.js +63 -0
- package/dist/multistream/codec/constants.js.map +1 -0
- package/dist/multistream/mediaRequestManager.js +64 -68
- package/dist/multistream/mediaRequestManager.js.map +1 -1
- package/dist/multistream/receiveSlot.js +9 -0
- package/dist/multistream/receiveSlot.js.map +1 -1
- package/dist/multistream/remoteMediaManager.js +11 -0
- package/dist/multistream/remoteMediaManager.js.map +1 -1
- package/dist/multistream/sendSlotManager.js +116 -2
- package/dist/multistream/sendSlotManager.js.map +1 -1
- package/dist/reachability/clusterReachability.js.map +1 -1
- package/dist/reachability/index.js +139 -93
- package/dist/reachability/index.js.map +1 -1
- package/dist/reachability/reachability.types.js +2 -0
- package/dist/reachability/reachability.types.js.map +1 -1
- package/dist/reachability/util.js +45 -0
- package/dist/reachability/util.js.map +1 -1
- package/dist/reactions/reactions.type.js.map +1 -1
- package/dist/reconnection-manager/index.js +0 -1
- package/dist/reconnection-manager/index.js.map +1 -1
- package/dist/recording-controller/index.js +1 -3
- package/dist/recording-controller/index.js.map +1 -1
- package/dist/roap/turnDiscovery.js +8 -1
- package/dist/roap/turnDiscovery.js.map +1 -1
- package/dist/types/aiEnableRequest/index.d.ts +5 -0
- package/dist/types/aiEnableRequest/utils.d.ts +2 -0
- package/dist/types/annotation/index.d.ts +19 -0
- package/dist/types/common/errors/webex-errors.d.ts +32 -2
- package/dist/types/config.d.ts +6 -2
- package/dist/types/constants.d.ts +35 -1
- package/dist/types/controls-options-manager/constants.d.ts +6 -1
- package/dist/types/controls-options-manager/index.d.ts +16 -0
- package/dist/types/hashTree/constants.d.ts +3 -0
- package/dist/types/hashTree/hashTree.d.ts +7 -0
- package/dist/types/hashTree/hashTreeParser.d.ts +315 -30
- package/dist/types/hashTree/types.d.ts +3 -0
- package/dist/types/hashTree/utils.d.ts +24 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/interceptors/constant.d.ts +5 -0
- package/dist/types/interceptors/dataChannelAuthToken.d.ts +43 -0
- package/dist/types/interceptors/index.d.ts +2 -1
- package/dist/types/interceptors/locusRetry.d.ts +4 -4
- package/dist/types/interceptors/utils.d.ts +1 -0
- package/dist/types/interpretation/interpretation.types.d.ts +10 -0
- package/dist/types/locus-info/index.d.ts +126 -15
- package/dist/types/locus-info/infoUtils.d.ts +8 -0
- package/dist/types/locus-info/types.d.ts +28 -1
- package/dist/types/media/MediaConnectionAwaiter.d.ts +20 -2
- package/dist/types/media/properties.d.ts +8 -3
- package/dist/types/meeting/in-meeting-actions.d.ts +10 -0
- package/dist/types/meeting/index.d.ts +271 -16
- package/dist/types/meeting/locusMediaRequest.d.ts +12 -0
- package/dist/types/meeting/request.d.ts +17 -1
- package/dist/types/meeting/request.type.d.ts +5 -0
- package/dist/types/meeting/util.d.ts +40 -0
- package/dist/types/meetings/index.d.ts +42 -20
- package/dist/types/meetings/meetings.types.d.ts +15 -0
- package/dist/types/meetings/request.d.ts +14 -0
- package/dist/types/member/index.d.ts +2 -0
- package/dist/types/member/types.d.ts +1 -0
- package/dist/types/member/util.d.ts +14 -0
- package/dist/types/members/index.d.ts +15 -2
- package/dist/types/members/util.d.ts +1 -5
- package/dist/types/metrics/constants.d.ts +11 -0
- package/dist/types/multistream/codec/constants.d.ts +7 -0
- package/dist/types/multistream/mediaRequestManager.d.ts +20 -26
- package/dist/types/multistream/sendSlotManager.d.ts +23 -1
- package/dist/types/reachability/clusterReachability.d.ts +3 -3
- package/dist/types/reachability/index.d.ts +10 -3
- package/dist/types/reachability/reachability.types.d.ts +7 -0
- package/dist/types/reachability/util.d.ts +17 -0
- package/dist/types/reactions/reactions.type.d.ts +4 -0
- package/dist/types/webinar/utils.d.ts +6 -0
- package/dist/webinar/index.js +612 -165
- package/dist/webinar/index.js.map +1 -1
- package/dist/webinar/utils.js +25 -0
- package/dist/webinar/utils.js.map +1 -0
- package/package.json +24 -23
- package/src/aiEnableRequest/README.md +84 -0
- package/src/aiEnableRequest/index.ts +186 -0
- package/src/aiEnableRequest/utils.ts +25 -0
- package/src/annotation/index.ts +67 -15
- package/src/breakouts/breakout.ts +3 -1
- package/src/breakouts/events.ts +33 -11
- package/src/breakouts/index.ts +145 -3
- package/src/common/errors/webex-errors.ts +50 -3
- package/src/config.ts +6 -2
- package/src/constants.ts +49 -3
- package/src/controls-options-manager/constants.ts +14 -1
- package/src/controls-options-manager/index.ts +87 -28
- package/src/controls-options-manager/util.ts +81 -1
- package/src/hashTree/constants.ts +17 -0
- package/src/hashTree/hashTree.ts +17 -0
- package/src/hashTree/hashTreeParser.ts +1482 -361
- package/src/hashTree/types.ts +4 -0
- package/src/hashTree/utils.ts +45 -0
- package/src/index.ts +14 -1
- package/src/interceptors/constant.ts +6 -0
- package/src/interceptors/dataChannelAuthToken.ts +217 -0
- package/src/interceptors/index.ts +2 -1
- package/src/interceptors/locusRetry.ts +25 -4
- package/src/interceptors/utils.ts +16 -0
- package/src/interpretation/index.ts +29 -11
- package/src/interpretation/interpretation.types.ts +11 -0
- package/src/locus-info/controlsUtils.ts +14 -1
- package/src/locus-info/index.ts +976 -203
- package/src/locus-info/infoUtils.ts +41 -6
- package/src/locus-info/selfUtils.ts +1 -0
- package/src/locus-info/types.ts +33 -1
- package/src/media/MediaConnectionAwaiter.ts +62 -5
- package/src/media/index.ts +10 -1
- package/src/media/properties.ts +11 -4
- package/src/meeting/in-meeting-actions.ts +20 -0
- package/src/meeting/index.ts +1258 -222
- package/src/meeting/locusMediaRequest.ts +106 -6
- package/src/meeting/muteState.ts +10 -1
- package/src/meeting/request.ts +53 -0
- package/src/meeting/request.type.ts +6 -0
- package/src/meeting/util.ts +207 -7
- package/src/meeting-info/meeting-info-v2.ts +4 -2
- package/src/meetings/index.ts +319 -117
- package/src/meetings/meetings.types.ts +19 -0
- package/src/meetings/request.ts +43 -0
- package/src/meetings/util.ts +117 -4
- package/src/member/index.ts +20 -0
- package/src/member/types.ts +1 -0
- package/src/member/util.ts +41 -0
- package/src/members/index.ts +70 -7
- package/src/members/util.ts +12 -4
- package/src/metrics/constants.ts +12 -0
- package/src/multistream/codec/constants.ts +58 -0
- package/src/multistream/mediaRequestManager.ts +117 -76
- package/src/multistream/receiveSlot.ts +18 -0
- package/src/multistream/remoteMediaManager.ts +13 -0
- package/src/multistream/sendSlotManager.ts +97 -3
- package/src/reachability/clusterReachability.ts +3 -2
- package/src/reachability/index.ts +56 -16
- package/src/reachability/reachability.types.ts +11 -0
- package/src/reachability/util.ts +36 -0
- package/src/reactions/reactions.type.ts +4 -0
- package/src/reconnection-manager/index.ts +0 -1
- package/src/recording-controller/index.ts +1 -2
- package/src/roap/turnDiscovery.ts +9 -1
- package/src/webinar/index.ts +416 -12
- package/src/webinar/utils.ts +16 -0
- package/test/unit/spec/aiEnableRequest/index.ts +1067 -0
- package/test/unit/spec/aiEnableRequest/utils.ts +130 -0
- package/test/unit/spec/annotation/index.ts +228 -134
- package/test/unit/spec/breakouts/breakout.ts +9 -3
- package/test/unit/spec/breakouts/events.ts +120 -2
- package/test/unit/spec/breakouts/index.ts +331 -15
- package/test/unit/spec/common/errors/webex-errors.ts +78 -0
- package/test/unit/spec/controls-options-manager/index.js +244 -29
- package/test/unit/spec/controls-options-manager/util.js +165 -0
- package/test/unit/spec/hashTree/hashTree.ts +66 -0
- package/test/unit/spec/hashTree/hashTreeParser.ts +4528 -171
- package/test/unit/spec/hashTree/utils.ts +125 -1
- package/test/unit/spec/interceptors/dataChannelAuthToken.ts +388 -0
- package/test/unit/spec/interceptors/locusRetry.ts +205 -4
- package/test/unit/spec/interceptors/utils.ts +75 -0
- package/test/unit/spec/interpretation/index.ts +26 -4
- package/test/unit/spec/locus-info/controlsUtils.js +200 -56
- package/test/unit/spec/locus-info/index.js +1861 -149
- package/test/unit/spec/locus-info/infoUtils.js +184 -1
- package/test/unit/spec/media/MediaConnectionAwaiter.ts +96 -1
- package/test/unit/spec/media/index.ts +92 -0
- package/test/unit/spec/media/properties.ts +35 -26
- package/test/unit/spec/meeting/in-meeting-actions.ts +12 -2
- package/test/unit/spec/meeting/index.js +3694 -450
- package/test/unit/spec/meeting/locusMediaRequest.ts +406 -4
- package/test/unit/spec/meeting/muteState.js +81 -0
- package/test/unit/spec/meeting/request.js +82 -0
- package/test/unit/spec/meeting/utils.js +595 -27
- package/test/unit/spec/meeting-info/meetinginfov2.js +19 -10
- package/test/unit/spec/meetings/index.js +1138 -86
- package/test/unit/spec/meetings/request.js +141 -0
- package/test/unit/spec/meetings/utils.js +402 -51
- package/test/unit/spec/member/index.js +35 -4
- package/test/unit/spec/member/util.js +154 -27
- package/test/unit/spec/members/index.js +216 -0
- package/test/unit/spec/members/request.js +37 -1
- package/test/unit/spec/members/utils.js +63 -0
- package/test/unit/spec/multistream/mediaRequestManager.ts +503 -122
- package/test/unit/spec/multistream/remoteMediaManager.ts +30 -0
- package/test/unit/spec/multistream/sendSlotManager.ts +135 -36
- package/test/unit/spec/reachability/index.ts +151 -46
- package/test/unit/spec/reachability/util.ts +31 -0
- package/test/unit/spec/reconnection-manager/index.js +4 -8
- package/test/unit/spec/recording-controller/index.js +9 -8
- package/test/unit/spec/roap/turnDiscovery.ts +20 -0
- package/test/unit/spec/webinar/index.ts +1087 -167
- package/test/unit/spec/webinar/utils.ts +39 -0
|
@@ -8,12 +8,33 @@ import LLMChannel from '@webex/internal-plugin-llm';
|
|
|
8
8
|
import AnnotationService from '../../../../src/annotation/index';
|
|
9
9
|
import {ANNOTATION_RELAY_TYPES, ANNOTATION_REQUEST_TYPE, EVENT_TRIGGERS} from '../../../../src/annotation/constants';
|
|
10
10
|
|
|
11
|
+
/**
|
|
12
|
+
* Creates a mock LLM channel for testing
|
|
13
|
+
* @param {Object} [options] - Options for the mock channel
|
|
14
|
+
* @param {boolean} [options.isConnected=true] - Whether the channel is connected
|
|
15
|
+
* @param {string} [options.binding] - The binding string
|
|
16
|
+
* @returns {Object} Mock channel
|
|
17
|
+
*/
|
|
18
|
+
function createMockLLMChannel(options: {isConnected?: boolean; binding?: string} = {}) {
|
|
19
|
+
const mockWebSocket = new MockWebSocket();
|
|
20
|
+
const {isConnected = true, binding = 'binding'} = options;
|
|
21
|
+
|
|
22
|
+
return {
|
|
23
|
+
isConnected: sinon.stub().returns(isConnected),
|
|
24
|
+
getSocket: sinon.stub().returns(mockWebSocket),
|
|
25
|
+
getBinding: sinon.stub().returns(binding),
|
|
26
|
+
getLocusUrl: sinon.stub().returns('locusUrl'),
|
|
27
|
+
on: sinon.stub(),
|
|
28
|
+
off: sinon.stub(),
|
|
29
|
+
socket: mockWebSocket,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
11
32
|
|
|
12
33
|
describe('live-annotation', () => {
|
|
13
34
|
const locusUrl = 'https://locus.wbx2.com/locus/api/v1/loci/163c1787-c1f5-47cc-95eb-ab2d660999e6';
|
|
14
35
|
|
|
15
36
|
describe('annotation', () => {
|
|
16
|
-
let webex, annotationService;
|
|
37
|
+
let webex, annotationService, mockChannel;
|
|
17
38
|
|
|
18
39
|
beforeEach(() => {
|
|
19
40
|
webex = new MockWebex({
|
|
@@ -24,25 +45,56 @@ describe('live-annotation', () => {
|
|
|
24
45
|
},
|
|
25
46
|
});
|
|
26
47
|
|
|
27
|
-
|
|
28
48
|
annotationService = webex.internal.annotation;
|
|
29
|
-
annotationService.connect = sinon.stub().resolves(true);
|
|
30
|
-
annotationService.webex.internal.llm.isConnected = sinon.stub().returns(true);
|
|
31
|
-
annotationService.webex.internal.llm.getBinding = sinon.stub().returns(undefined);
|
|
32
|
-
annotationService.webex.internal.llm.getLocusUrl = sinon.stub().returns(locusUrl);
|
|
33
49
|
annotationService.approvalUrl = 'url/approval';
|
|
34
50
|
annotationService.locusUrl = locusUrl;
|
|
35
51
|
|
|
52
|
+
mockChannel = createMockLLMChannel();
|
|
36
53
|
|
|
37
54
|
webex.request = sinon.stub().returns(Promise.resolve('REQUEST_RETURN_VALUE'));
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
afterEach(() => {
|
|
58
|
+
annotationService.unregisterChannel();
|
|
59
|
+
sinon.restore();
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
describe('#registerChannel', () => {
|
|
63
|
+
it('registers an LLM channel and subscribes to relay events', () => {
|
|
64
|
+
annotationService.registerChannel(mockChannel);
|
|
65
|
+
|
|
66
|
+
assert.calledOnceWithExactly(mockChannel.on, 'event:relay.event', sinon.match.func);
|
|
67
|
+
assert.equal(annotationService.channel, mockChannel);
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
it('unregisters existing channel before registering new one', () => {
|
|
71
|
+
const oldChannel = createMockLLMChannel();
|
|
72
|
+
annotationService.registerChannel(oldChannel);
|
|
73
|
+
|
|
74
|
+
const newChannel = createMockLLMChannel();
|
|
75
|
+
annotationService.registerChannel(newChannel);
|
|
76
|
+
|
|
77
|
+
assert.calledOnceWithExactly(oldChannel.off, 'event:relay.event', sinon.match.func);
|
|
78
|
+
assert.calledOnceWithExactly(newChannel.on, 'event:relay.event', sinon.match.func);
|
|
79
|
+
assert.equal(annotationService.channel, newChannel);
|
|
43
80
|
});
|
|
44
81
|
});
|
|
45
82
|
|
|
83
|
+
describe('#unregisterChannel', () => {
|
|
84
|
+
it('unregisters the current channel', () => {
|
|
85
|
+
annotationService.registerChannel(mockChannel);
|
|
86
|
+
annotationService.unregisterChannel();
|
|
87
|
+
|
|
88
|
+
assert.calledOnceWithExactly(mockChannel.off, 'event:relay.event', sinon.match.func);
|
|
89
|
+
assert.equal(annotationService.channel, undefined);
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
it('does nothing if no channel is registered', () => {
|
|
93
|
+
annotationService.unregisterChannel();
|
|
94
|
+
// Should not throw
|
|
95
|
+
assert.equal(annotationService.channel, undefined);
|
|
96
|
+
});
|
|
97
|
+
});
|
|
46
98
|
|
|
47
99
|
describe('event message processing', () => {
|
|
48
100
|
beforeEach(async () => {
|
|
@@ -55,10 +107,8 @@ describe('live-annotation', () => {
|
|
|
55
107
|
annotationService.eventCommandProcessor({});
|
|
56
108
|
assert.notCalled(spy);
|
|
57
109
|
|
|
58
|
-
|
|
59
110
|
annotationService.eventCommandProcessor({
|
|
60
|
-
data: {
|
|
61
|
-
}
|
|
111
|
+
data: {}
|
|
62
112
|
});
|
|
63
113
|
assert.notCalled(spy);
|
|
64
114
|
|
|
@@ -92,11 +142,9 @@ describe('live-annotation', () => {
|
|
|
92
142
|
}
|
|
93
143
|
}
|
|
94
144
|
});
|
|
95
|
-
assert.notCalled(spy)
|
|
145
|
+
assert.notCalled(spy);
|
|
96
146
|
});
|
|
97
147
|
|
|
98
|
-
|
|
99
|
-
|
|
100
148
|
it('eventCommandProcessor call success', () => {
|
|
101
149
|
const spy = sinon.spy();
|
|
102
150
|
annotationService.on(EVENT_TRIGGERS.ANNOTATION_COMMAND, spy);
|
|
@@ -121,74 +169,82 @@ describe('live-annotation', () => {
|
|
|
121
169
|
});
|
|
122
170
|
|
|
123
171
|
it('eventDataProcessor call failed', () => {
|
|
124
|
-
|
|
125
|
-
const spy = sinon.spy(annotationService, "processStrokeMessage");
|
|
172
|
+
const spy = sinon.spy(annotationService, 'processStrokeMessage');
|
|
126
173
|
|
|
127
174
|
annotationService.eventDataProcessor();
|
|
128
|
-
|
|
129
175
|
assert.notCalled(spy);
|
|
130
176
|
|
|
131
177
|
annotationService.eventDataProcessor({data: {}});
|
|
132
|
-
|
|
133
178
|
assert.notCalled(spy);
|
|
134
179
|
|
|
135
180
|
annotationService.eventDataProcessor({data: {relayType: 'NOT:annotation.client'}});
|
|
136
|
-
|
|
137
181
|
assert.notCalled(spy);
|
|
138
182
|
});
|
|
139
183
|
|
|
140
|
-
|
|
141
184
|
it('eventDataProcessor call success', () => {
|
|
185
|
+
const spy = sinon.spy(annotationService, 'processStrokeMessage');
|
|
142
186
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
187
|
+
annotationService.eventDataProcessor({
|
|
188
|
+
data: {
|
|
189
|
+
relayType: 'annotation.client',
|
|
190
|
+
request: {value: {encryptionKeyUrl: 'encryptionKeyUrl'}}
|
|
191
|
+
}
|
|
192
|
+
});
|
|
146
193
|
|
|
147
194
|
assert.calledOnceWithExactly(spy, {
|
|
148
195
|
relayType: 'annotation.client',
|
|
149
|
-
request: {
|
|
150
|
-
}
|
|
151
|
-
|
|
196
|
+
request: {value: {encryptionKeyUrl: 'encryptionKeyUrl'}}
|
|
197
|
+
});
|
|
152
198
|
});
|
|
153
199
|
|
|
154
|
-
|
|
155
200
|
it('processStrokeMessage', async () => {
|
|
156
201
|
const spy = sinon.spy();
|
|
157
202
|
annotationService.on(EVENT_TRIGGERS.ANNOTATION_STROKE_DATA, spy);
|
|
158
203
|
|
|
159
|
-
await annotationService.processStrokeMessage({
|
|
204
|
+
await annotationService.processStrokeMessage({
|
|
205
|
+
request: {value: {encryptionKeyUrl: 'encryptionKeyUrl', content: 'content'}}
|
|
206
|
+
});
|
|
160
207
|
|
|
161
208
|
assert.calledOnceWithExactly(spy, {
|
|
162
|
-
payload:{request:{value:{encryptionKeyUrl: 'encryptionKeyUrl', content: 'decryptedContent'}}}
|
|
209
|
+
payload: {request: {value: {encryptionKeyUrl: 'encryptionKeyUrl', content: 'decryptedContent'}}},
|
|
163
210
|
});
|
|
164
|
-
|
|
165
211
|
});
|
|
166
|
-
|
|
167
212
|
});
|
|
168
213
|
|
|
169
|
-
describe('event
|
|
214
|
+
describe('event registration via registerChannel', () => {
|
|
215
|
+
it('registers relay event handler when channel is registered', () => {
|
|
216
|
+
annotationService.registerChannel(mockChannel);
|
|
170
217
|
|
|
171
|
-
|
|
218
|
+
assert.calledOnceWithExactly(mockChannel.on, 'event:relay.event', sinon.match.func);
|
|
219
|
+
});
|
|
172
220
|
|
|
173
|
-
|
|
221
|
+
it('processes events through the registered handler', () => {
|
|
222
|
+
annotationService.decryptContent = sinon.stub().returns(Promise.resolve('decryptedContent'));
|
|
223
|
+
annotationService.registerChannel(mockChannel);
|
|
174
224
|
|
|
175
|
-
|
|
225
|
+
// Get the handler that was registered
|
|
226
|
+
const handler = mockChannel.on.getCall(0).args[1];
|
|
176
227
|
|
|
177
|
-
|
|
178
|
-
|
|
228
|
+
const spy = sinon.spy(annotationService, 'processStrokeMessage');
|
|
229
|
+
handler({
|
|
230
|
+
data: {
|
|
231
|
+
relayType: 'annotation.client',
|
|
232
|
+
request: {value: {encryptionKeyUrl: 'key'}}
|
|
233
|
+
}
|
|
234
|
+
});
|
|
179
235
|
|
|
180
|
-
|
|
236
|
+
assert.calledOnce(spy);
|
|
237
|
+
});
|
|
181
238
|
|
|
182
|
-
|
|
239
|
+
it('listens to mercury events via listenToEvents', () => {
|
|
240
|
+
const spy = sinon.spy(annotationService.webex.internal.mercury, 'on');
|
|
183
241
|
|
|
184
242
|
annotationService.listenToEvents();
|
|
185
243
|
|
|
186
|
-
assert.calledOnceWithExactly(spy, 'event:
|
|
244
|
+
assert.calledOnceWithExactly(spy, 'event:locus.approval_request', sinon.match.func, sinon.match.object);
|
|
187
245
|
});
|
|
188
|
-
|
|
189
246
|
});
|
|
190
247
|
|
|
191
|
-
|
|
192
248
|
describe('encrypt/decrypt Content', () => {
|
|
193
249
|
beforeEach(async () => {
|
|
194
250
|
annotationService.webex.internal.encryption.encryptText = sinon.stub().returns(Promise.resolve('RETURN_VALUE'));
|
|
@@ -196,67 +252,72 @@ describe('live-annotation', () => {
|
|
|
196
252
|
});
|
|
197
253
|
|
|
198
254
|
it('encryptContent', async () => {
|
|
199
|
-
const result = await annotationService.encryptContent(
|
|
200
|
-
assert.calledOnceWithExactly(webex.internal.encryption.encryptText,
|
|
201
|
-
assert.equal(result, 'RETURN_VALUE')
|
|
255
|
+
const result = await annotationService.encryptContent('encryptionKeyUrl', 'content');
|
|
256
|
+
assert.calledOnceWithExactly(webex.internal.encryption.encryptText, 'encryptionKeyUrl', 'content');
|
|
257
|
+
assert.equal(result, 'RETURN_VALUE');
|
|
202
258
|
});
|
|
203
259
|
|
|
204
|
-
it('decryptContent', async() => {
|
|
205
|
-
const result =
|
|
206
|
-
assert.calledOnceWithExactly(webex.internal.encryption.decryptText,
|
|
207
|
-
assert.equal(result, 'RETURN_VALUE')
|
|
260
|
+
it('decryptContent', async () => {
|
|
261
|
+
const result = await annotationService.decryptContent('decryptionKeyUrl', 'content');
|
|
262
|
+
assert.calledOnceWithExactly(webex.internal.encryption.decryptText, 'decryptionKeyUrl', 'content');
|
|
263
|
+
assert.equal(result, 'RETURN_VALUE');
|
|
208
264
|
});
|
|
209
|
-
|
|
210
265
|
});
|
|
211
266
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
beforeEach(async () => {
|
|
217
|
-
annotationService.webex.internal.llm.socket = new MockWebSocket();
|
|
218
|
-
annotationService.webex.internal.llm.isConnected = sinon.stub().returns(false);
|
|
267
|
+
describe('publish Stroke Data with no channel registered', () => {
|
|
268
|
+
it('does not send when no channel is registered', async () => {
|
|
269
|
+
annotationService.sendStrokeData({});
|
|
270
|
+
// Should not throw, just return early
|
|
219
271
|
});
|
|
272
|
+
});
|
|
220
273
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
274
|
+
describe('publish Stroke Data with channel not connected', () => {
|
|
275
|
+
it('does not send when channel is not connected', async () => {
|
|
276
|
+
const disconnectedChannel = createMockLLMChannel({isConnected: false});
|
|
277
|
+
annotationService.registerChannel(disconnectedChannel);
|
|
225
278
|
|
|
279
|
+
annotationService.sendStrokeData({});
|
|
280
|
+
assert.notCalled(disconnectedChannel.socket.send);
|
|
281
|
+
});
|
|
226
282
|
});
|
|
227
283
|
|
|
228
284
|
describe('sendStrokeData', () => {
|
|
285
|
+
let strokeData;
|
|
229
286
|
|
|
230
287
|
beforeEach(async () => {
|
|
231
|
-
annotationService.
|
|
232
|
-
|
|
233
|
-
|
|
288
|
+
annotationService.registerChannel(mockChannel);
|
|
289
|
+
annotationService.webex.internal.encryption.encryptText = sinon.stub().returns(Promise.resolve('encryptedContent'));
|
|
234
290
|
|
|
235
|
-
|
|
236
|
-
const strokeData = {
|
|
291
|
+
strokeData = {
|
|
237
292
|
content: {
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
}],
|
|
244
|
-
|
|
293
|
+
contentsBuffer: [{
|
|
294
|
+
contentArray: [{
|
|
295
|
+
curveId: '58dcf45c-1fc5-46bf-a902-053621dd8977',
|
|
296
|
+
curvePoints: [592.593, 352.963, 3.400, 596.710, 352.963, 3.400],
|
|
297
|
+
stride: 3
|
|
298
|
+
}],
|
|
299
|
+
type: 'curve',
|
|
300
|
+
name: 'contentUpdate'
|
|
301
|
+
}],
|
|
302
|
+
action: 'contentUpdate',
|
|
303
|
+
sender: {name: 'perfect', id: '4dd5eaf9-4cf8-4f0f-a1d6-014bf5d00741'}
|
|
245
304
|
},
|
|
246
|
-
deviceId:
|
|
305
|
+
deviceId: '525ead98-6c93-4fcb-899d-517305c47513',
|
|
247
306
|
requesterId: '525ead98-6c93-4fcb-899d-517305c47513',
|
|
248
|
-
toUserId:
|
|
307
|
+
toUserId: '987ead98-6c93-4fcb-899d-517305c47503',
|
|
249
308
|
shareInstanceId: '7fa6fe07-dcb1-41ad-973d-7bcf65fab55d',
|
|
250
|
-
encryptionKeyUrl:
|
|
309
|
+
encryptionKeyUrl: 'encryptionKeyUrl',
|
|
251
310
|
version: '1',
|
|
252
|
-
}
|
|
311
|
+
};
|
|
312
|
+
});
|
|
253
313
|
|
|
314
|
+
it('works on publish Stroke Data', async () => {
|
|
254
315
|
annotationService.publishEncrypted(strokeData.content, strokeData);
|
|
255
316
|
|
|
256
317
|
const sendObject = {
|
|
257
318
|
id: sinon.match.string,
|
|
258
319
|
type: 'publishRequest',
|
|
259
|
-
recipients: {route:
|
|
320
|
+
recipients: [{route: 'binding'}],
|
|
260
321
|
headers: {to: '987ead98-6c93-4fcb-899d-517305c47503'},
|
|
261
322
|
data: {
|
|
262
323
|
eventType: 'relay.event',
|
|
@@ -266,7 +327,7 @@ describe('live-annotation', () => {
|
|
|
266
327
|
type: ANNOTATION_REQUEST_TYPE.ANNOTATION_MESSAGE,
|
|
267
328
|
content: strokeData.content,
|
|
268
329
|
version: '1',
|
|
269
|
-
seq:sinon.match.number,
|
|
330
|
+
seq: sinon.match.number,
|
|
270
331
|
deviceId: sinon.match.string,
|
|
271
332
|
requesterId: sinon.match.string,
|
|
272
333
|
shareInstanceId: strokeData.shareInstanceId,
|
|
@@ -280,23 +341,48 @@ describe('live-annotation', () => {
|
|
|
280
341
|
filterMessage: false,
|
|
281
342
|
};
|
|
282
343
|
|
|
283
|
-
assert.calledOnceWithExactly(
|
|
344
|
+
assert.calledOnceWithExactly(mockChannel.socket.send, sendObject);
|
|
284
345
|
});
|
|
285
346
|
|
|
286
|
-
|
|
347
|
+
it('does not send if socket is not available', () => {
|
|
348
|
+
const channelWithoutSocket = createMockLLMChannel();
|
|
349
|
+
channelWithoutSocket.getSocket.returns(undefined);
|
|
350
|
+
annotationService.registerChannel(channelWithoutSocket);
|
|
287
351
|
|
|
352
|
+
annotationService.publishEncrypted(strokeData.content, strokeData);
|
|
288
353
|
|
|
289
|
-
|
|
354
|
+
assert.notCalled(channelWithoutSocket.socket.send);
|
|
355
|
+
});
|
|
290
356
|
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
357
|
+
it('does not send if binding is not available', () => {
|
|
358
|
+
const channelWithoutBinding = createMockLLMChannel({binding: undefined});
|
|
359
|
+
channelWithoutBinding.getBinding.returns(undefined);
|
|
360
|
+
annotationService.registerChannel(channelWithoutBinding);
|
|
361
|
+
|
|
362
|
+
annotationService.publishEncrypted(strokeData.content, strokeData);
|
|
363
|
+
|
|
364
|
+
assert.notCalled(channelWithoutBinding.socket.send);
|
|
365
|
+
});
|
|
299
366
|
|
|
367
|
+
it('encrypts content before publishing', async () => {
|
|
368
|
+
await annotationService.sendStrokeData(strokeData);
|
|
369
|
+
|
|
370
|
+
assert.calledOnceWithExactly(
|
|
371
|
+
webex.internal.encryption.encryptText,
|
|
372
|
+
strokeData.encryptionKeyUrl,
|
|
373
|
+
strokeData.content
|
|
374
|
+
);
|
|
375
|
+
});
|
|
376
|
+
});
|
|
377
|
+
|
|
378
|
+
describe('Locus API collection', () => {
|
|
379
|
+
describe('send approve request', () => {
|
|
380
|
+
it('makes send request approved annotation as expected', async () => {
|
|
381
|
+
const requestData = {
|
|
382
|
+
toUserId: '4dd5eaf9-4cf8-4f0f-a1d6-014bf5d00741',
|
|
383
|
+
toDeviceUrl: 'https://wdm-a.wbx2.com/wdm/api/v1/devices/a3018aa9-70cb-4142-ae9a-f03db4fe1057',
|
|
384
|
+
shareInstanceId: '9428c492-da14-476f-a36c-b377ee8c4009',
|
|
385
|
+
};
|
|
300
386
|
|
|
301
387
|
const result = await annotationService.approveAnnotation(requestData);
|
|
302
388
|
assert.calledOnceWithExactly(webex.request, {
|
|
@@ -313,22 +399,20 @@ describe('live-annotation', () => {
|
|
|
313
399
|
}
|
|
314
400
|
});
|
|
315
401
|
|
|
316
|
-
assert.equal(result, 'REQUEST_RETURN_VALUE')
|
|
402
|
+
assert.equal(result, 'REQUEST_RETURN_VALUE');
|
|
317
403
|
});
|
|
318
404
|
});
|
|
319
405
|
|
|
320
406
|
describe('cancel Approve request', () => {
|
|
321
407
|
it('makes the cancel Approve request annotation as expected', async () => {
|
|
322
|
-
const
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
const result = await annotationService.cancelApproveAnnotation(requestData,approval);
|
|
408
|
+
const requestData = {
|
|
409
|
+
toUserId: '4dd5eaf9-4cf8-4f0f-a1d6-014bf5d00741',
|
|
410
|
+
toDeviceUrl: 'https://wdm-a.wbx2.com/wdm/api/v1/devices/a3018aa9-70cb-4142-ae9a-f03db4fe1057',
|
|
411
|
+
shareInstanceId: '9428c492-da14-476f-a36c-b377ee8c4009',
|
|
412
|
+
};
|
|
413
|
+
const approval = {url: 'url/cancel'};
|
|
414
|
+
|
|
415
|
+
const result = await annotationService.cancelApproveAnnotation(requestData, approval);
|
|
332
416
|
assert.calledOnceWithExactly(webex.request, {
|
|
333
417
|
method: 'PUT',
|
|
334
418
|
url: 'url/cancel',
|
|
@@ -339,21 +423,17 @@ describe('live-annotation', () => {
|
|
|
339
423
|
}
|
|
340
424
|
});
|
|
341
425
|
|
|
342
|
-
assert.equal(result, 'REQUEST_RETURN_VALUE')
|
|
426
|
+
assert.equal(result, 'REQUEST_RETURN_VALUE');
|
|
343
427
|
});
|
|
344
428
|
});
|
|
345
429
|
|
|
346
|
-
|
|
347
|
-
|
|
348
430
|
describe('close annotation', () => {
|
|
349
431
|
it('makes the close annotation as expected', async () => {
|
|
350
|
-
const
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
};
|
|
356
|
-
|
|
432
|
+
const requestData = {
|
|
433
|
+
toUserId: '4dd5eaf9-4cf8-4f0f-a1d6-014bf5d00741',
|
|
434
|
+
toDeviceUrl: 'https://wdm-a.wbx2.com/wdm/api/v1/devices/a3018aa9-70cb-4142-ae9a-f03db4fe1057',
|
|
435
|
+
shareInstanceId: '9428c492-da14-476f-a36c-b377ee8c4009',
|
|
436
|
+
};
|
|
357
437
|
|
|
358
438
|
const result = await annotationService.closeAnnotation(requestData);
|
|
359
439
|
assert.calledOnceWithExactly(webex.request, {
|
|
@@ -370,16 +450,15 @@ describe('live-annotation', () => {
|
|
|
370
450
|
}
|
|
371
451
|
});
|
|
372
452
|
|
|
373
|
-
assert.equal(result, 'REQUEST_RETURN_VALUE')
|
|
453
|
+
assert.equal(result, 'REQUEST_RETURN_VALUE');
|
|
374
454
|
});
|
|
375
455
|
});
|
|
376
456
|
|
|
377
|
-
|
|
378
457
|
describe('declined annotation', () => {
|
|
379
458
|
it('makes the declined annotation as expected', async () => {
|
|
380
459
|
const approval = {
|
|
381
460
|
url: 'approvalUrl'
|
|
382
|
-
}
|
|
461
|
+
};
|
|
383
462
|
const result = await annotationService.declineRequest(approval);
|
|
384
463
|
assert.calledOnceWithExactly(webex.request, {
|
|
385
464
|
method: 'PUT',
|
|
@@ -390,7 +469,7 @@ describe('live-annotation', () => {
|
|
|
390
469
|
}
|
|
391
470
|
});
|
|
392
471
|
|
|
393
|
-
assert.equal(result, 'REQUEST_RETURN_VALUE')
|
|
472
|
+
assert.equal(result, 'REQUEST_RETURN_VALUE');
|
|
394
473
|
});
|
|
395
474
|
});
|
|
396
475
|
|
|
@@ -398,7 +477,7 @@ describe('live-annotation', () => {
|
|
|
398
477
|
it('makes the accepted annotation as expected', async () => {
|
|
399
478
|
const approval = {
|
|
400
479
|
url: 'approvalUrl'
|
|
401
|
-
}
|
|
480
|
+
};
|
|
402
481
|
const result = await annotationService.acceptRequest(approval);
|
|
403
482
|
assert.calledOnceWithExactly(webex.request, {
|
|
404
483
|
method: 'PUT',
|
|
@@ -409,55 +488,70 @@ describe('live-annotation', () => {
|
|
|
409
488
|
}
|
|
410
489
|
});
|
|
411
490
|
|
|
412
|
-
assert.equal(result, 'REQUEST_RETURN_VALUE')
|
|
491
|
+
assert.equal(result, 'REQUEST_RETURN_VALUE');
|
|
413
492
|
});
|
|
414
493
|
});
|
|
415
494
|
});
|
|
416
495
|
|
|
417
496
|
describe('#deregisterEvents', () => {
|
|
418
|
-
let llmOn;
|
|
419
|
-
let llmOff;
|
|
420
497
|
let mercuryOn;
|
|
421
498
|
let mercuryOff;
|
|
422
499
|
|
|
423
500
|
beforeEach(() => {
|
|
424
|
-
llmOn = sinon.spy(webex.internal.llm, 'on');
|
|
425
|
-
llmOff = sinon.spy(webex.internal.llm, 'off');
|
|
426
501
|
mercuryOn = sinon.spy(webex.internal.mercury, 'on');
|
|
427
502
|
mercuryOff = sinon.spy(webex.internal.mercury, 'off');
|
|
428
503
|
});
|
|
429
504
|
|
|
430
|
-
it('cleans up events', () => {
|
|
505
|
+
it('cleans up mercury events and unregisters channel', () => {
|
|
506
|
+
annotationService.registerChannel(mockChannel);
|
|
431
507
|
annotationService.locusUrlUpdate(locusUrl);
|
|
508
|
+
|
|
432
509
|
assert.calledWith(
|
|
433
510
|
mercuryOn,
|
|
434
511
|
'event:locus.approval_request',
|
|
435
512
|
annotationService.eventCommandProcessor,
|
|
436
513
|
annotationService
|
|
437
514
|
);
|
|
438
|
-
assert.calledWith(
|
|
439
|
-
llmOn,
|
|
440
|
-
'event:relay.event',
|
|
441
|
-
annotationService.eventDataProcessor,
|
|
442
|
-
annotationService
|
|
443
|
-
);
|
|
444
515
|
assert.match(annotationService.hasSubscribedToEvents, true);
|
|
445
516
|
|
|
446
517
|
annotationService.deregisterEvents();
|
|
447
|
-
|
|
518
|
+
|
|
448
519
|
assert.calledWith(
|
|
449
520
|
mercuryOff,
|
|
450
521
|
'event:locus.approval_request',
|
|
451
522
|
annotationService.eventCommandProcessor
|
|
452
523
|
);
|
|
524
|
+
assert.calledOnceWithExactly(mockChannel.off, 'event:relay.event', sinon.match.func);
|
|
525
|
+
assert.equal(annotationService.channel, undefined);
|
|
453
526
|
assert.match(annotationService.hasSubscribedToEvents, false);
|
|
454
527
|
});
|
|
455
528
|
|
|
456
|
-
it('does not call
|
|
529
|
+
it('does not call off if events have not been registered', () => {
|
|
457
530
|
annotationService.deregisterEvents();
|
|
458
|
-
assert.notCalled(llmOff);
|
|
459
531
|
assert.notCalled(mercuryOff);
|
|
460
532
|
});
|
|
461
533
|
});
|
|
534
|
+
|
|
535
|
+
describe('#locusUrlUpdate', () => {
|
|
536
|
+
it('updates locusUrl and calls listenToEvents', () => {
|
|
537
|
+
const newLocusUrl = 'https://new-locus-url.com';
|
|
538
|
+
const listenSpy = sinon.spy(annotationService, 'listenToEvents');
|
|
539
|
+
|
|
540
|
+
annotationService.locusUrlUpdate(newLocusUrl);
|
|
541
|
+
|
|
542
|
+
assert.equal(annotationService.locusUrl, newLocusUrl);
|
|
543
|
+
assert.calledOnce(listenSpy);
|
|
544
|
+
});
|
|
545
|
+
});
|
|
546
|
+
|
|
547
|
+
describe('#approvalUrlUpdate', () => {
|
|
548
|
+
it('updates approvalUrl', () => {
|
|
549
|
+
const newApprovalUrl = 'https://new-approval-url.com';
|
|
550
|
+
|
|
551
|
+
annotationService.approvalUrlUpdate(newApprovalUrl);
|
|
552
|
+
|
|
553
|
+
assert.equal(annotationService.approvalUrl, newApprovalUrl);
|
|
554
|
+
});
|
|
555
|
+
});
|
|
462
556
|
});
|
|
463
557
|
});
|
|
@@ -26,6 +26,7 @@ describe('plugin-meetings', () => {
|
|
|
26
26
|
breakout.sessionId = 'sessionId';
|
|
27
27
|
breakout.sessionType = 'BREAKOUT';
|
|
28
28
|
breakout.url = 'url';
|
|
29
|
+
breakout.resourceLink = 'resource-link';
|
|
29
30
|
breakout.collection = {
|
|
30
31
|
parent: {
|
|
31
32
|
meetingId: 'activeMeetingId',
|
|
@@ -45,6 +46,7 @@ describe('plugin-meetings', () => {
|
|
|
45
46
|
describe('initialize', () => {
|
|
46
47
|
it('creates the object correctly', () => {
|
|
47
48
|
assert.instanceOf(breakout.breakoutRequest, BreakoutRequest);
|
|
49
|
+
assert.equal(breakout.resourceLink, 'resource-link');
|
|
48
50
|
});
|
|
49
51
|
});
|
|
50
52
|
|
|
@@ -217,10 +219,14 @@ describe('plugin-meetings', () => {
|
|
|
217
219
|
locusParticipantsUpdate: sinon.stub(),
|
|
218
220
|
};
|
|
219
221
|
|
|
220
|
-
const locusData = {
|
|
222
|
+
const locusData = {participants: [{id: 'participant-1'}], sequence: {entries: [123]}};
|
|
221
223
|
const result = breakout.parseRoster(locusData);
|
|
222
224
|
|
|
223
|
-
assert.calledOnceWithExactly(breakout.members.locusParticipantsUpdate,
|
|
225
|
+
assert.calledOnceWithExactly(breakout.members.locusParticipantsUpdate, {
|
|
226
|
+
participants: [{id: 'participant-1'}],
|
|
227
|
+
isReplace: true,
|
|
228
|
+
});
|
|
229
|
+
assert.equal(breakout.breakoutRosterLocus, locusData);
|
|
224
230
|
assert.equal(result, undefined);
|
|
225
231
|
});
|
|
226
232
|
it('not call locusParticipantsUpdate if sequence is expired', () => {
|
|
@@ -228,7 +234,7 @@ describe('plugin-meetings', () => {
|
|
|
228
234
|
locusParticipantsUpdate: sinon.stub(),
|
|
229
235
|
};
|
|
230
236
|
breakout.isNeedHandleRoster = sinon.stub().returns(false);
|
|
231
|
-
const locusData = {
|
|
237
|
+
const locusData = {participants: [{id: 'participant-1'}], sequence: {entries: [123]}};
|
|
232
238
|
breakout.parseRoster(locusData);
|
|
233
239
|
|
|
234
240
|
assert.notCalled(breakout.members.locusParticipantsUpdate);
|