@webex/plugin-meetings 3.0.0-beta.169 → 3.0.0-beta.170
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/breakouts/breakout.js +1 -1
- package/dist/breakouts/index.js +1 -1
- package/dist/constants.js +24 -1
- package/dist/constants.js.map +1 -1
- package/dist/interpretation/index.js +1 -1
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/meeting/index.js +20 -4
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/util.js +6 -0
- package/dist/meeting/util.js.map +1 -1
- package/dist/recording-controller/index.js +21 -1
- package/dist/recording-controller/index.js.map +1 -1
- package/dist/recording-controller/util.js +9 -8
- package/dist/recording-controller/util.js.map +1 -1
- package/dist/types/constants.d.ts +21 -0
- package/dist/types/meeting/index.d.ts +7 -0
- package/dist/types/meeting/util.d.ts +2 -0
- package/dist/types/recording-controller/index.d.ts +15 -0
- package/dist/types/recording-controller/util.d.ts +5 -4
- package/package.json +20 -19
- package/src/constants.ts +22 -0
- package/src/meeting/index.ts +29 -4
- package/src/meeting/util.ts +9 -0
- package/src/recording-controller/index.ts +20 -2
- package/src/recording-controller/util.ts +26 -9
- package/test/unit/spec/meeting/index.js +63 -2
- package/test/unit/spec/meeting/utils.js +29 -0
- package/test/unit/spec/recording-controller/index.js +294 -218
- package/test/unit/spec/recording-controller/util.js +223 -96
|
@@ -1,102 +1,229 @@
|
|
|
1
1
|
import RecordingUtil from '@webex/plugin-meetings/src/recording-controller/util';
|
|
2
2
|
import RecordingAction from '@webex/plugin-meetings/src/recording-controller/enums';
|
|
3
|
-
import {
|
|
3
|
+
import {SELF_POLICY} from '@webex/plugin-meetings/src/constants';
|
|
4
|
+
|
|
5
|
+
import {assert} from 'chai';
|
|
4
6
|
|
|
5
7
|
describe('plugin-meetings', () => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
8
|
+
describe('recording-controller tests', () => {
|
|
9
|
+
describe('recording util tests', () => {
|
|
10
|
+
let locusInfo;
|
|
11
|
+
|
|
12
|
+
beforeEach(() => {
|
|
13
|
+
locusInfo = {
|
|
14
|
+
parsedLocus: {
|
|
15
|
+
info: {
|
|
16
|
+
userDisplayHints: [],
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
describe('canUserStart', () => {
|
|
23
|
+
it('can start recording when the correct display hint is present', () => {
|
|
24
|
+
locusInfo.parsedLocus.info.userDisplayHints.push('RECORDING_CONTROL_START');
|
|
25
|
+
|
|
26
|
+
assert.equal(
|
|
27
|
+
RecordingUtil.canUserStart(locusInfo.parsedLocus.info.userDisplayHints),
|
|
28
|
+
true
|
|
29
|
+
);
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
it('can start recording when the correct display hint is present and the policy is true', () => {
|
|
33
|
+
locusInfo.parsedLocus.info.userDisplayHints.push('RECORDING_CONTROL_START');
|
|
34
|
+
|
|
35
|
+
assert.equal(
|
|
36
|
+
RecordingUtil.canUserStart(locusInfo.parsedLocus.info.userDisplayHints, {
|
|
37
|
+
[SELF_POLICY.SUPPORT_NETWORK_BASED_RECORD]: true,
|
|
38
|
+
}),
|
|
39
|
+
true
|
|
40
|
+
);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it('rejects when correct display hint is not present', () => {
|
|
44
|
+
assert.equal(
|
|
45
|
+
RecordingUtil.canUserStart(locusInfo.parsedLocus.info.userDisplayHints),
|
|
46
|
+
false
|
|
47
|
+
);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it('rejects when correct display hint is present but policy is false', () => {
|
|
51
|
+
locusInfo.parsedLocus.info.userDisplayHints.push('RECORDING_CONTROL_START');
|
|
52
|
+
|
|
53
|
+
assert.equal(
|
|
54
|
+
RecordingUtil.canUserStart(locusInfo.parsedLocus.info.userDisplayHints, {
|
|
55
|
+
[SELF_POLICY.SUPPORT_NETWORK_BASED_RECORD]: false,
|
|
56
|
+
}),
|
|
57
|
+
false
|
|
58
|
+
);
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
describe('canUserPause', () => {
|
|
63
|
+
it('can pause recording when the correct display hint is present', () => {
|
|
64
|
+
locusInfo.parsedLocus.info.userDisplayHints.push('RECORDING_CONTROL_PAUSE');
|
|
65
|
+
|
|
66
|
+
assert.equal(
|
|
67
|
+
RecordingUtil.canUserPause(locusInfo.parsedLocus.info.userDisplayHints),
|
|
68
|
+
true
|
|
69
|
+
);
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
it('can pause recording when the correct display hint is present and the policy is true', () => {
|
|
73
|
+
locusInfo.parsedLocus.info.userDisplayHints.push('RECORDING_CONTROL_PAUSE');
|
|
74
|
+
|
|
75
|
+
assert.equal(
|
|
76
|
+
RecordingUtil.canUserPause(locusInfo.parsedLocus.info.userDisplayHints, {
|
|
77
|
+
[SELF_POLICY.SUPPORT_NETWORK_BASED_RECORD]: true,
|
|
78
|
+
}),
|
|
79
|
+
true
|
|
80
|
+
);
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
it('rejects when correct display hint is not present', () => {
|
|
84
|
+
assert.equal(
|
|
85
|
+
RecordingUtil.canUserPause(locusInfo.parsedLocus.info.userDisplayHints),
|
|
86
|
+
false
|
|
87
|
+
);
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
it('rejects when correct display hint is present but the policy is false', () => {
|
|
91
|
+
locusInfo.parsedLocus.info.userDisplayHints.push('RECORDING_CONTROL_PAUSE');
|
|
92
|
+
|
|
93
|
+
assert.equal(
|
|
94
|
+
RecordingUtil.canUserPause(locusInfo.parsedLocus.info.userDisplayHints, {
|
|
95
|
+
[SELF_POLICY.SUPPORT_NETWORK_BASED_RECORD]: false,
|
|
96
|
+
}),
|
|
97
|
+
false
|
|
98
|
+
);
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
describe('canUserStop', () => {
|
|
103
|
+
it('can stop recording when the correct display hint is present', () => {
|
|
104
|
+
locusInfo.parsedLocus.info.userDisplayHints.push('RECORDING_CONTROL_STOP');
|
|
105
|
+
|
|
106
|
+
assert.equal(
|
|
107
|
+
RecordingUtil.canUserStop(locusInfo.parsedLocus.info.userDisplayHints),
|
|
108
|
+
true
|
|
109
|
+
);
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
it('can stop recording when the correct display hint is present and the policy is true', () => {
|
|
113
|
+
locusInfo.parsedLocus.info.userDisplayHints.push('RECORDING_CONTROL_STOP', {
|
|
114
|
+
[SELF_POLICY.SUPPORT_NETWORK_BASED_RECORD]: true,
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
assert.equal(
|
|
118
|
+
RecordingUtil.canUserStop(locusInfo.parsedLocus.info.userDisplayHints),
|
|
119
|
+
true
|
|
120
|
+
);
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
it('rejects when correct display hint is not present', () => {
|
|
124
|
+
assert.equal(
|
|
125
|
+
RecordingUtil.canUserStop(locusInfo.parsedLocus.info.userDisplayHints),
|
|
126
|
+
false
|
|
127
|
+
);
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
it('rejects when correct display hint is present but the policy is false', () => {
|
|
131
|
+
locusInfo.parsedLocus.info.userDisplayHints.push('RECORDING_CONTROL_STOP', {
|
|
132
|
+
[SELF_POLICY.SUPPORT_NETWORK_BASED_RECORD]: true,
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
assert.equal(
|
|
136
|
+
RecordingUtil.canUserStop(locusInfo.parsedLocus.info.userDisplayHints, {
|
|
137
|
+
[SELF_POLICY.SUPPORT_NETWORK_BASED_RECORD]: false,
|
|
138
|
+
}),
|
|
139
|
+
false
|
|
140
|
+
);
|
|
141
|
+
});
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
describe('canUserResume', () => {
|
|
145
|
+
it('can start recording when the correct display hint is present', () => {
|
|
146
|
+
locusInfo.parsedLocus.info.userDisplayHints.push('RECORDING_CONTROL_RESUME');
|
|
147
|
+
|
|
148
|
+
assert.equal(
|
|
149
|
+
RecordingUtil.canUserResume(locusInfo.parsedLocus.info.userDisplayHints),
|
|
150
|
+
true
|
|
151
|
+
);
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
it('can start recording when the correct display hint is present and the policy is true', () => {
|
|
155
|
+
locusInfo.parsedLocus.info.userDisplayHints.push('RECORDING_CONTROL_RESUME');
|
|
156
|
+
|
|
157
|
+
assert.equal(
|
|
158
|
+
RecordingUtil.canUserResume(locusInfo.parsedLocus.info.userDisplayHints, {
|
|
159
|
+
[SELF_POLICY.SUPPORT_NETWORK_BASED_RECORD]: true,
|
|
160
|
+
}),
|
|
161
|
+
true
|
|
162
|
+
);
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
it('rejects when correct display hint is not present', () => {
|
|
166
|
+
assert.equal(
|
|
167
|
+
RecordingUtil.canUserResume(locusInfo.parsedLocus.info.userDisplayHints),
|
|
168
|
+
false
|
|
169
|
+
);
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
it('rejects when correct display hint is present but the policy is false', () => {
|
|
173
|
+
locusInfo.parsedLocus.info.userDisplayHints.push('RECORDING_CONTROL_RESUME');
|
|
174
|
+
|
|
175
|
+
assert.equal(
|
|
176
|
+
RecordingUtil.canUserResume(locusInfo.parsedLocus.info.userDisplayHints, {
|
|
177
|
+
[SELF_POLICY.SUPPORT_NETWORK_BASED_RECORD]: false,
|
|
178
|
+
}),
|
|
179
|
+
false
|
|
180
|
+
);
|
|
181
|
+
});
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
describe('deriveRecordingStates', () => {
|
|
185
|
+
it('gets the correct values for a start recording action', () => {
|
|
186
|
+
assert.deepEqual(RecordingUtil.deriveRecordingStates(RecordingAction.Start), {
|
|
187
|
+
recording: true,
|
|
188
|
+
paused: false,
|
|
189
|
+
});
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
it('gets the correct values for a stop recording action', () => {
|
|
193
|
+
assert.deepEqual(RecordingUtil.deriveRecordingStates(RecordingAction.Stop), {
|
|
194
|
+
recording: false,
|
|
195
|
+
paused: false,
|
|
196
|
+
});
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
it('gets the correct values for a resume recording action', () => {
|
|
200
|
+
assert.deepEqual(RecordingUtil.deriveRecordingStates(RecordingAction.Resume), {
|
|
201
|
+
recording: true,
|
|
202
|
+
paused: false,
|
|
203
|
+
});
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
it('gets the correct values for a paused recording action', () => {
|
|
207
|
+
assert.deepEqual(RecordingUtil.deriveRecordingStates(RecordingAction.Pause), {
|
|
208
|
+
recording: true,
|
|
209
|
+
paused: true,
|
|
210
|
+
});
|
|
211
|
+
});
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
describe('extractLocusId', () => {
|
|
215
|
+
it('gets the correct id from the url param', () => {
|
|
216
|
+
assert.equal(RecordingUtil.extractLocusId('test/id'), 'id');
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
it('works with empty string parameters passed', () => {
|
|
220
|
+
assert.equal(RecordingUtil.extractLocusId(''), '');
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
it('works with no parameters passed', () => {
|
|
224
|
+
assert.isUndefined(RecordingUtil.extractLocusId(undefined));
|
|
100
225
|
});
|
|
226
|
+
});
|
|
101
227
|
});
|
|
102
|
-
});
|
|
228
|
+
});
|
|
229
|
+
});
|