diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2020-12-07 14:32:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-07 14:32:36 +0100 |
commit | 2d53be0267acc49cda46707b885096193a1f4e9c (patch) | |
tree | 887061a34bc67f40acbb96a6278f9544bf83caeb /server/tests/api/check-params/config.ts | |
parent | adc1f09c0dbd997f34028c1c82d1c118dc8ead80 (diff) | |
download | PeerTube-2d53be0267acc49cda46707b885096193a1f4e9c.tar.gz PeerTube-2d53be0267acc49cda46707b885096193a1f4e9c.tar.zst PeerTube-2d53be0267acc49cda46707b885096193a1f4e9c.zip |
replace numbers with typed http status codes (#3409)
Diffstat (limited to 'server/tests/api/check-params/config.ts')
-rw-r--r-- | server/tests/api/check-params/config.ts | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/server/tests/api/check-params/config.ts b/server/tests/api/check-params/config.ts index 42ac5e1f9..08576c3ae 100644 --- a/server/tests/api/check-params/config.ts +++ b/server/tests/api/check-params/config.ts | |||
@@ -16,6 +16,7 @@ import { | |||
16 | setAccessTokensToServers, | 16 | setAccessTokensToServers, |
17 | userLogin | 17 | userLogin |
18 | } from '../../../../shared/extra-utils' | 18 | } from '../../../../shared/extra-utils' |
19 | import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' | ||
19 | 20 | ||
20 | describe('Test config API validators', function () { | 21 | describe('Test config API validators', function () { |
21 | const path = '/api/v1/config/custom' | 22 | const path = '/api/v1/config/custom' |
@@ -197,7 +198,7 @@ describe('Test config API validators', function () { | |||
197 | await makeGetRequest({ | 198 | await makeGetRequest({ |
198 | url: server.url, | 199 | url: server.url, |
199 | path, | 200 | path, |
200 | statusCodeExpected: 401 | 201 | statusCodeExpected: HttpStatusCode.UNAUTHORIZED_401 |
201 | }) | 202 | }) |
202 | }) | 203 | }) |
203 | 204 | ||
@@ -206,7 +207,7 @@ describe('Test config API validators', function () { | |||
206 | url: server.url, | 207 | url: server.url, |
207 | path, | 208 | path, |
208 | token: userAccessToken, | 209 | token: userAccessToken, |
209 | statusCodeExpected: 403 | 210 | statusCodeExpected: HttpStatusCode.FORBIDDEN_403 |
210 | }) | 211 | }) |
211 | }) | 212 | }) |
212 | }) | 213 | }) |
@@ -217,7 +218,7 @@ describe('Test config API validators', function () { | |||
217 | url: server.url, | 218 | url: server.url, |
218 | path, | 219 | path, |
219 | fields: updateParams, | 220 | fields: updateParams, |
220 | statusCodeExpected: 401 | 221 | statusCodeExpected: HttpStatusCode.UNAUTHORIZED_401 |
221 | }) | 222 | }) |
222 | }) | 223 | }) |
223 | 224 | ||
@@ -227,7 +228,7 @@ describe('Test config API validators', function () { | |||
227 | path, | 228 | path, |
228 | fields: updateParams, | 229 | fields: updateParams, |
229 | token: userAccessToken, | 230 | token: userAccessToken, |
230 | statusCodeExpected: 403 | 231 | statusCodeExpected: HttpStatusCode.FORBIDDEN_403 |
231 | }) | 232 | }) |
232 | }) | 233 | }) |
233 | 234 | ||
@@ -239,7 +240,7 @@ describe('Test config API validators', function () { | |||
239 | path, | 240 | path, |
240 | fields: newUpdateParams, | 241 | fields: newUpdateParams, |
241 | token: server.accessToken, | 242 | token: server.accessToken, |
242 | statusCodeExpected: 400 | 243 | statusCodeExpected: HttpStatusCode.BAD_REQUEST_400 |
243 | }) | 244 | }) |
244 | }) | 245 | }) |
245 | 246 | ||
@@ -255,7 +256,7 @@ describe('Test config API validators', function () { | |||
255 | path, | 256 | path, |
256 | fields: newUpdateParams, | 257 | fields: newUpdateParams, |
257 | token: server.accessToken, | 258 | token: server.accessToken, |
258 | statusCodeExpected: 400 | 259 | statusCodeExpected: HttpStatusCode.BAD_REQUEST_400 |
259 | }) | 260 | }) |
260 | }) | 261 | }) |
261 | 262 | ||
@@ -274,7 +275,7 @@ describe('Test config API validators', function () { | |||
274 | path, | 275 | path, |
275 | fields: newUpdateParams, | 276 | fields: newUpdateParams, |
276 | token: server.accessToken, | 277 | token: server.accessToken, |
277 | statusCodeExpected: 400 | 278 | statusCodeExpected: HttpStatusCode.BAD_REQUEST_400 |
278 | }) | 279 | }) |
279 | }) | 280 | }) |
280 | 281 | ||
@@ -295,7 +296,7 @@ describe('Test config API validators', function () { | |||
295 | path, | 296 | path, |
296 | fields: newUpdateParams, | 297 | fields: newUpdateParams, |
297 | token: server.accessToken, | 298 | token: server.accessToken, |
298 | statusCodeExpected: 400 | 299 | statusCodeExpected: HttpStatusCode.BAD_REQUEST_400 |
299 | }) | 300 | }) |
300 | }) | 301 | }) |
301 | 302 | ||
@@ -305,7 +306,7 @@ describe('Test config API validators', function () { | |||
305 | path, | 306 | path, |
306 | fields: updateParams, | 307 | fields: updateParams, |
307 | token: server.accessToken, | 308 | token: server.accessToken, |
308 | statusCodeExpected: 200 | 309 | statusCodeExpected: HttpStatusCode.OK_200 |
309 | }) | 310 | }) |
310 | }) | 311 | }) |
311 | }) | 312 | }) |
@@ -315,7 +316,7 @@ describe('Test config API validators', function () { | |||
315 | await makeDeleteRequest({ | 316 | await makeDeleteRequest({ |
316 | url: server.url, | 317 | url: server.url, |
317 | path, | 318 | path, |
318 | statusCodeExpected: 401 | 319 | statusCodeExpected: HttpStatusCode.UNAUTHORIZED_401 |
319 | }) | 320 | }) |
320 | }) | 321 | }) |
321 | 322 | ||
@@ -324,7 +325,7 @@ describe('Test config API validators', function () { | |||
324 | url: server.url, | 325 | url: server.url, |
325 | path, | 326 | path, |
326 | token: userAccessToken, | 327 | token: userAccessToken, |
327 | statusCodeExpected: 403 | 328 | statusCodeExpected: HttpStatusCode.FORBIDDEN_403 |
328 | }) | 329 | }) |
329 | }) | 330 | }) |
330 | }) | 331 | }) |