]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/videos/videos-filter.ts
Rewrite youtube-dl import
[github/Chocobozzz/PeerTube.git] / server / tests / api / videos / videos-filter.ts
index af1541dbd1c2be5ffe8985eb4e536ea914aa59b3..2306807bf94232562e239ea6d5bcdfcba39be815 100644 (file)
@@ -2,18 +2,17 @@
 
 import 'mocha'
 import { expect } from 'chai'
-import { HttpStatusCode } from '@shared/core-utils'
 import {
   cleanupTests,
+  createMultipleServers,
   doubleFollow,
-  flushAndRunMultipleServers,
   makeGetRequest,
-  ServerInfo,
+  PeerTubeServer,
   setAccessTokensToServers
 } from '@shared/extra-utils'
-import { UserRole, Video, VideoPrivacy } from '@shared/models'
+import { HttpStatusCode, UserRole, Video, VideoPrivacy } from '@shared/models'
 
-async function getVideosNames (server: ServerInfo, token: string, filter: string, statusCodeExpected = HttpStatusCode.OK_200) {
+async function getVideosNames (server: PeerTubeServer, token: string, filter: string, expectedStatus = HttpStatusCode.OK_200) {
   const paths = [
     '/api/v1/video-channels/root_channel/videos',
     '/api/v1/accounts/root/videos',
@@ -32,7 +31,7 @@ async function getVideosNames (server: ServerInfo, token: string, filter: string
         sort: 'createdAt',
         filter
       },
-      statusCodeExpected
+      expectedStatus
     })
 
     videosResults.push(res.body.data.map(v => v.name))
@@ -42,14 +41,14 @@ async function getVideosNames (server: ServerInfo, token: string, filter: string
 }
 
 describe('Test videos filter', function () {
-  let servers: ServerInfo[]
+  let servers: PeerTubeServer[]
 
   // ---------------------------------------------------------------
 
   before(async function () {
     this.timeout(160000)
 
-    servers = await flushAndRunMultipleServers(2)
+    servers = await createMultipleServers(2)
 
     await setAccessTokensToServers(servers)