diff options
Diffstat (limited to 'shared/extra-utils/requests/check-api-params.ts')
-rw-r--r-- | shared/extra-utils/requests/check-api-params.ts | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/shared/extra-utils/requests/check-api-params.ts b/shared/extra-utils/requests/check-api-params.ts index c34c7c216..7f5ff775c 100644 --- a/shared/extra-utils/requests/check-api-params.ts +++ b/shared/extra-utils/requests/check-api-params.ts | |||
@@ -1,5 +1,6 @@ | |||
1 | import { makeGetRequest } from './requests' | 1 | import { makeGetRequest } from './requests' |
2 | import { immutableAssign } from '../miscs/miscs' | 2 | import { immutableAssign } from '../miscs/miscs' |
3 | import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes' | ||
3 | 4 | ||
4 | function checkBadStartPagination (url: string, path: string, token?: string, query = {}) { | 5 | function checkBadStartPagination (url: string, path: string, token?: string, query = {}) { |
5 | return makeGetRequest({ | 6 | return makeGetRequest({ |
@@ -7,7 +8,7 @@ function checkBadStartPagination (url: string, path: string, token?: string, que | |||
7 | path, | 8 | path, |
8 | token, | 9 | token, |
9 | query: immutableAssign(query, { start: 'hello' }), | 10 | query: immutableAssign(query, { start: 'hello' }), |
10 | statusCodeExpected: 400 | 11 | statusCodeExpected: HttpStatusCode.BAD_REQUEST_400 |
11 | }) | 12 | }) |
12 | } | 13 | } |
13 | 14 | ||
@@ -17,7 +18,7 @@ async function checkBadCountPagination (url: string, path: string, token?: strin | |||
17 | path, | 18 | path, |
18 | token, | 19 | token, |
19 | query: immutableAssign(query, { count: 'hello' }), | 20 | query: immutableAssign(query, { count: 'hello' }), |
20 | statusCodeExpected: 400 | 21 | statusCodeExpected: HttpStatusCode.BAD_REQUEST_400 |
21 | }) | 22 | }) |
22 | 23 | ||
23 | await makeGetRequest({ | 24 | await makeGetRequest({ |
@@ -25,7 +26,7 @@ async function checkBadCountPagination (url: string, path: string, token?: strin | |||
25 | path, | 26 | path, |
26 | token, | 27 | token, |
27 | query: immutableAssign(query, { count: 2000 }), | 28 | query: immutableAssign(query, { count: 2000 }), |
28 | statusCodeExpected: 400 | 29 | statusCodeExpected: HttpStatusCode.BAD_REQUEST_400 |
29 | }) | 30 | }) |
30 | } | 31 | } |
31 | 32 | ||
@@ -35,7 +36,7 @@ function checkBadSortPagination (url: string, path: string, token?: string, quer | |||
35 | path, | 36 | path, |
36 | token, | 37 | token, |
37 | query: immutableAssign(query, { sort: 'hello' }), | 38 | query: immutableAssign(query, { sort: 'hello' }), |
38 | statusCodeExpected: 400 | 39 | statusCodeExpected: HttpStatusCode.BAD_REQUEST_400 |
39 | }) | 40 | }) |
40 | } | 41 | } |
41 | 42 | ||