diff options
author | Chocobozzz <me@florianbigard.com> | 2021-12-17 11:58:15 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-12-17 12:24:03 +0100 |
commit | c55e3d7227fe1453869e309025996b9d75256d5d (patch) | |
tree | 08e9b0ca210d75c82c8606fef0852eca020e8e0e /shared/server-commands/requests/check-api-params.ts | |
parent | bf54587a3e2ad9c2c186828f2a5682b91ee2cc00 (diff) | |
download | PeerTube-c55e3d7227fe1453869e309025996b9d75256d5d.tar.gz PeerTube-c55e3d7227fe1453869e309025996b9d75256d5d.tar.zst PeerTube-c55e3d7227fe1453869e309025996b9d75256d5d.zip |
Move test functions outside extra-utils
Diffstat (limited to 'shared/server-commands/requests/check-api-params.ts')
-rw-r--r-- | shared/server-commands/requests/check-api-params.ts | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/shared/server-commands/requests/check-api-params.ts b/shared/server-commands/requests/check-api-params.ts deleted file mode 100644 index 26ba1e913..000000000 --- a/shared/server-commands/requests/check-api-params.ts +++ /dev/null | |||
@@ -1,48 +0,0 @@ | |||
1 | import { HttpStatusCode } from '@shared/models' | ||
2 | import { makeGetRequest } from './requests' | ||
3 | |||
4 | function checkBadStartPagination (url: string, path: string, token?: string, query = {}) { | ||
5 | return makeGetRequest({ | ||
6 | url, | ||
7 | path, | ||
8 | token, | ||
9 | query: { ...query, start: 'hello' }, | ||
10 | expectedStatus: HttpStatusCode.BAD_REQUEST_400 | ||
11 | }) | ||
12 | } | ||
13 | |||
14 | async function checkBadCountPagination (url: string, path: string, token?: string, query = {}) { | ||
15 | await makeGetRequest({ | ||
16 | url, | ||
17 | path, | ||
18 | token, | ||
19 | query: { ...query, count: 'hello' }, | ||
20 | expectedStatus: HttpStatusCode.BAD_REQUEST_400 | ||
21 | }) | ||
22 | |||
23 | await makeGetRequest({ | ||
24 | url, | ||
25 | path, | ||
26 | token, | ||
27 | query: { ...query, count: 2000 }, | ||
28 | expectedStatus: HttpStatusCode.BAD_REQUEST_400 | ||
29 | }) | ||
30 | } | ||
31 | |||
32 | function checkBadSortPagination (url: string, path: string, token?: string, query = {}) { | ||
33 | return makeGetRequest({ | ||
34 | url, | ||
35 | path, | ||
36 | token, | ||
37 | query: { ...query, sort: 'hello' }, | ||
38 | expectedStatus: HttpStatusCode.BAD_REQUEST_400 | ||
39 | }) | ||
40 | } | ||
41 | |||
42 | // --------------------------------------------------------------------------- | ||
43 | |||
44 | export { | ||
45 | checkBadStartPagination, | ||
46 | checkBadCountPagination, | ||
47 | checkBadSortPagination | ||
48 | } | ||