]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - server/tests/utils/requests/check-api-params.ts
Improve check follow params tests
[github/Chocobozzz/PeerTube.git] / server / tests / utils / requests / check-api-params.ts
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 }