]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/server/jobs.ts
Shorter server command names
[github/Chocobozzz/PeerTube.git] / server / tests / api / server / jobs.ts
index 6854568d3c352f8c07cd6b10e974b447b97d754f..0c44e4dadc68c384ee5c9f870eeee6601b0a6016 100644 (file)
@@ -9,7 +9,6 @@ import {
   flushAndRunMultipleServers,
   ServerInfo,
   setAccessTokensToServers,
-  uploadVideo,
   waitJobs
 } from '@shared/extra-utils'
 
@@ -32,21 +31,21 @@ describe('Test jobs', function () {
   it('Should create some jobs', async function () {
     this.timeout(120000)
 
-    await uploadVideo(servers[1].url, servers[1].accessToken, { name: 'video1' })
-    await uploadVideo(servers[1].url, servers[1].accessToken, { name: 'video2' })
+    await servers[1].videos.upload({ attributes: { name: 'video1' } })
+    await servers[1].videos.upload({ attributes: { name: 'video2' } })
 
     await waitJobs(servers)
   })
 
   it('Should list jobs', async function () {
-    const body = await servers[1].jobsCommand.getJobsList({ state: 'completed' })
+    const body = await servers[1].jobs.getJobsList({ 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].jobsCommand.getJobsList({
+      const body = await servers[1].jobs.getJobsList({
         state: 'completed',
         start: 1,
         count: 2,
@@ -67,7 +66,7 @@ describe('Test jobs', function () {
     }
 
     {
-      const body = await servers[1].jobsCommand.getJobsList({
+      const body = await servers[1].jobs.getJobsList({
         state: 'completed',
         start: 0,
         count: 100,
@@ -83,7 +82,7 @@ describe('Test jobs', function () {
   })
 
   it('Should list all jobs', async function () {
-    const body = await servers[1].jobsCommand.getJobsList()
+    const body = await servers[1].jobs.getJobsList()
     expect(body.total).to.be.above(2)
 
     const jobs = body.data