From 26b7305a232e547709f433a6edf700bf495935d8 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 13 Aug 2018 16:57:13 +0200 Subject: Add blacklist reason field --- server/tests/utils/videos/video-blacklist.ts | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'server/tests/utils/videos/video-blacklist.ts') diff --git a/server/tests/utils/videos/video-blacklist.ts b/server/tests/utils/videos/video-blacklist.ts index aa0d232b6..7819f4b25 100644 --- a/server/tests/utils/videos/video-blacklist.ts +++ b/server/tests/utils/videos/video-blacklist.ts @@ -1,15 +1,26 @@ import * as request from 'supertest' -function addVideoToBlacklist (url: string, token: string, videoId: number, specialStatus = 204) { +function addVideoToBlacklist (url: string, token: string, videoId: number | string, reason?: string, specialStatus = 204) { const path = '/api/v1/videos/' + videoId + '/blacklist' return request(url) .post(path) + .send({ reason }) .set('Accept', 'application/json') .set('Authorization', 'Bearer ' + token) .expect(specialStatus) } +function updateVideoBlacklist (url: string, token: string, videoId: number, reason?: string, specialStatus = 204) { + const path = '/api/v1/videos/' + videoId + '/blacklist' + + return request(url) + .put(path) + .send({ reason }) + .set('Accept', 'application/json') + .set('Authorization', 'Bearer ' + token) + .expect(specialStatus)} + function removeVideoFromBlacklist (url: string, token: string, videoId: number | string, specialStatus = 204) { const path = '/api/v1/videos/' + videoId + '/blacklist' @@ -50,5 +61,6 @@ export { addVideoToBlacklist, removeVideoFromBlacklist, getBlacklistedVideosList, - getSortedBlacklistedVideosList + getSortedBlacklistedVideosList, + updateVideoBlacklist } -- cgit v1.2.3