diff options
author | Chocobozzz <me@florianbigard.com> | 2017-12-28 14:29:57 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2017-12-28 14:29:57 +0100 |
commit | eec63bbc0f4fdb39e56f37127b35c449f90a135f (patch) | |
tree | 2403f5efea3e281698ae4a6b550fea9dfc52e390 /server/tests/utils/requests/check-api-params.ts | |
parent | c5d31dba56d669c0df0209761c43c5a6ac7cec4a (diff) | |
download | PeerTube-eec63bbc0f4fdb39e56f37127b35c449f90a135f.tar.gz PeerTube-eec63bbc0f4fdb39e56f37127b35c449f90a135f.tar.zst PeerTube-eec63bbc0f4fdb39e56f37127b35c449f90a135f.zip |
Improve check follow params tests
Diffstat (limited to 'server/tests/utils/requests/check-api-params.ts')
-rw-r--r-- | server/tests/utils/requests/check-api-params.ts | 36 |
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 @@ | |||
1 | import { makeGetRequest } from './requests' | ||
2 | |||
3 | function checkBadStartPagination (url: string, path: string) { | ||
4 | return makeGetRequest({ | ||
5 | url, | ||
6 | path, | ||
7 | query: { start: 'hello' }, | ||
8 | statusCodeExpected: 400 | ||
9 | }) | ||
10 | } | ||
11 | |||
12 | function checkBadCountPagination (url: string, path: string) { | ||
13 | return makeGetRequest({ | ||
14 | url, | ||
15 | path, | ||
16 | query: { count: 'hello' }, | ||
17 | statusCodeExpected: 400 | ||
18 | }) | ||
19 | } | ||
20 | |||
21 | function checkBadSortPagination (url: string, path: string) { | ||
22 | return makeGetRequest({ | ||
23 | url, | ||
24 | path, | ||
25 | query: { sort: 'hello' }, | ||
26 | statusCodeExpected: 400 | ||
27 | }) | ||
28 | } | ||
29 | |||
30 | // --------------------------------------------------------------------------- | ||
31 | |||
32 | export { | ||
33 | checkBadStartPagination, | ||
34 | checkBadCountPagination, | ||
35 | checkBadSortPagination | ||
36 | } | ||