diff options
Diffstat (limited to 'server/tests/api/check-params')
-rw-r--r-- | server/tests/api/check-params/config.ts | 7 | ||||
-rw-r--r-- | server/tests/api/check-params/user-notifications.ts | 1 | ||||
-rw-r--r-- | server/tests/api/check-params/video-blacklist.ts | 11 | ||||
-rw-r--r-- | server/tests/api/check-params/videos.ts | 3 |
4 files changed, 20 insertions, 2 deletions
diff --git a/server/tests/api/check-params/config.ts b/server/tests/api/check-params/config.ts index c6b460f23..0b333e2f4 100644 --- a/server/tests/api/check-params/config.ts +++ b/server/tests/api/check-params/config.ts | |||
@@ -80,6 +80,13 @@ describe('Test config API validators', function () { | |||
80 | enabled: false | 80 | enabled: false |
81 | } | 81 | } |
82 | } | 82 | } |
83 | }, | ||
84 | autoBlacklist: { | ||
85 | videos: { | ||
86 | ofUsers: { | ||
87 | enabled: false | ||
88 | } | ||
89 | } | ||
83 | } | 90 | } |
84 | } | 91 | } |
85 | 92 | ||
diff --git a/server/tests/api/check-params/user-notifications.ts b/server/tests/api/check-params/user-notifications.ts index 714f481e9..36eaceac7 100644 --- a/server/tests/api/check-params/user-notifications.ts +++ b/server/tests/api/check-params/user-notifications.ts | |||
@@ -168,6 +168,7 @@ describe('Test user notifications API validators', function () { | |||
168 | newVideoFromSubscription: UserNotificationSettingValue.WEB, | 168 | newVideoFromSubscription: UserNotificationSettingValue.WEB, |
169 | newCommentOnMyVideo: UserNotificationSettingValue.WEB, | 169 | newCommentOnMyVideo: UserNotificationSettingValue.WEB, |
170 | videoAbuseAsModerator: UserNotificationSettingValue.WEB, | 170 | videoAbuseAsModerator: UserNotificationSettingValue.WEB, |
171 | videoAutoBlacklistAsModerator: UserNotificationSettingValue.WEB, | ||
171 | blacklistOnMyVideo: UserNotificationSettingValue.WEB, | 172 | blacklistOnMyVideo: UserNotificationSettingValue.WEB, |
172 | myVideoImportFinished: UserNotificationSettingValue.WEB, | 173 | myVideoImportFinished: UserNotificationSettingValue.WEB, |
173 | myVideoPublished: UserNotificationSettingValue.WEB, | 174 | myVideoPublished: UserNotificationSettingValue.WEB, |
diff --git a/server/tests/api/check-params/video-blacklist.ts b/server/tests/api/check-params/video-blacklist.ts index 6b82643f4..fc039e847 100644 --- a/server/tests/api/check-params/video-blacklist.ts +++ b/server/tests/api/check-params/video-blacklist.ts | |||
@@ -8,6 +8,7 @@ import { | |||
8 | flushAndRunMultipleServers, | 8 | flushAndRunMultipleServers, |
9 | flushTests, | 9 | flushTests, |
10 | getBlacklistedVideosList, | 10 | getBlacklistedVideosList, |
11 | getBlacklistedVideosListWithTypeFilter, | ||
11 | getVideo, | 12 | getVideo, |
12 | getVideoWithToken, | 13 | getVideoWithToken, |
13 | killallServers, | 14 | killallServers, |
@@ -24,7 +25,7 @@ import { | |||
24 | checkBadSortPagination, | 25 | checkBadSortPagination, |
25 | checkBadStartPagination | 26 | checkBadStartPagination |
26 | } from '../../../../shared/utils/requests/check-api-params' | 27 | } from '../../../../shared/utils/requests/check-api-params' |
27 | import { VideoDetails } from '../../../../shared/models/videos' | 28 | import { VideoDetails, VideoBlacklistType } from '../../../../shared/models/videos' |
28 | import { expect } from 'chai' | 29 | import { expect } from 'chai' |
29 | 30 | ||
30 | describe('Test video blacklist API validators', function () { | 31 | describe('Test video blacklist API validators', function () { |
@@ -238,6 +239,14 @@ describe('Test video blacklist API validators', function () { | |||
238 | it('Should fail with an incorrect sort', async function () { | 239 | it('Should fail with an incorrect sort', async function () { |
239 | await checkBadSortPagination(servers[0].url, basePath, servers[0].accessToken) | 240 | await checkBadSortPagination(servers[0].url, basePath, servers[0].accessToken) |
240 | }) | 241 | }) |
242 | |||
243 | it('Should fail with an invalid type', async function () { | ||
244 | await getBlacklistedVideosListWithTypeFilter(servers[0].url, servers[0].accessToken, 0, 400) | ||
245 | }) | ||
246 | |||
247 | it('Should succeed with the correct parameters', async function () { | ||
248 | await getBlacklistedVideosListWithTypeFilter(servers[0].url, servers[0].accessToken, VideoBlacklistType.MANUAL) | ||
249 | }) | ||
241 | }) | 250 | }) |
242 | 251 | ||
243 | after(async function () { | 252 | after(async function () { |
diff --git a/server/tests/api/check-params/videos.ts b/server/tests/api/check-params/videos.ts index 3eccaee44..5a013b890 100644 --- a/server/tests/api/check-params/videos.ts +++ b/server/tests/api/check-params/videos.ts | |||
@@ -7,7 +7,8 @@ import { join } from 'path' | |||
7 | import { VideoPrivacy } from '../../../../shared/models/videos/video-privacy.enum' | 7 | import { VideoPrivacy } from '../../../../shared/models/videos/video-privacy.enum' |
8 | import { | 8 | import { |
9 | createUser, flushTests, getMyUserInformation, getVideo, getVideosList, immutableAssign, killallServers, makeDeleteRequest, | 9 | createUser, flushTests, getMyUserInformation, getVideo, getVideosList, immutableAssign, killallServers, makeDeleteRequest, |
10 | makeGetRequest, makeUploadRequest, makePutBodyRequest, removeVideo, runServer, ServerInfo, setAccessTokensToServers, userLogin | 10 | makeGetRequest, makeUploadRequest, makePutBodyRequest, removeVideo, uploadVideo, |
11 | runServer, ServerInfo, setAccessTokensToServers, userLogin, updateCustomSubConfig | ||
11 | } from '../../../../shared/utils' | 12 | } from '../../../../shared/utils' |
12 | import { | 13 | import { |
13 | checkBadCountPagination, | 14 | checkBadCountPagination, |