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