diff options
Diffstat (limited to 'server/tests/api/check-params/video-comments.ts')
-rw-r--r-- | server/tests/api/check-params/video-comments.ts | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/server/tests/api/check-params/video-comments.ts b/server/tests/api/check-params/video-comments.ts index 181282ce1..662d4a70d 100644 --- a/server/tests/api/check-params/video-comments.ts +++ b/server/tests/api/check-params/video-comments.ts | |||
@@ -296,6 +296,54 @@ describe('Test video comments API validator', function () { | |||
296 | it('Should return conflict on comment thread add') | 296 | it('Should return conflict on comment thread add') |
297 | }) | 297 | }) |
298 | 298 | ||
299 | describe('When listing admin comments threads', function () { | ||
300 | const path = '/api/v1/videos/comments' | ||
301 | |||
302 | it('Should fail with a bad start pagination', async function () { | ||
303 | await checkBadStartPagination(server.url, path, server.accessToken) | ||
304 | }) | ||
305 | |||
306 | it('Should fail with a bad count pagination', async function () { | ||
307 | await checkBadCountPagination(server.url, path, server.accessToken) | ||
308 | }) | ||
309 | |||
310 | it('Should fail with an incorrect sort', async function () { | ||
311 | await checkBadSortPagination(server.url, path, server.accessToken) | ||
312 | }) | ||
313 | |||
314 | it('Should fail with a non authenticated user', async function () { | ||
315 | await makeGetRequest({ | ||
316 | url: server.url, | ||
317 | path, | ||
318 | statusCodeExpected: 401 | ||
319 | }) | ||
320 | }) | ||
321 | |||
322 | it('Should fail with a non admin user', async function () { | ||
323 | await makeGetRequest({ | ||
324 | url: server.url, | ||
325 | path, | ||
326 | token: userAccessToken, | ||
327 | statusCodeExpected: 403 | ||
328 | }) | ||
329 | }) | ||
330 | |||
331 | it('Should succeed with the correct params', async function () { | ||
332 | await makeGetRequest({ | ||
333 | url: server.url, | ||
334 | path, | ||
335 | token: server.accessToken, | ||
336 | query: { | ||
337 | isLocal: false, | ||
338 | search: 'toto', | ||
339 | searchAccount: 'toto', | ||
340 | searchVideo: 'toto' | ||
341 | }, | ||
342 | statusCodeExpected: 200 | ||
343 | }) | ||
344 | }) | ||
345 | }) | ||
346 | |||
299 | after(async function () { | 347 | after(async function () { |
300 | await cleanupTests([ server ]) | 348 | await cleanupTests([ server ]) |
301 | }) | 349 | }) |