aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils/server/jobs.ts
diff options
context:
space:
mode:
authorRigel Kent <sendmemail@rigelk.eu>2020-12-07 14:32:36 +0100
committerGitHub <noreply@github.com>2020-12-07 14:32:36 +0100
commit2d53be0267acc49cda46707b885096193a1f4e9c (patch)
tree887061a34bc67f40acbb96a6278f9544bf83caeb /shared/extra-utils/server/jobs.ts
parentadc1f09c0dbd997f34028c1c82d1c118dc8ead80 (diff)
downloadPeerTube-2d53be0267acc49cda46707b885096193a1f4e9c.tar.gz
PeerTube-2d53be0267acc49cda46707b885096193a1f4e9c.tar.zst
PeerTube-2d53be0267acc49cda46707b885096193a1f4e9c.zip
replace numbers with typed http status codes (#3409)
Diffstat (limited to 'shared/extra-utils/server/jobs.ts')
-rw-r--r--shared/extra-utils/server/jobs.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/shared/extra-utils/server/jobs.ts b/shared/extra-utils/server/jobs.ts
index d984b3d1e..cac00e9ab 100644
--- a/shared/extra-utils/server/jobs.ts
+++ b/shared/extra-utils/server/jobs.ts
@@ -3,6 +3,7 @@ import { Job, JobState, JobType } from '../../models'
3import { wait } from '../miscs/miscs' 3import { wait } from '../miscs/miscs'
4import { ServerInfo } from './servers' 4import { ServerInfo } from './servers'
5import { makeGetRequest } from '../../../shared/extra-utils' 5import { makeGetRequest } from '../../../shared/extra-utils'
6import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'
6 7
7function getJobsList (url: string, accessToken: string, state: JobState) { 8function getJobsList (url: string, accessToken: string, state: JobState) {
8 const path = '/api/v1/jobs/' + state 9 const path = '/api/v1/jobs/' + state
@@ -11,7 +12,7 @@ function getJobsList (url: string, accessToken: string, state: JobState) {
11 .get(path) 12 .get(path)
12 .set('Accept', 'application/json') 13 .set('Accept', 'application/json')
13 .set('Authorization', 'Bearer ' + accessToken) 14 .set('Authorization', 'Bearer ' + accessToken)
14 .expect(200) 15 .expect(HttpStatusCode.OK_200)
15 .expect('Content-Type', /json/) 16 .expect('Content-Type', /json/)
16} 17}
17 18
@@ -38,7 +39,7 @@ function getJobsListPaginationAndSort (options: {
38 url, 39 url,
39 path, 40 path,
40 token: accessToken, 41 token: accessToken,
41 statusCodeExpected: 200, 42 statusCodeExpected: HttpStatusCode.OK_200,
42 query 43 query
43 }) 44 })
44} 45}