aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/check-params
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api/check-params')
-rw-r--r--server/tests/api/check-params/video-playlists.ts46
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({