@webex/internal-plugin-ediscovery 2.59.2 → 2.59.3-next.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.
- package/.eslintrc.js +6 -6
- package/README.md +62 -62
- package/babel.config.js +3 -3
- package/dist/config.js.map +1 -1
- package/dist/ediscovery-error.js +4 -4
- package/dist/ediscovery-error.js.map +1 -1
- package/dist/ediscovery.js +102 -102
- package/dist/ediscovery.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/report-request.js +10 -10
- package/dist/report-request.js.map +1 -1
- package/dist/retry.js.map +1 -1
- package/dist/transforms.js +23 -23
- package/dist/transforms.js.map +1 -1
- package/jest.config.js +3 -3
- package/package.json +17 -16
- package/process +1 -1
- package/src/config.js +10 -10
- package/src/ediscovery-error.js +16 -16
- package/src/ediscovery.js +457 -457
- package/src/index.js +175 -175
- package/src/report-request.js +34 -34
- package/src/retry.js +43 -43
- package/src/transforms.js +819 -819
- package/test/integration/spec/ediscovery.js +208 -208
- package/test/unit/spec/content.js +1084 -1084
- package/test/unit/spec/report.js +242 -242
- package/test/unit/spec/transforms.js +496 -496
package/test/unit/spec/report.js
CHANGED
|
@@ -1,242 +1,242 @@
|
|
|
1
|
-
import EDiscovery from '@webex/internal-plugin-ediscovery';
|
|
2
|
-
import ReportRequest from '@webex/internal-plugin-ediscovery/src/report-request';
|
|
3
|
-
import {InvalidEmailAddressError} from '@webex/internal-plugin-ediscovery/src/ediscovery-error';
|
|
4
|
-
import Encryption from '@webex/internal-plugin-encryption';
|
|
5
|
-
import Mercury from '@webex/internal-plugin-mercury';
|
|
6
|
-
import MockWebex from '@webex/test-helper-mock-webex';
|
|
7
|
-
import sinon from 'sinon';
|
|
8
|
-
import {expect} from '@webex/test-helper-chai';
|
|
9
|
-
import config from '@webex/internal-plugin-ediscovery/src/config';
|
|
10
|
-
|
|
11
|
-
/* eslint-disable max-len */
|
|
12
|
-
describe('EDiscovery Report API Tests', () => {
|
|
13
|
-
let webex;
|
|
14
|
-
const uuid = 'cc06f622-46ab-45b9-b3a6-5d70bad1d70a';
|
|
15
|
-
const defaultTimeout = 30000;
|
|
16
|
-
const reportRequest = new ReportRequest();
|
|
17
|
-
|
|
18
|
-
beforeEach(() => {
|
|
19
|
-
webex = new MockWebex({
|
|
20
|
-
children: {
|
|
21
|
-
ediscovery: EDiscovery,
|
|
22
|
-
encryption: Encryption,
|
|
23
|
-
mercury: Mercury,
|
|
24
|
-
},
|
|
25
|
-
});
|
|
26
|
-
webex.config.ediscovery = config.ediscovery;
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
describe('CreateReport Tests', () => {
|
|
30
|
-
it('CreateReport succeeds', async () => {
|
|
31
|
-
const result = webex.internal.ediscovery.createReport(reportRequest).then((res) => {
|
|
32
|
-
expect(res.statusCode).to.equal(200);
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
return result;
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
it('CreateReport fails with no param', async () => {
|
|
39
|
-
const result = expect(webex.internal.ediscovery.createReport()).to.be.rejectedWith(
|
|
40
|
-
Error,
|
|
41
|
-
'Undefined parameter'
|
|
42
|
-
);
|
|
43
|
-
|
|
44
|
-
return result;
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
it('CreateReport timeout defaults to 30s', async () => {
|
|
48
|
-
const result = webex.internal.ediscovery.createReport(reportRequest).then(() => {
|
|
49
|
-
sinon.assert.calledWith(webex.request, sinon.match.has('timeout', defaultTimeout));
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
return result;
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
it('CreateReport timeout can be overwritten to 5s', async () => {
|
|
56
|
-
const result = webex.internal.ediscovery
|
|
57
|
-
.createReport(reportRequest, {timeoutMs: 5000})
|
|
58
|
-
.then(() => {
|
|
59
|
-
sinon.assert.calledWith(webex.request, sinon.match.has('timeout', 5000));
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
return result;
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
it('CreateReport with invalid emails fails with InvalidEmailAddressError', async () => {
|
|
66
|
-
const invalidEmails = ['invalidEmail1@test.com', 'invalidEmail2@test.com'];
|
|
67
|
-
const error = Error();
|
|
68
|
-
|
|
69
|
-
error.message = JSON.stringify(invalidEmails);
|
|
70
|
-
error.errorCode = InvalidEmailAddressError.getErrorCode();
|
|
71
|
-
const result = webex.internal.ediscovery
|
|
72
|
-
._handleReportRequestError({body: error})
|
|
73
|
-
.catch((response) => {
|
|
74
|
-
const invalidEmailsError = new InvalidEmailAddressError(invalidEmails);
|
|
75
|
-
|
|
76
|
-
expect(response.name).to.equal(invalidEmailsError.name);
|
|
77
|
-
expect(JSON.stringify(response.message)).to.equal(
|
|
78
|
-
JSON.stringify(invalidEmailsError.message)
|
|
79
|
-
);
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
return result;
|
|
83
|
-
});
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
describe('GetReports Tests', () => {
|
|
87
|
-
it('GetReports succeeds', async () => {
|
|
88
|
-
const result = webex.internal.ediscovery.getReports({}).then((res) => {
|
|
89
|
-
expect(res.statusCode).to.equal(200);
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
return result;
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
it('GetReports timeout defaults to 30s', async () => {
|
|
96
|
-
const result = webex.internal.ediscovery.getReports().then(() => {
|
|
97
|
-
sinon.assert.calledWith(webex.request, sinon.match.has('timeout', defaultTimeout));
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
return result;
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
it('GetReports timeout can be overwritten to 5s', async () => {
|
|
104
|
-
const result = webex.internal.ediscovery.getReports({timeoutMs: 5000}).then(() => {
|
|
105
|
-
sinon.assert.calledWith(webex.request, sinon.match.has('timeout', 5000));
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
return result;
|
|
109
|
-
});
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
describe('GetReport Tests', () => {
|
|
113
|
-
it('GetReport succeeds', async () => {
|
|
114
|
-
const result = webex.internal.ediscovery.getReport(uuid).then((res) => {
|
|
115
|
-
expect(res.statusCode).to.equal(200);
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
return result;
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
it('GetReport fails with no params', async () => {
|
|
122
|
-
const result = expect(webex.internal.ediscovery.getReport()).to.be.rejectedWith(
|
|
123
|
-
Error,
|
|
124
|
-
'Undefined parameter'
|
|
125
|
-
);
|
|
126
|
-
|
|
127
|
-
return result;
|
|
128
|
-
});
|
|
129
|
-
|
|
130
|
-
it('GetReport timeout defaults to 30s', async () => {
|
|
131
|
-
const result = webex.internal.ediscovery.getReport(uuid).then(() => {
|
|
132
|
-
sinon.assert.calledWith(webex.request, sinon.match.has('timeout', defaultTimeout));
|
|
133
|
-
});
|
|
134
|
-
|
|
135
|
-
return result;
|
|
136
|
-
});
|
|
137
|
-
|
|
138
|
-
it('GetReport timeout can be overwritten to 5s', async () => {
|
|
139
|
-
const result = webex.internal.ediscovery.getReport(uuid, {timeoutMs: 5000}).then(() => {
|
|
140
|
-
sinon.assert.calledWith(webex.request, sinon.match.has('timeout', 5000));
|
|
141
|
-
});
|
|
142
|
-
|
|
143
|
-
return result;
|
|
144
|
-
});
|
|
145
|
-
});
|
|
146
|
-
|
|
147
|
-
describe('DeleteReport Tests', () => {
|
|
148
|
-
it('DeleteReport suceeds', async () => {
|
|
149
|
-
const result = webex.internal.ediscovery.deleteReport(uuid).then((res) => {
|
|
150
|
-
expect(res.statusCode).to.equal(200);
|
|
151
|
-
});
|
|
152
|
-
|
|
153
|
-
return result;
|
|
154
|
-
});
|
|
155
|
-
|
|
156
|
-
it('DeleteReport fails with no params', async () => {
|
|
157
|
-
const result = expect(webex.internal.ediscovery.deleteReport()).to.be.rejectedWith(
|
|
158
|
-
Error,
|
|
159
|
-
'Undefined parameter'
|
|
160
|
-
);
|
|
161
|
-
|
|
162
|
-
return result;
|
|
163
|
-
});
|
|
164
|
-
|
|
165
|
-
it('DeleteReport timeout defaults to 30s', async () => {
|
|
166
|
-
const result = webex.internal.ediscovery.deleteReport(uuid).then(() => {
|
|
167
|
-
sinon.assert.calledWith(webex.request, sinon.match.has('timeout', defaultTimeout));
|
|
168
|
-
});
|
|
169
|
-
|
|
170
|
-
return result;
|
|
171
|
-
});
|
|
172
|
-
|
|
173
|
-
it('DeleteReport timeout can be overwritten to 5s', async () => {
|
|
174
|
-
const result = webex.internal.ediscovery.deleteReport(uuid, {timeoutMs: 5000}).then(() => {
|
|
175
|
-
sinon.assert.calledWith(webex.request, sinon.match.has('timeout', 5000));
|
|
176
|
-
});
|
|
177
|
-
|
|
178
|
-
return result;
|
|
179
|
-
});
|
|
180
|
-
});
|
|
181
|
-
|
|
182
|
-
describe('RestartReport Tests', () => {
|
|
183
|
-
it('RestartReport succeeds', async () => {
|
|
184
|
-
const result = webex.internal.ediscovery.restartReport(uuid).then((res) => {
|
|
185
|
-
expect(res.statusCode).to.equal(200);
|
|
186
|
-
});
|
|
187
|
-
|
|
188
|
-
return result;
|
|
189
|
-
});
|
|
190
|
-
|
|
191
|
-
it('RestartReport fails with no params', async () => {
|
|
192
|
-
const result = expect(webex.internal.ediscovery.restartReport()).to.be.rejectedWith(
|
|
193
|
-
Error,
|
|
194
|
-
'Undefined parameter'
|
|
195
|
-
);
|
|
196
|
-
|
|
197
|
-
return result;
|
|
198
|
-
});
|
|
199
|
-
|
|
200
|
-
it('RestartReport timeout defaults to 30s', async () => {
|
|
201
|
-
const result = webex.internal.ediscovery.restartReport(uuid).then(() => {
|
|
202
|
-
sinon.assert.calledWith(webex.request, sinon.match.has('timeout', defaultTimeout));
|
|
203
|
-
});
|
|
204
|
-
|
|
205
|
-
return result;
|
|
206
|
-
});
|
|
207
|
-
|
|
208
|
-
it('RestartReport timeout can be overwritten to 5s', async () => {
|
|
209
|
-
const result = webex.internal.ediscovery.restartReport(uuid, {timeoutMs: 5000}).then(() => {
|
|
210
|
-
sinon.assert.calledWith(webex.request, sinon.match.has('timeout', 5000));
|
|
211
|
-
});
|
|
212
|
-
|
|
213
|
-
return result;
|
|
214
|
-
});
|
|
215
|
-
});
|
|
216
|
-
|
|
217
|
-
describe('GetClientConfig Tests', () => {
|
|
218
|
-
it('GetClientConfig succeeds', async () => {
|
|
219
|
-
const result = webex.internal.ediscovery.getClientConfig().then((res) => {
|
|
220
|
-
expect(res.statusCode).to.equal(200);
|
|
221
|
-
});
|
|
222
|
-
|
|
223
|
-
return result;
|
|
224
|
-
});
|
|
225
|
-
|
|
226
|
-
it('GetClientConfig timeout defaults to 30s', async () => {
|
|
227
|
-
const result = webex.internal.ediscovery.getClientConfig().then(() => {
|
|
228
|
-
sinon.assert.calledWith(webex.request, sinon.match.has('timeout', defaultTimeout));
|
|
229
|
-
});
|
|
230
|
-
|
|
231
|
-
return result;
|
|
232
|
-
});
|
|
233
|
-
|
|
234
|
-
it('GetClientConfig timeout can be overwritten to 5s', async () => {
|
|
235
|
-
const result = webex.internal.ediscovery.getClientConfig({timeoutMs: 5000}).then(() => {
|
|
236
|
-
sinon.assert.calledWith(webex.request, sinon.match.has('timeout', 5000));
|
|
237
|
-
});
|
|
238
|
-
|
|
239
|
-
return result;
|
|
240
|
-
});
|
|
241
|
-
});
|
|
242
|
-
});
|
|
1
|
+
import EDiscovery from '@webex/internal-plugin-ediscovery';
|
|
2
|
+
import ReportRequest from '@webex/internal-plugin-ediscovery/src/report-request';
|
|
3
|
+
import {InvalidEmailAddressError} from '@webex/internal-plugin-ediscovery/src/ediscovery-error';
|
|
4
|
+
import Encryption from '@webex/internal-plugin-encryption';
|
|
5
|
+
import Mercury from '@webex/internal-plugin-mercury';
|
|
6
|
+
import MockWebex from '@webex/test-helper-mock-webex';
|
|
7
|
+
import sinon from 'sinon';
|
|
8
|
+
import {expect} from '@webex/test-helper-chai';
|
|
9
|
+
import config from '@webex/internal-plugin-ediscovery/src/config';
|
|
10
|
+
|
|
11
|
+
/* eslint-disable max-len */
|
|
12
|
+
describe('EDiscovery Report API Tests', () => {
|
|
13
|
+
let webex;
|
|
14
|
+
const uuid = 'cc06f622-46ab-45b9-b3a6-5d70bad1d70a';
|
|
15
|
+
const defaultTimeout = 30000;
|
|
16
|
+
const reportRequest = new ReportRequest();
|
|
17
|
+
|
|
18
|
+
beforeEach(() => {
|
|
19
|
+
webex = new MockWebex({
|
|
20
|
+
children: {
|
|
21
|
+
ediscovery: EDiscovery,
|
|
22
|
+
encryption: Encryption,
|
|
23
|
+
mercury: Mercury,
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
webex.config.ediscovery = config.ediscovery;
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
describe('CreateReport Tests', () => {
|
|
30
|
+
it('CreateReport succeeds', async () => {
|
|
31
|
+
const result = webex.internal.ediscovery.createReport(reportRequest).then((res) => {
|
|
32
|
+
expect(res.statusCode).to.equal(200);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
return result;
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it('CreateReport fails with no param', async () => {
|
|
39
|
+
const result = expect(webex.internal.ediscovery.createReport()).to.be.rejectedWith(
|
|
40
|
+
Error,
|
|
41
|
+
'Undefined parameter'
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
return result;
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it('CreateReport timeout defaults to 30s', async () => {
|
|
48
|
+
const result = webex.internal.ediscovery.createReport(reportRequest).then(() => {
|
|
49
|
+
sinon.assert.calledWith(webex.request, sinon.match.has('timeout', defaultTimeout));
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
return result;
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it('CreateReport timeout can be overwritten to 5s', async () => {
|
|
56
|
+
const result = webex.internal.ediscovery
|
|
57
|
+
.createReport(reportRequest, {timeoutMs: 5000})
|
|
58
|
+
.then(() => {
|
|
59
|
+
sinon.assert.calledWith(webex.request, sinon.match.has('timeout', 5000));
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
return result;
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
it('CreateReport with invalid emails fails with InvalidEmailAddressError', async () => {
|
|
66
|
+
const invalidEmails = ['invalidEmail1@test.com', 'invalidEmail2@test.com'];
|
|
67
|
+
const error = Error();
|
|
68
|
+
|
|
69
|
+
error.message = JSON.stringify(invalidEmails);
|
|
70
|
+
error.errorCode = InvalidEmailAddressError.getErrorCode();
|
|
71
|
+
const result = webex.internal.ediscovery
|
|
72
|
+
._handleReportRequestError({body: error})
|
|
73
|
+
.catch((response) => {
|
|
74
|
+
const invalidEmailsError = new InvalidEmailAddressError(invalidEmails);
|
|
75
|
+
|
|
76
|
+
expect(response.name).to.equal(invalidEmailsError.name);
|
|
77
|
+
expect(JSON.stringify(response.message)).to.equal(
|
|
78
|
+
JSON.stringify(invalidEmailsError.message)
|
|
79
|
+
);
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
return result;
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
describe('GetReports Tests', () => {
|
|
87
|
+
it('GetReports succeeds', async () => {
|
|
88
|
+
const result = webex.internal.ediscovery.getReports({}).then((res) => {
|
|
89
|
+
expect(res.statusCode).to.equal(200);
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
return result;
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
it('GetReports timeout defaults to 30s', async () => {
|
|
96
|
+
const result = webex.internal.ediscovery.getReports().then(() => {
|
|
97
|
+
sinon.assert.calledWith(webex.request, sinon.match.has('timeout', defaultTimeout));
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
return result;
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
it('GetReports timeout can be overwritten to 5s', async () => {
|
|
104
|
+
const result = webex.internal.ediscovery.getReports({timeoutMs: 5000}).then(() => {
|
|
105
|
+
sinon.assert.calledWith(webex.request, sinon.match.has('timeout', 5000));
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
return result;
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
describe('GetReport Tests', () => {
|
|
113
|
+
it('GetReport succeeds', async () => {
|
|
114
|
+
const result = webex.internal.ediscovery.getReport(uuid).then((res) => {
|
|
115
|
+
expect(res.statusCode).to.equal(200);
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
return result;
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
it('GetReport fails with no params', async () => {
|
|
122
|
+
const result = expect(webex.internal.ediscovery.getReport()).to.be.rejectedWith(
|
|
123
|
+
Error,
|
|
124
|
+
'Undefined parameter'
|
|
125
|
+
);
|
|
126
|
+
|
|
127
|
+
return result;
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
it('GetReport timeout defaults to 30s', async () => {
|
|
131
|
+
const result = webex.internal.ediscovery.getReport(uuid).then(() => {
|
|
132
|
+
sinon.assert.calledWith(webex.request, sinon.match.has('timeout', defaultTimeout));
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
return result;
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
it('GetReport timeout can be overwritten to 5s', async () => {
|
|
139
|
+
const result = webex.internal.ediscovery.getReport(uuid, {timeoutMs: 5000}).then(() => {
|
|
140
|
+
sinon.assert.calledWith(webex.request, sinon.match.has('timeout', 5000));
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
return result;
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
describe('DeleteReport Tests', () => {
|
|
148
|
+
it('DeleteReport suceeds', async () => {
|
|
149
|
+
const result = webex.internal.ediscovery.deleteReport(uuid).then((res) => {
|
|
150
|
+
expect(res.statusCode).to.equal(200);
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
return result;
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
it('DeleteReport fails with no params', async () => {
|
|
157
|
+
const result = expect(webex.internal.ediscovery.deleteReport()).to.be.rejectedWith(
|
|
158
|
+
Error,
|
|
159
|
+
'Undefined parameter'
|
|
160
|
+
);
|
|
161
|
+
|
|
162
|
+
return result;
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
it('DeleteReport timeout defaults to 30s', async () => {
|
|
166
|
+
const result = webex.internal.ediscovery.deleteReport(uuid).then(() => {
|
|
167
|
+
sinon.assert.calledWith(webex.request, sinon.match.has('timeout', defaultTimeout));
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
return result;
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
it('DeleteReport timeout can be overwritten to 5s', async () => {
|
|
174
|
+
const result = webex.internal.ediscovery.deleteReport(uuid, {timeoutMs: 5000}).then(() => {
|
|
175
|
+
sinon.assert.calledWith(webex.request, sinon.match.has('timeout', 5000));
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
return result;
|
|
179
|
+
});
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
describe('RestartReport Tests', () => {
|
|
183
|
+
it('RestartReport succeeds', async () => {
|
|
184
|
+
const result = webex.internal.ediscovery.restartReport(uuid).then((res) => {
|
|
185
|
+
expect(res.statusCode).to.equal(200);
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
return result;
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
it('RestartReport fails with no params', async () => {
|
|
192
|
+
const result = expect(webex.internal.ediscovery.restartReport()).to.be.rejectedWith(
|
|
193
|
+
Error,
|
|
194
|
+
'Undefined parameter'
|
|
195
|
+
);
|
|
196
|
+
|
|
197
|
+
return result;
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
it('RestartReport timeout defaults to 30s', async () => {
|
|
201
|
+
const result = webex.internal.ediscovery.restartReport(uuid).then(() => {
|
|
202
|
+
sinon.assert.calledWith(webex.request, sinon.match.has('timeout', defaultTimeout));
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
return result;
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
it('RestartReport timeout can be overwritten to 5s', async () => {
|
|
209
|
+
const result = webex.internal.ediscovery.restartReport(uuid, {timeoutMs: 5000}).then(() => {
|
|
210
|
+
sinon.assert.calledWith(webex.request, sinon.match.has('timeout', 5000));
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
return result;
|
|
214
|
+
});
|
|
215
|
+
});
|
|
216
|
+
|
|
217
|
+
describe('GetClientConfig Tests', () => {
|
|
218
|
+
it('GetClientConfig succeeds', async () => {
|
|
219
|
+
const result = webex.internal.ediscovery.getClientConfig().then((res) => {
|
|
220
|
+
expect(res.statusCode).to.equal(200);
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
return result;
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
it('GetClientConfig timeout defaults to 30s', async () => {
|
|
227
|
+
const result = webex.internal.ediscovery.getClientConfig().then(() => {
|
|
228
|
+
sinon.assert.calledWith(webex.request, sinon.match.has('timeout', defaultTimeout));
|
|
229
|
+
});
|
|
230
|
+
|
|
231
|
+
return result;
|
|
232
|
+
});
|
|
233
|
+
|
|
234
|
+
it('GetClientConfig timeout can be overwritten to 5s', async () => {
|
|
235
|
+
const result = webex.internal.ediscovery.getClientConfig({timeoutMs: 5000}).then(() => {
|
|
236
|
+
sinon.assert.calledWith(webex.request, sinon.match.has('timeout', 5000));
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
return result;
|
|
240
|
+
});
|
|
241
|
+
});
|
|
242
|
+
});
|