diff options
author | Chocobozzz <me@florianbigard.com> | 2022-05-03 11:38:07 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-05-03 14:49:15 +0200 |
commit | 26e3e98ff0e222a9fb9226938ac6902af77921bd (patch) | |
tree | 73d1c6f2524e380862d3365f12043fc319d40841 /server/tests/api/check-params/live.ts | |
parent | 86c5229b4d726202378ef46854383bcafca22310 (diff) | |
download | PeerTube-26e3e98ff0e222a9fb9226938ac6902af77921bd.tar.gz PeerTube-26e3e98ff0e222a9fb9226938ac6902af77921bd.tar.zst PeerTube-26e3e98ff0e222a9fb9226938ac6902af77921bd.zip |
Support live session in server
Diffstat (limited to 'server/tests/api/check-params/live.ts')
-rw-r--r-- | server/tests/api/check-params/live.ts | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/server/tests/api/check-params/live.ts b/server/tests/api/check-params/live.ts index bbd331657..29f847e51 100644 --- a/server/tests/api/check-params/live.ts +++ b/server/tests/api/check-params/live.ts | |||
@@ -388,6 +388,52 @@ describe('Test video lives API validator', function () { | |||
388 | }) | 388 | }) |
389 | }) | 389 | }) |
390 | 390 | ||
391 | describe('When getting live sessions', function () { | ||
392 | |||
393 | it('Should fail with a bad access token', async function () { | ||
394 | await command.listSessions({ token: 'toto', videoId: video.id, expectedStatus: HttpStatusCode.UNAUTHORIZED_401 }) | ||
395 | }) | ||
396 | |||
397 | it('Should fail without token', async function () { | ||
398 | await command.listSessions({ token: null, videoId: video.id, expectedStatus: HttpStatusCode.UNAUTHORIZED_401 }) | ||
399 | }) | ||
400 | |||
401 | it('Should fail with the token of another user', async function () { | ||
402 | await command.listSessions({ token: userAccessToken, videoId: video.id, expectedStatus: HttpStatusCode.FORBIDDEN_403 }) | ||
403 | }) | ||
404 | |||
405 | it('Should fail with a bad video id', async function () { | ||
406 | await command.listSessions({ videoId: 'toto', expectedStatus: HttpStatusCode.BAD_REQUEST_400 }) | ||
407 | }) | ||
408 | |||
409 | it('Should fail with an unknown video id', async function () { | ||
410 | await command.listSessions({ videoId: 454555, expectedStatus: HttpStatusCode.NOT_FOUND_404 }) | ||
411 | }) | ||
412 | |||
413 | it('Should fail with a non live video', async function () { | ||
414 | await command.listSessions({ videoId: videoIdNotLive, expectedStatus: HttpStatusCode.NOT_FOUND_404 }) | ||
415 | }) | ||
416 | |||
417 | it('Should succeed with the correct params', async function () { | ||
418 | await command.listSessions({ videoId: video.id }) | ||
419 | }) | ||
420 | }) | ||
421 | |||
422 | describe('When getting live session of a replay', function () { | ||
423 | |||
424 | it('Should fail with a bad video id', async function () { | ||
425 | await command.getReplaySession({ videoId: 'toto', expectedStatus: HttpStatusCode.BAD_REQUEST_400 }) | ||
426 | }) | ||
427 | |||
428 | it('Should fail with an unknown video id', async function () { | ||
429 | await command.getReplaySession({ videoId: 454555, expectedStatus: HttpStatusCode.NOT_FOUND_404 }) | ||
430 | }) | ||
431 | |||
432 | it('Should fail with a non replay video', async function () { | ||
433 | await command.getReplaySession({ videoId: videoIdNotLive, expectedStatus: HttpStatusCode.NOT_FOUND_404 }) | ||
434 | }) | ||
435 | }) | ||
436 | |||
391 | describe('When updating live information', async function () { | 437 | describe('When updating live information', async function () { |
392 | 438 | ||
393 | it('Should fail without access token', async function () { | 439 | it('Should fail without access token', async function () { |