aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/utils/requests/check-api-params.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/utils/requests/check-api-params.ts')
-rw-r--r--server/tests/utils/requests/check-api-params.ts36
1 files changed, 36 insertions, 0 deletions
diff --git a/server/tests/utils/requests/check-api-params.ts b/server/tests/utils/requests/check-api-params.ts
new file mode 100644
index 000000000..fbd660629
--- /dev/null
+++ b/server/tests/utils/requests/check-api-params.ts
@@ -0,0 +1,36 @@
1import { makeGetRequest } from './requests'
2
3function checkBadStartPagination (url: string, path: string) {
4 return makeGetRequest({
5 url,
6 path,
7 query: { start: 'hello' },
8 statusCodeExpected: 400
9 })
10}
11
12function checkBadCountPagination (url: string, path: string) {
13 return makeGetRequest({
14 url,
15 path,
16 query: { count: 'hello' },
17 statusCodeExpected: 400
18 })
19}
20
21function checkBadSortPagination (url: string, path: string) {
22 return makeGetRequest({
23 url,
24 path,
25 query: { sort: 'hello' },
26 statusCodeExpected: 400
27 })
28}
29
30// ---------------------------------------------------------------------------
31
32export {
33 checkBadStartPagination,
34 checkBadCountPagination,
35 checkBadSortPagination
36}