From 11ba2ab3f1e3ec29b3765fa0c1ff4ed410c851a9 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 28 Dec 2017 16:26:28 +0100 Subject: Improve check videos parameters tests --- server/tests/utils/videos/video-blacklist.ts | 2 +- server/tests/utils/videos/video-channels.ts | 4 ++-- server/tests/utils/videos/videos.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'server/tests/utils') diff --git a/server/tests/utils/videos/video-blacklist.ts b/server/tests/utils/videos/video-blacklist.ts index 3a499f46a..aa0d232b6 100644 --- a/server/tests/utils/videos/video-blacklist.ts +++ b/server/tests/utils/videos/video-blacklist.ts @@ -10,7 +10,7 @@ function addVideoToBlacklist (url: string, token: string, videoId: number, speci .expect(specialStatus) } -function removeVideoFromBlacklist (url: string, token: string, videoId: number, specialStatus = 204) { +function removeVideoFromBlacklist (url: string, token: string, videoId: number | string, specialStatus = 204) { const path = '/api/v1/videos/' + videoId + '/blacklist' return request(url) diff --git a/server/tests/utils/videos/video-channels.ts b/server/tests/utils/videos/video-channels.ts index 0fb80d331..062ca8f4d 100644 --- a/server/tests/utils/videos/video-channels.ts +++ b/server/tests/utils/videos/video-channels.ts @@ -20,13 +20,13 @@ function getVideoChannelsList (url: string, start: number, count: number, sort?: .expect('Content-Type', /json/) } -function getAccountVideoChannelsList (url: string, accountId: number | string) { +function getAccountVideoChannelsList (url: string, accountId: number | string, specialStatus = 200) { const path = '/api/v1/videos/accounts/' + accountId + '/channels' return request(url) .get(path) .set('Accept', 'application/json') - .expect(200) + .expect(specialStatus) .expect('Content-Type', /json/) } diff --git a/server/tests/utils/videos/videos.ts b/server/tests/utils/videos/videos.ts index fefee4878..166253ffc 100644 --- a/server/tests/utils/videos/videos.ts +++ b/server/tests/utils/videos/videos.ts @@ -143,7 +143,7 @@ function getVideosListSort (url: string, sort: string) { .expect('Content-Type', /json/) } -function removeVideo (url: string, token: string, id: number, expectedStatus = 204) { +function removeVideo (url: string, token: string, id: number | string, expectedStatus = 204) { const path = '/api/v1/videos' return request(url) -- cgit v1.2.3