]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame_incremental - server/tests/utils/requests/check-api-params.ts
Improve check jobs parameters tests
[github/Chocobozzz/PeerTube.git] / server / tests / utils / requests / check-api-params.ts
... / ...
CommitLineData
1import { makeGetRequest } from './requests'
2
3function checkBadStartPagination (url: string, path: string, token?: string) {
4 return makeGetRequest({
5 url,
6 path,
7 token,
8 query: { start: 'hello' },
9 statusCodeExpected: 400
10 })
11}
12
13function checkBadCountPagination (url: string, path: string, token?: string) {
14 return makeGetRequest({
15 url,
16 path,
17 token,
18 query: { count: 'hello' },
19 statusCodeExpected: 400
20 })
21}
22
23function checkBadSortPagination (url: string, path: string, token?: string) {
24 return makeGetRequest({
25 url,
26 path,
27 token,
28 query: { sort: 'hello' },
29 statusCodeExpected: 400
30 })
31}
32
33// ---------------------------------------------------------------------------
34
35export {
36 checkBadStartPagination,
37 checkBadCountPagination,
38 checkBadSortPagination
39}