diff options
Diffstat (limited to 'server/tests/api/videos/video-nsfw.ts')
-rw-r--r-- | server/tests/api/videos/video-nsfw.ts | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/server/tests/api/videos/video-nsfw.ts b/server/tests/api/videos/video-nsfw.ts index 6c98c9f12..24a4c6152 100644 --- a/server/tests/api/videos/video-nsfw.ts +++ b/server/tests/api/videos/video-nsfw.ts | |||
@@ -14,8 +14,6 @@ import { | |||
14 | getVideoChannelVideos, | 14 | getVideoChannelVideos, |
15 | getVideosList, | 15 | getVideosList, |
16 | getVideosListWithToken, | 16 | getVideosListWithToken, |
17 | searchVideo, | ||
18 | searchVideoWithToken, | ||
19 | ServerInfo, | 17 | ServerInfo, |
20 | setAccessTokensToServers, | 18 | setAccessTokensToServers, |
21 | updateCustomConfig, | 19 | updateCustomConfig, |
@@ -23,7 +21,7 @@ import { | |||
23 | uploadVideo, | 21 | uploadVideo, |
24 | userLogin | 22 | userLogin |
25 | } from '@shared/extra-utils' | 23 | } from '@shared/extra-utils' |
26 | import { CustomConfig, ServerConfig, User, VideosOverview } from '@shared/models' | 24 | import { BooleanBothQuery, CustomConfig, ServerConfig, User, VideosOverview } from '@shared/models' |
27 | 25 | ||
28 | const expect = chai.expect | 26 | const expect = chai.expect |
29 | 27 | ||
@@ -37,7 +35,7 @@ describe('Test video NSFW policy', function () { | |||
37 | let userAccessToken: string | 35 | let userAccessToken: string |
38 | let customConfig: CustomConfig | 36 | let customConfig: CustomConfig |
39 | 37 | ||
40 | function getVideosFunctions (token?: string, query = {}) { | 38 | function getVideosFunctions (token?: string, query: { nsfw?: BooleanBothQuery } = {}) { |
41 | return getMyUserInformation(server.url, server.accessToken) | 39 | return getMyUserInformation(server.url, server.accessToken) |
42 | .then(res => { | 40 | .then(res => { |
43 | const user: User = res.body | 41 | const user: User = res.body |
@@ -49,7 +47,7 @@ describe('Test video NSFW policy', function () { | |||
49 | if (token) { | 47 | if (token) { |
50 | promises = [ | 48 | promises = [ |
51 | getVideosListWithToken(server.url, token, query), | 49 | getVideosListWithToken(server.url, token, query), |
52 | searchVideoWithToken(server.url, 'n', token, query), | 50 | server.searchCommand.advancedVideoSearch({ token, search: { search: 'n', ...query } }), |
53 | getAccountVideos(server.url, token, accountName, 0, 5, undefined, query), | 51 | getAccountVideos(server.url, token, accountName, 0, 5, undefined, query), |
54 | getVideoChannelVideos(server.url, token, videoChannelName, 0, 5, undefined, query) | 52 | getVideoChannelVideos(server.url, token, videoChannelName, 0, 5, undefined, query) |
55 | ] | 53 | ] |
@@ -66,7 +64,7 @@ describe('Test video NSFW policy', function () { | |||
66 | 64 | ||
67 | promises = [ | 65 | promises = [ |
68 | getVideosList(server.url), | 66 | getVideosList(server.url), |
69 | searchVideo(server.url, 'n'), | 67 | server.searchCommand.searchVideos({ search: 'n' }), |
70 | getAccountVideos(server.url, undefined, accountName, 0, 5), | 68 | getAccountVideos(server.url, undefined, accountName, 0, 5), |
71 | getVideoChannelVideos(server.url, undefined, videoChannelName, 0, 5) | 69 | getVideoChannelVideos(server.url, undefined, videoChannelName, 0, 5) |
72 | ] | 70 | ] |
@@ -230,7 +228,7 @@ describe('Test video NSFW policy', function () { | |||
230 | }) | 228 | }) |
231 | 229 | ||
232 | it('Should display NSFW videos when the nsfw param === true', async function () { | 230 | it('Should display NSFW videos when the nsfw param === true', async function () { |
233 | for (const res of await getVideosFunctions(server.accessToken, { nsfw: true })) { | 231 | for (const res of await getVideosFunctions(server.accessToken, { nsfw: 'true' })) { |
234 | expect(res.body.total).to.equal(1) | 232 | expect(res.body.total).to.equal(1) |
235 | 233 | ||
236 | const videos = res.body.data | 234 | const videos = res.body.data |
@@ -240,7 +238,7 @@ describe('Test video NSFW policy', function () { | |||
240 | }) | 238 | }) |
241 | 239 | ||
242 | it('Should hide NSFW videos when the nsfw param === true', async function () { | 240 | it('Should hide NSFW videos when the nsfw param === true', async function () { |
243 | for (const res of await getVideosFunctions(server.accessToken, { nsfw: false })) { | 241 | for (const res of await getVideosFunctions(server.accessToken, { nsfw: 'false' })) { |
244 | expect(res.body.total).to.equal(1) | 242 | expect(res.body.total).to.equal(1) |
245 | 243 | ||
246 | const videos = res.body.data | 244 | const videos = res.body.data |