diff options
author | Chocobozzz <me@florianbigard.com> | 2021-07-07 11:51:09 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-07-20 15:27:17 +0200 |
commit | 65e6e2602c0d5521f3a6740f7469bb92830ecb53 (patch) | |
tree | f89024ffff1dafb0281ee2fe028e89b95101bd44 /server/tests/api/check-params/live.ts | |
parent | bc8090411ddaa8d742ce4de3c83f9dba7bc18e2a (diff) | |
download | PeerTube-65e6e2602c0d5521f3a6740f7469bb92830ecb53.tar.gz PeerTube-65e6e2602c0d5521f3a6740f7469bb92830ecb53.tar.zst PeerTube-65e6e2602c0d5521f3a6740f7469bb92830ecb53.zip |
Introduce config command
Diffstat (limited to 'server/tests/api/check-params/live.ts')
-rw-r--r-- | server/tests/api/check-params/live.ts | 75 |
1 files changed, 44 insertions, 31 deletions
diff --git a/server/tests/api/check-params/live.ts b/server/tests/api/check-params/live.ts index 933d8abf2..7a623c169 100644 --- a/server/tests/api/check-params/live.ts +++ b/server/tests/api/check-params/live.ts | |||
@@ -19,7 +19,6 @@ import { | |||
19 | ServerInfo, | 19 | ServerInfo, |
20 | setAccessTokensToServers, | 20 | setAccessTokensToServers, |
21 | stopFfmpeg, | 21 | stopFfmpeg, |
22 | updateCustomSubConfig, | ||
23 | updateLive, | 22 | updateLive, |
24 | uploadVideoAndGetId, | 23 | uploadVideoAndGetId, |
25 | userLogin, | 24 | userLogin, |
@@ -43,12 +42,14 @@ describe('Test video lives API validator', function () { | |||
43 | 42 | ||
44 | await setAccessTokensToServers([ server ]) | 43 | await setAccessTokensToServers([ server ]) |
45 | 44 | ||
46 | await updateCustomSubConfig(server.url, server.accessToken, { | 45 | await server.configCommand.updateCustomSubConfig({ |
47 | live: { | 46 | newConfig: { |
48 | enabled: true, | 47 | live: { |
49 | maxInstanceLives: 20, | 48 | enabled: true, |
50 | maxUserLives: 20, | 49 | maxInstanceLives: 20, |
51 | allowReplay: true | 50 | maxUserLives: 20, |
51 | allowReplay: true | ||
52 | } | ||
52 | } | 53 | } |
53 | }) | 54 | }) |
54 | 55 | ||
@@ -234,9 +235,11 @@ describe('Test video lives API validator', function () { | |||
234 | }) | 235 | }) |
235 | 236 | ||
236 | it('Should forbid if live is disabled', async function () { | 237 | it('Should forbid if live is disabled', async function () { |
237 | await updateCustomSubConfig(server.url, server.accessToken, { | 238 | await server.configCommand.updateCustomSubConfig({ |
238 | live: { | 239 | newConfig: { |
239 | enabled: false | 240 | live: { |
241 | enabled: false | ||
242 | } | ||
240 | } | 243 | } |
241 | }) | 244 | }) |
242 | 245 | ||
@@ -252,10 +255,12 @@ describe('Test video lives API validator', function () { | |||
252 | it('Should forbid to save replay if not enabled by the admin', async function () { | 255 | it('Should forbid to save replay if not enabled by the admin', async function () { |
253 | const fields = immutableAssign(baseCorrectParams, { saveReplay: true }) | 256 | const fields = immutableAssign(baseCorrectParams, { saveReplay: true }) |
254 | 257 | ||
255 | await updateCustomSubConfig(server.url, server.accessToken, { | 258 | await server.configCommand.updateCustomSubConfig({ |
256 | live: { | 259 | newConfig: { |
257 | enabled: true, | 260 | live: { |
258 | allowReplay: false | 261 | enabled: true, |
262 | allowReplay: false | ||
263 | } | ||
259 | } | 264 | } |
260 | }) | 265 | }) |
261 | 266 | ||
@@ -271,10 +276,12 @@ describe('Test video lives API validator', function () { | |||
271 | it('Should allow to save replay if enabled by the admin', async function () { | 276 | it('Should allow to save replay if enabled by the admin', async function () { |
272 | const fields = immutableAssign(baseCorrectParams, { saveReplay: true }) | 277 | const fields = immutableAssign(baseCorrectParams, { saveReplay: true }) |
273 | 278 | ||
274 | await updateCustomSubConfig(server.url, server.accessToken, { | 279 | await server.configCommand.updateCustomSubConfig({ |
275 | live: { | 280 | newConfig: { |
276 | enabled: true, | 281 | live: { |
277 | allowReplay: true | 282 | enabled: true, |
283 | allowReplay: true | ||
284 | } | ||
278 | } | 285 | } |
279 | }) | 286 | }) |
280 | 287 | ||
@@ -288,10 +295,12 @@ describe('Test video lives API validator', function () { | |||
288 | }) | 295 | }) |
289 | 296 | ||
290 | it('Should not allow live if max instance lives is reached', async function () { | 297 | it('Should not allow live if max instance lives is reached', async function () { |
291 | await updateCustomSubConfig(server.url, server.accessToken, { | 298 | await server.configCommand.updateCustomSubConfig({ |
292 | live: { | 299 | newConfig: { |
293 | enabled: true, | 300 | live: { |
294 | maxInstanceLives: 1 | 301 | enabled: true, |
302 | maxInstanceLives: 1 | ||
303 | } | ||
295 | } | 304 | } |
296 | }) | 305 | }) |
297 | 306 | ||
@@ -305,11 +314,13 @@ describe('Test video lives API validator', function () { | |||
305 | }) | 314 | }) |
306 | 315 | ||
307 | it('Should not allow live if max user lives is reached', async function () { | 316 | it('Should not allow live if max user lives is reached', async function () { |
308 | await updateCustomSubConfig(server.url, server.accessToken, { | 317 | await server.configCommand.updateCustomSubConfig({ |
309 | live: { | 318 | newConfig: { |
310 | enabled: true, | 319 | live: { |
311 | maxInstanceLives: 20, | 320 | enabled: true, |
312 | maxUserLives: 1 | 321 | maxInstanceLives: 20, |
322 | maxUserLives: 1 | ||
323 | } | ||
313 | } | 324 | } |
314 | }) | 325 | }) |
315 | 326 | ||
@@ -393,10 +404,12 @@ describe('Test video lives API validator', function () { | |||
393 | }) | 404 | }) |
394 | 405 | ||
395 | it('Should fail to update replay status if replay is not allowed on the instance', async function () { | 406 | it('Should fail to update replay status if replay is not allowed on the instance', async function () { |
396 | await updateCustomSubConfig(server.url, server.accessToken, { | 407 | await server.configCommand.updateCustomSubConfig({ |
397 | live: { | 408 | newConfig: { |
398 | enabled: true, | 409 | live: { |
399 | allowReplay: false | 410 | enabled: true, |
411 | allowReplay: false | ||
412 | } | ||
400 | } | 413 | } |
401 | }) | 414 | }) |
402 | 415 | ||