From 0883b3245bf0deb9106c4041e9afbd3521b79280 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 19 Apr 2018 11:01:34 +0200 Subject: Add ability to choose what policy we have for NSFW videos There is a global instance setting and a per user setting --- server/tests/utils/videos/videos.ts | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'server/tests/utils/videos/videos.ts') diff --git a/server/tests/utils/videos/videos.ts b/server/tests/utils/videos/videos.ts index 01e7fa5a1..df9071c29 100644 --- a/server/tests/utils/videos/videos.ts +++ b/server/tests/utils/videos/videos.ts @@ -128,6 +128,18 @@ function getVideosList (url: string) { .expect('Content-Type', /json/) } +function getVideosListWithToken (url: string, token: string) { + const path = '/api/v1/videos' + + return request(url) + .get(path) + .set('Authorization', 'Bearer ' + token) + .query({ sort: 'name' }) + .set('Accept', 'application/json') + .expect(200) + .expect('Content-Type', /json/) +} + function getLocalVideos (url: string) { const path = '/api/v1/videos' @@ -202,6 +214,18 @@ function searchVideo (url: string, search: string) { .expect('Content-Type', /json/) } +function searchVideoWithToken (url: string, search: string, token: string) { + const path = '/api/v1/videos' + const req = request(url) + .get(path + '/search') + .set('Authorization', 'Bearer ' + token) + .query({ search }) + .set('Accept', 'application/json') + + return req.expect(200) + .expect('Content-Type', /json/) +} + function searchVideoWithPagination (url: string, search: string, start: number, count: number, sort?: string) { const path = '/api/v1/videos' @@ -490,6 +514,7 @@ export { getVideoPrivacies, getVideoLanguages, getMyVideos, + searchVideoWithToken, getVideo, getVideoWithToken, getVideosList, @@ -499,6 +524,7 @@ export { searchVideo, searchVideoWithPagination, searchVideoWithSort, + getVideosListWithToken, uploadVideo, updateVideo, rateVideo, -- cgit v1.2.3