]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/server/jobs.ts
Fix missing delete cascade video -> channel
[github/Chocobozzz/PeerTube.git] / server / tests / api / server / jobs.ts
index 19c8836b59ba8641ebb04ac02661b19518585d6a..d0e222997645dad4cfce802fad172fd38144d6a1 100644 (file)
@@ -83,6 +83,19 @@ describe('Test jobs', function () {
     }
   })
 
+  it('Should list all jobs', async function () {
+    const res = await getJobsList(servers[1].url, servers[1].accessToken)
+
+    const jobs = res.body.data as Job[]
+
+    expect(res.body.total).to.be.above(2)
+    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
+  })
+
   after(async function () {
     await cleanupTests(servers)
   })