diff options
author | Chocobozzz <me@florianbigard.com> | 2019-03-13 16:03:03 +0100 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2019-03-18 11:17:59 +0100 |
commit | 0b16f5f2202e0c0832b5e678fadd95c64b8e8789 (patch) | |
tree | be67b2c32fb4ba3e3ab31ce1ef6793e66af1a89f /server/tests/api/check-params | |
parent | e2f01c47e08d26a30ad47068d195b3d21d0df8a1 (diff) | |
download | PeerTube-0b16f5f2202e0c0832b5e678fadd95c64b8e8789.tar.gz PeerTube-0b16f5f2202e0c0832b5e678fadd95c64b8e8789.tar.zst PeerTube-0b16f5f2202e0c0832b5e678fadd95c64b8e8789.zip |
Add videos playlist exist tests
Diffstat (limited to 'server/tests/api/check-params')
-rw-r--r-- | server/tests/api/check-params/video-playlists.ts | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/server/tests/api/check-params/video-playlists.ts b/server/tests/api/check-params/video-playlists.ts index 803e7afb9..4d8000dbf 100644 --- a/server/tests/api/check-params/video-playlists.ts +++ b/server/tests/api/check-params/video-playlists.ts | |||
@@ -522,6 +522,52 @@ describe('Test video playlists API validator', function () { | |||
522 | }) | 522 | }) |
523 | }) | 523 | }) |
524 | 524 | ||
525 | describe('When checking exists in playlist endpoint', function () { | ||
526 | const path = '/api/v1/users/me/video-playlists/videos-exist' | ||
527 | |||
528 | it('Should fail with an unauthenticated user', async function () { | ||
529 | await makeGetRequest({ | ||
530 | url: server.url, | ||
531 | path, | ||
532 | query: { videoIds: [ 1, 2 ] }, | ||
533 | statusCodeExpected: 401 | ||
534 | }) | ||
535 | }) | ||
536 | |||
537 | it('Should fail with invalid video ids', async function () { | ||
538 | await makeGetRequest({ | ||
539 | url: server.url, | ||
540 | token: server.accessToken, | ||
541 | path, | ||
542 | query: { videoIds: 'toto' } | ||
543 | }) | ||
544 | |||
545 | await makeGetRequest({ | ||
546 | url: server.url, | ||
547 | token: server.accessToken, | ||
548 | path, | ||
549 | query: { videoIds: [ 'toto' ] } | ||
550 | }) | ||
551 | |||
552 | await makeGetRequest({ | ||
553 | url: server.url, | ||
554 | token: server.accessToken, | ||
555 | path, | ||
556 | query: { videoIds: [ 1, 'toto' ] } | ||
557 | }) | ||
558 | }) | ||
559 | |||
560 | it('Should succeed with the correct params', async function () { | ||
561 | await makeGetRequest({ | ||
562 | url: server.url, | ||
563 | token: server.accessToken, | ||
564 | path, | ||
565 | query: { videoIds: [ 1, 2 ] }, | ||
566 | statusCodeExpected: 200 | ||
567 | }) | ||
568 | }) | ||
569 | }) | ||
570 | |||
525 | describe('When deleting an element in a playlist', function () { | 571 | describe('When deleting an element in a playlist', function () { |
526 | const getBase = (wrapper: any = {}) => { | 572 | const getBase = (wrapper: any = {}) => { |
527 | return Object.assign({ | 573 | return Object.assign({ |