]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/check-params/users.ts
Fix audio encoding params
[github/Chocobozzz/PeerTube.git] / server / tests / api / check-params / users.ts
index 4d597f0a3d53a2502af95c98a96256fc427309cc..2a220be83b1c863f47a56fd203d2ab23617e0b43 100644 (file)
@@ -1,10 +1,10 @@
 /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
 
-import { omit } from 'lodash'
 import 'mocha'
+import { expect } from 'chai'
+import { omit } from 'lodash'
 import { join } from 'path'
 import { User, UserRole, VideoImport, VideoImportState } from '../../../../shared'
-
 import {
   addVideoChannel,
   blockUser,
@@ -31,17 +31,16 @@ import {
   uploadVideo,
   userLogin
 } from '../../../../shared/extra-utils'
+import { MockSmtpServer } from '../../../../shared/extra-utils/miscs/email'
 import {
   checkBadCountPagination,
   checkBadSortPagination,
   checkBadStartPagination
 } from '../../../../shared/extra-utils/requests/check-api-params'
-import { getMagnetURI, getMyVideoImports, getYoutubeVideoUrl, importVideo } from '../../../../shared/extra-utils/videos/video-imports'
-import { VideoPrivacy } from '../../../../shared/models/videos'
 import { waitJobs } from '../../../../shared/extra-utils/server/jobs'
-import { expect } from 'chai'
+import { getMagnetURI, getMyVideoImports, getGoodVideoUrl, importVideo } from '../../../../shared/extra-utils/videos/video-imports'
 import { UserAdminFlag } from '../../../../shared/models/users/user-flag.model'
-import { MockSmtpServer } from '../../../../shared/extra-utils/miscs/email'
+import { VideoPrivacy } from '../../../../shared/models/videos'
 
 describe('Test users API validators', function () {
   const path = '/api/v1/users/'
@@ -55,8 +54,6 @@ describe('Test users API validators', function () {
   let moderatorAccessToken = ''
   let emailPort: number
   let overrideConfig: Object
-  // eslint-disable-next-line @typescript-eslint/no-unused-vars
-  let channelId: number
 
   // ---------------------------------------------------------------
 
@@ -129,11 +126,6 @@ describe('Test users API validators', function () {
       })
     }
 
-    {
-      const res = await getMyUserInformation(server.url, server.accessToken)
-      channelId = res.body.videoChannels[0].id
-    }
-
     {
       const res = await uploadVideo(server.url, server.accessToken, {})
       videoId = res.body.video.id
@@ -188,7 +180,7 @@ describe('Test users API validators', function () {
       videoQuota: -1,
       videoQuotaDaily: -1,
       role: UserRole.USER,
-      adminFlags: UserAdminFlag.BY_PASS_VIDEO_AUTO_BLACKLIST
+      adminFlags: UserAdminFlag.BYPASS_VIDEO_AUTO_BLACKLIST
     }
 
     it('Should fail with a too small username', async function () {
@@ -1042,9 +1034,9 @@ describe('Test users API validators', function () {
         channelId: 1,
         privacy: VideoPrivacy.PUBLIC
       }
-      await importVideo(server.url, server.accessToken, immutableAssign(baseAttributes, { targetUrl: getYoutubeVideoUrl() }))
+      await importVideo(server.url, server.accessToken, immutableAssign(baseAttributes, { targetUrl: getGoodVideoUrl() }))
       await importVideo(server.url, server.accessToken, immutableAssign(baseAttributes, { magnetUri: getMagnetURI() }))
-      await importVideo(server.url, server.accessToken, immutableAssign(baseAttributes, { torrentfile: 'video-720p.torrent' }))
+      await importVideo(server.url, server.accessToken, immutableAssign(baseAttributes, { torrentfile: 'video-720p.torrent' as any }))
 
       await waitJobs([ server ])