]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/check-params/video-abuses.ts
Add migrations
[github/Chocobozzz/PeerTube.git] / server / tests / api / check-params / video-abuses.ts
index d2bed6a2a2e59cf60145f60517b76b99f751fde4..78e4acf2feb24cd3c39960913fb5f149104053c0 100644 (file)
@@ -15,8 +15,12 @@ import {
   updateVideoAbuse,
   uploadVideo,
   userLogin
-} from '../../utils'
-import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '../../utils/requests/check-api-params'
+} from '../../../../shared/extra-utils'
+import {
+  checkBadCountPagination,
+  checkBadSortPagination,
+  checkBadStartPagination
+} from '../../../../shared/extra-utils/requests/check-api-params'
 import { VideoAbuseState } from '../../../../shared/models/videos'
 
 describe('Test video abuses API validators', function () {
@@ -37,7 +41,7 @@ describe('Test video abuses API validators', function () {
 
     const username = 'user1'
     const password = 'my super password'
-    await createUser(server.url, server.accessToken, username, password)
+    await createUser({ url: server.url, accessToken: server.accessToken, username: username, password: password })
     userAccessToken = await userLogin(server, { username, password })
 
     const res = await uploadVideo(server.url, server.accessToken, {})
@@ -109,8 +113,8 @@ describe('Test video abuses API validators', function () {
       await makePostBodyRequest({ url: server.url, path, token: server.accessToken, fields })
     })
 
-    it('Should fail with a reason too big', async function () {
-      const fields = { reason: 'super'.repeat(61) }
+    it('Should fail with a too big reason', async function () {
+      const fields = { reason: 'super'.repeat(605) }
 
       await makePostBodyRequest({ url: server.url, path, token: server.accessToken, fields })
     })
@@ -150,7 +154,7 @@ describe('Test video abuses API validators', function () {
     })
 
     it('Should fail with a bad moderation comment', async function () {
-      const body = { moderationComment: 'b'.repeat(305) }
+      const body = { moderationComment: 'b'.repeat(3001) }
       await updateVideoAbuse(server.url, server.accessToken, server.video.uuid, videoAbuseId, body, 400)
     })