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