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/logs.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/logs.ts')
-rw-r--r-- | server/tests/api/check-params/logs.ts | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/server/tests/api/check-params/logs.ts b/server/tests/api/check-params/logs.ts index 719da54e6..dac1e6b98 100644 --- a/server/tests/api/check-params/logs.ts +++ b/server/tests/api/check-params/logs.ts | |||
@@ -11,6 +11,7 @@ import { | |||
11 | userLogin | 11 | userLogin |
12 | } from '../../../../shared/extra-utils' | 12 | } from '../../../../shared/extra-utils' |
13 | import { makeGetRequest } from '../../../../shared/extra-utils/requests/requests' | 13 | import { makeGetRequest } from '../../../../shared/extra-utils/requests/requests' |
14 | import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' | ||
14 | 15 | ||
15 | describe('Test logs API validators', function () { | 16 | describe('Test logs API validators', function () { |
16 | const path = '/api/v1/server/logs' | 17 | const path = '/api/v1/server/logs' |
@@ -40,7 +41,7 @@ describe('Test logs API validators', function () { | |||
40 | await makeGetRequest({ | 41 | await makeGetRequest({ |
41 | url: server.url, | 42 | url: server.url, |
42 | path, | 43 | path, |
43 | statusCodeExpected: 401 | 44 | statusCodeExpected: HttpStatusCode.UNAUTHORIZED_401 |
44 | }) | 45 | }) |
45 | }) | 46 | }) |
46 | 47 | ||
@@ -49,7 +50,7 @@ describe('Test logs API validators', function () { | |||
49 | url: server.url, | 50 | url: server.url, |
50 | path, | 51 | path, |
51 | token: userAccessToken, | 52 | token: userAccessToken, |
52 | statusCodeExpected: 403 | 53 | statusCodeExpected: HttpStatusCode.FORBIDDEN_403 |
53 | }) | 54 | }) |
54 | }) | 55 | }) |
55 | 56 | ||
@@ -58,7 +59,7 @@ describe('Test logs API validators', function () { | |||
58 | url: server.url, | 59 | url: server.url, |
59 | path, | 60 | path, |
60 | token: server.accessToken, | 61 | token: server.accessToken, |
61 | statusCodeExpected: 400 | 62 | statusCodeExpected: HttpStatusCode.BAD_REQUEST_400 |
62 | }) | 63 | }) |
63 | }) | 64 | }) |
64 | 65 | ||
@@ -68,7 +69,7 @@ describe('Test logs API validators', function () { | |||
68 | path, | 69 | path, |
69 | token: server.accessToken, | 70 | token: server.accessToken, |
70 | query: { startDate: 'toto' }, | 71 | query: { startDate: 'toto' }, |
71 | statusCodeExpected: 400 | 72 | statusCodeExpected: HttpStatusCode.BAD_REQUEST_400 |
72 | }) | 73 | }) |
73 | }) | 74 | }) |
74 | 75 | ||
@@ -78,7 +79,7 @@ describe('Test logs API validators', function () { | |||
78 | path, | 79 | path, |
79 | token: server.accessToken, | 80 | token: server.accessToken, |
80 | query: { startDate: new Date().toISOString(), endDate: 'toto' }, | 81 | query: { startDate: new Date().toISOString(), endDate: 'toto' }, |
81 | statusCodeExpected: 400 | 82 | statusCodeExpected: HttpStatusCode.BAD_REQUEST_400 |
82 | }) | 83 | }) |
83 | }) | 84 | }) |
84 | 85 | ||
@@ -88,7 +89,7 @@ describe('Test logs API validators', function () { | |||
88 | path, | 89 | path, |
89 | token: server.accessToken, | 90 | token: server.accessToken, |
90 | query: { startDate: new Date().toISOString(), level: 'toto' }, | 91 | query: { startDate: new Date().toISOString(), level: 'toto' }, |
91 | statusCodeExpected: 400 | 92 | statusCodeExpected: HttpStatusCode.BAD_REQUEST_400 |
92 | }) | 93 | }) |
93 | }) | 94 | }) |
94 | 95 | ||
@@ -98,7 +99,7 @@ describe('Test logs API validators', function () { | |||
98 | path, | 99 | path, |
99 | token: server.accessToken, | 100 | token: server.accessToken, |
100 | query: { startDate: new Date().toISOString() }, | 101 | query: { startDate: new Date().toISOString() }, |
101 | statusCodeExpected: 200 | 102 | statusCodeExpected: HttpStatusCode.OK_200 |
102 | }) | 103 | }) |
103 | }) | 104 | }) |
104 | }) | 105 | }) |