]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/server/jobs.ts
Add minimum bitrate limit
[github/Chocobozzz/PeerTube.git] / server / tests / api / server / jobs.ts
index 0c44e4dadc68c384ee5c9f870eeee6601b0a6016..5d946f5e819bdac055f2d672ee1e20c2c6825b91 100644 (file)
@@ -4,10 +4,10 @@ import 'mocha'
 import * as chai from 'chai'
 import {
   cleanupTests,
+  createMultipleServers,
   dateIsValid,
   doubleFollow,
-  flushAndRunMultipleServers,
-  ServerInfo,
+  PeerTubeServer,
   setAccessTokensToServers,
   waitJobs
 } from '@shared/extra-utils'
@@ -15,12 +15,12 @@ import {
 const expect = chai.expect
 
 describe('Test jobs', function () {
-  let servers: ServerInfo[]
+  let servers: PeerTubeServer[]
 
   before(async function () {
     this.timeout(30000)
 
-    servers = await flushAndRunMultipleServers(2)
+    servers = await createMultipleServers(2)
 
     await setAccessTokensToServers(servers)
 
@@ -38,14 +38,14 @@ describe('Test jobs', function () {
   })
 
   it('Should list jobs', async function () {
-    const body = await servers[1].jobs.getJobsList({ state: 'completed' })
+    const body = await servers[1].jobs.list({ state: 'completed' })
     expect(body.total).to.be.above(2)
     expect(body.data).to.have.length.above(2)
   })
 
   it('Should list jobs with sort, pagination and job type', async function () {
     {
-      const body = await servers[1].jobs.getJobsList({
+      const body = await servers[1].jobs.list({
         state: 'completed',
         start: 1,
         count: 2,
@@ -56,7 +56,7 @@ describe('Test jobs', function () {
 
       let job = body.data[0]
       // Skip repeat jobs
-      if (job.type === 'videos-views') job = body.data[1]
+      if (job.type === 'videos-views-stats') job = body.data[1]
 
       expect(job.state).to.equal('completed')
       expect(job.type.startsWith('activitypub-')).to.be.true
@@ -66,7 +66,7 @@ describe('Test jobs', function () {
     }
 
     {
-      const body = await servers[1].jobs.getJobsList({
+      const body = await servers[1].jobs.list({
         state: 'completed',
         start: 0,
         count: 100,
@@ -82,14 +82,12 @@ describe('Test jobs', function () {
   })
 
   it('Should list all jobs', async function () {
-    const body = await servers[1].jobs.getJobsList()
+    const body = await servers[1].jobs.list()
     expect(body.total).to.be.above(2)
 
     const jobs = body.data
     expect(jobs).to.have.length.above(2)
 
-    // We know there are a least 1 delayed job (video views) and 1 completed job (broadcast)
-    expect(jobs.find(j => j.state === 'delayed')).to.not.be.undefined
     expect(jobs.find(j => j.state === 'completed')).to.not.be.undefined
   })