diff options
author | Chocobozzz <me@florianbigard.com> | 2019-04-15 10:49:46 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-04-15 14:39:52 +0200 |
commit | 1eddc9a74f9a80fa5d0cb25fceb3fc47a1a3c14a (patch) | |
tree | 91a10310cdf924779527525d39f8eb7e09e4ba49 /server/tests/api/check-params/video-blacklist.ts | |
parent | 31b48aad478506d4214586f02792816efa968e4b (diff) | |
download | PeerTube-1eddc9a74f9a80fa5d0cb25fceb3fc47a1a3c14a.tar.gz PeerTube-1eddc9a74f9a80fa5d0cb25fceb3fc47a1a3c14a.tar.zst PeerTube-1eddc9a74f9a80fa5d0cb25fceb3fc47a1a3c14a.zip |
Add user adminFlags
Diffstat (limited to 'server/tests/api/check-params/video-blacklist.ts')
-rw-r--r-- | server/tests/api/check-params/video-blacklist.ts | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/server/tests/api/check-params/video-blacklist.ts b/server/tests/api/check-params/video-blacklist.ts index fc039e847..81423aee9 100644 --- a/server/tests/api/check-params/video-blacklist.ts +++ b/server/tests/api/check-params/video-blacklist.ts | |||
@@ -8,7 +8,6 @@ import { | |||
8 | flushAndRunMultipleServers, | 8 | flushAndRunMultipleServers, |
9 | flushTests, | 9 | flushTests, |
10 | getBlacklistedVideosList, | 10 | getBlacklistedVideosList, |
11 | getBlacklistedVideosListWithTypeFilter, | ||
12 | getVideo, | 11 | getVideo, |
13 | getVideoWithToken, | 12 | getVideoWithToken, |
14 | killallServers, | 13 | killallServers, |
@@ -49,14 +48,14 @@ describe('Test video blacklist API validators', function () { | |||
49 | { | 48 | { |
50 | const username = 'user1' | 49 | const username = 'user1' |
51 | const password = 'my super password' | 50 | const password = 'my super password' |
52 | await createUser(servers[0].url, servers[0].accessToken, username, password) | 51 | await createUser({ url: servers[ 0 ].url, accessToken: servers[ 0 ].accessToken, username: username, password: password }) |
53 | userAccessToken1 = await userLogin(servers[0], { username, password }) | 52 | userAccessToken1 = await userLogin(servers[0], { username, password }) |
54 | } | 53 | } |
55 | 54 | ||
56 | { | 55 | { |
57 | const username = 'user2' | 56 | const username = 'user2' |
58 | const password = 'my super password' | 57 | const password = 'my super password' |
59 | await createUser(servers[0].url, servers[0].accessToken, username, password) | 58 | await createUser({ url: servers[ 0 ].url, accessToken: servers[ 0 ].accessToken, username: username, password: password }) |
60 | userAccessToken2 = await userLogin(servers[0], { username, password }) | 59 | userAccessToken2 = await userLogin(servers[0], { username, password }) |
61 | } | 60 | } |
62 | 61 | ||
@@ -221,11 +220,11 @@ describe('Test video blacklist API validators', function () { | |||
221 | const basePath = '/api/v1/videos/blacklist/' | 220 | const basePath = '/api/v1/videos/blacklist/' |
222 | 221 | ||
223 | it('Should fail with a non authenticated user', async function () { | 222 | it('Should fail with a non authenticated user', async function () { |
224 | await getBlacklistedVideosList(servers[0].url, 'fake token', 401) | 223 | await getBlacklistedVideosList({ url: servers[0].url, token: 'fake token', specialStatus: 401 }) |
225 | }) | 224 | }) |
226 | 225 | ||
227 | it('Should fail with a non admin user', async function () { | 226 | it('Should fail with a non admin user', async function () { |
228 | await getBlacklistedVideosList(servers[0].url, userAccessToken2, 403) | 227 | await getBlacklistedVideosList({ url: servers[0].url, token: userAccessToken2, specialStatus: 403 }) |
229 | }) | 228 | }) |
230 | 229 | ||
231 | it('Should fail with a bad start pagination', async function () { | 230 | it('Should fail with a bad start pagination', async function () { |
@@ -241,11 +240,11 @@ describe('Test video blacklist API validators', function () { | |||
241 | }) | 240 | }) |
242 | 241 | ||
243 | it('Should fail with an invalid type', async function () { | 242 | it('Should fail with an invalid type', async function () { |
244 | await getBlacklistedVideosListWithTypeFilter(servers[0].url, servers[0].accessToken, 0, 400) | 243 | await getBlacklistedVideosList({ url: servers[0].url, token: servers[0].accessToken, type: 0, specialStatus: 400 }) |
245 | }) | 244 | }) |
246 | 245 | ||
247 | it('Should succeed with the correct parameters', async function () { | 246 | it('Should succeed with the correct parameters', async function () { |
248 | await getBlacklistedVideosListWithTypeFilter(servers[0].url, servers[0].accessToken, VideoBlacklistType.MANUAL) | 247 | await getBlacklistedVideosList({ url: servers[0].url, token: servers[0].accessToken, type: VideoBlacklistType.MANUAL }) |
249 | }) | 248 | }) |
250 | }) | 249 | }) |
251 | 250 | ||