aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/utils/requests
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-07-20 14:35:18 +0200
committerChocobozzz <me@florianbigard.com>2018-07-24 14:04:05 +0200
commitd525fc399a14a8b16eaad6d4c0bc0a9c4093c3c9 (patch)
tree4305044c4a97bdf1275b241c63cb0e85151cfb6a /server/tests/utils/requests
parent57c36b277e68b764dd34cb2e449f6e2ca3d1e9b6 (diff)
downloadPeerTube-d525fc399a14a8b16eaad6d4c0bc0a9c4093c3c9.tar.gz
PeerTube-d525fc399a14a8b16eaad6d4c0bc0a9c4093c3c9.tar.zst
PeerTube-d525fc399a14a8b16eaad6d4c0bc0a9c4093c3c9.zip
Add videos list filters
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}