]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/utils/server/jobs.ts
Begin import script with youtube-dl
[github/Chocobozzz/PeerTube.git] / server / tests / utils / server / jobs.ts
index 0a8c51575f3376fdeb2b09f630e8da4badbd291c..4053dd40b203a49dba373a41e3d430a324cc6761 100644 (file)
@@ -1,7 +1,8 @@
 import * as request from 'supertest'
+import { JobState } from '../../../../shared/models'
 
-function getJobsList (url: string, accessToken: string) {
-  const path = '/api/v1/jobs'
+function getJobsList (url: string, accessToken: string, state: JobState) {
+  const path = '/api/v1/jobs/' + state
 
   return request(url)
           .get(path)
@@ -11,8 +12,8 @@ function getJobsList (url: string, accessToken: string) {
           .expect('Content-Type', /json/)
 }
 
-function getJobsListPaginationAndSort (url: string, accessToken: string, start: number, count: number, sort: string) {
-  const path = '/api/v1/jobs'
+function getJobsListPaginationAndSort (url: string, accessToken: string, state: JobState, start: number, count: number, sort: string) {
+  const path = '/api/v1/jobs/' + state
 
   return request(url)
           .get(path)