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/bulk.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/bulk.ts')
-rw-r--r-- | server/tests/api/check-params/bulk.ts | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/server/tests/api/check-params/bulk.ts b/server/tests/api/check-params/bulk.ts index 432858b33..07b920ba7 100644 --- a/server/tests/api/check-params/bulk.ts +++ b/server/tests/api/check-params/bulk.ts | |||
@@ -10,6 +10,7 @@ import { | |||
10 | userLogin | 10 | userLogin |
11 | } from '../../../../shared/extra-utils' | 11 | } from '../../../../shared/extra-utils' |
12 | import { makePostBodyRequest } from '../../../../shared/extra-utils/requests/requests' | 12 | import { makePostBodyRequest } from '../../../../shared/extra-utils/requests/requests' |
13 | import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' | ||
13 | 14 | ||
14 | describe('Test bulk API validators', function () { | 15 | describe('Test bulk API validators', function () { |
15 | let server: ServerInfo | 16 | let server: ServerInfo |
@@ -37,7 +38,7 @@ describe('Test bulk API validators', function () { | |||
37 | url: server.url, | 38 | url: server.url, |
38 | path, | 39 | path, |
39 | fields: { accountName: 'user1', scope: 'my-videos' }, | 40 | fields: { accountName: 'user1', scope: 'my-videos' }, |
40 | statusCodeExpected: 401 | 41 | statusCodeExpected: HttpStatusCode.UNAUTHORIZED_401 |
41 | }) | 42 | }) |
42 | }) | 43 | }) |
43 | 44 | ||
@@ -47,7 +48,7 @@ describe('Test bulk API validators', function () { | |||
47 | token: server.accessToken, | 48 | token: server.accessToken, |
48 | path, | 49 | path, |
49 | fields: { accountName: 'user2', scope: 'my-videos' }, | 50 | fields: { accountName: 'user2', scope: 'my-videos' }, |
50 | statusCodeExpected: 404 | 51 | statusCodeExpected: HttpStatusCode.NOT_FOUND_404 |
51 | }) | 52 | }) |
52 | }) | 53 | }) |
53 | 54 | ||
@@ -57,7 +58,7 @@ describe('Test bulk API validators', function () { | |||
57 | token: server.accessToken, | 58 | token: server.accessToken, |
58 | path, | 59 | path, |
59 | fields: { accountName: 'user1', scope: 'my-videoss' }, | 60 | fields: { accountName: 'user1', scope: 'my-videoss' }, |
60 | statusCodeExpected: 400 | 61 | statusCodeExpected: HttpStatusCode.BAD_REQUEST_400 |
61 | }) | 62 | }) |
62 | }) | 63 | }) |
63 | 64 | ||
@@ -67,7 +68,7 @@ describe('Test bulk API validators', function () { | |||
67 | token: userAccessToken, | 68 | token: userAccessToken, |
68 | path, | 69 | path, |
69 | fields: { accountName: 'user1', scope: 'instance' }, | 70 | fields: { accountName: 'user1', scope: 'instance' }, |
70 | statusCodeExpected: 403 | 71 | statusCodeExpected: HttpStatusCode.FORBIDDEN_403 |
71 | }) | 72 | }) |
72 | }) | 73 | }) |
73 | 74 | ||
@@ -77,7 +78,7 @@ describe('Test bulk API validators', function () { | |||
77 | token: server.accessToken, | 78 | token: server.accessToken, |
78 | path, | 79 | path, |
79 | fields: { accountName: 'user1', scope: 'instance' }, | 80 | fields: { accountName: 'user1', scope: 'instance' }, |
80 | statusCodeExpected: 204 | 81 | statusCodeExpected: HttpStatusCode.NO_CONTENT_204 |
81 | }) | 82 | }) |
82 | }) | 83 | }) |
83 | }) | 84 | }) |