mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 19:42:24 +02:00
Improve check follow params tests
This commit is contained in:
parent
c5d31dba56
commit
eec63bbc0f
21 changed files with 232 additions and 150 deletions
36
server/tests/utils/requests/check-api-params.ts
Normal file
36
server/tests/utils/requests/check-api-params.ts
Normal file
|
@ -0,0 +1,36 @@
|
|||
import { makeGetRequest } from './requests'
|
||||
|
||||
function checkBadStartPagination (url: string, path: string) {
|
||||
return makeGetRequest({
|
||||
url,
|
||||
path,
|
||||
query: { start: 'hello' },
|
||||
statusCodeExpected: 400
|
||||
})
|
||||
}
|
||||
|
||||
function checkBadCountPagination (url: string, path: string) {
|
||||
return makeGetRequest({
|
||||
url,
|
||||
path,
|
||||
query: { count: 'hello' },
|
||||
statusCodeExpected: 400
|
||||
})
|
||||
}
|
||||
|
||||
function checkBadSortPagination (url: string, path: string) {
|
||||
return makeGetRequest({
|
||||
url,
|
||||
path,
|
||||
query: { sort: 'hello' },
|
||||
statusCodeExpected: 400
|
||||
})
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
export {
|
||||
checkBadStartPagination,
|
||||
checkBadCountPagination,
|
||||
checkBadSortPagination
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue