]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/check-params/video-imports.ts
Add check params account ratings tests
[github/Chocobozzz/PeerTube.git] / server / tests / api / check-params / video-imports.ts
index e62f0918e9f35c767693d54f77a18eab6bb1178d..6dd9f15f7ccd976088bb3d41175fb3aa0f98f989 100644 (file)
@@ -18,9 +18,13 @@ import {
   setAccessTokensToServers,
   updateCustomSubConfig,
   userLogin
-} from '../../utils'
-import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '../../utils/requests/check-api-params'
-import { getMagnetURI, getYoutubeVideoUrl } from '../../utils/videos/video-imports'
+} from '../../../../shared/utils'
+import {
+  checkBadCountPagination,
+  checkBadSortPagination,
+  checkBadStartPagination
+} from '../../../../shared/utils/requests/check-api-params'
+import { getMagnetURI, getYoutubeVideoUrl } from '../../../../shared/utils/videos/video-imports'
 
 describe('Test video imports API validator', function () {
   const path = '/api/v1/videos/imports'
@@ -28,7 +32,6 @@ describe('Test video imports API validator', function () {
   let userAccessToken = ''
   let accountName: string
   let channelId: number
-  let channelUUID: string
 
   // ---------------------------------------------------------------
 
@@ -49,7 +52,6 @@ describe('Test video imports API validator', function () {
     {
       const res = await getMyUserInformation(server.url, server.accessToken)
       channelId = res.body.videoChannels[ 0 ].id
-      channelUUID = res.body.videoChannels[ 0 ].uuid
       accountName = res.body.account.name + '@' + res.body.account.host
     }
   })
@@ -86,6 +88,7 @@ describe('Test video imports API validator', function () {
         language: 'pt',
         nsfw: false,
         commentsEnabled: true,
+        downloadEnabled: true,
         waitTranscoding: true,
         description: 'my super description',
         support: 'my super support text',
@@ -142,7 +145,7 @@ describe('Test video imports API validator', function () {
     })
 
     it('Should fail with a long support text', async function () {
-      const fields = immutableAssign(baseCorrectParams, { support: 'super'.repeat(150) })
+      const fields = immutableAssign(baseCorrectParams, { support: 'super'.repeat(201) })
 
       await makePostBodyRequest({ url: server.url, path, token: server.accessToken, fields })
     })
@@ -246,7 +249,7 @@ describe('Test video imports API validator', function () {
     })
 
     it('Should succeed with the correct parameters', async function () {
-      this.timeout(10000)
+      this.timeout(30000)
 
       {
         await makePostBodyRequest({
@@ -303,7 +306,7 @@ describe('Test video imports API validator', function () {
 
       fields = omit(fields, 'magnetUri')
       const attaches = {
-        'torrentfile': join(__dirname, '..', '..', 'fixtures', '60fps_small-240p.torrent')
+        'torrentfile': join(__dirname, '..', '..', 'fixtures', 'video-720p.torrent')
       }
 
       await makeUploadRequest({ url: server.url, path, token: server.accessToken, fields, attaches, statusCodeExpected: 409 })