1
0
Fork 0
peertube/server/tests/utils/requests/check-api-params.ts

40 lines
819 B
TypeScript
Raw Normal View History

2017-12-28 08:29:57 -05:00
import { makeGetRequest } from './requests'
2017-12-28 08:40:11 -05:00
function checkBadStartPagination (url: string, path: string, token?: string) {
2017-12-28 08:29:57 -05:00
return makeGetRequest({
url,
path,
2017-12-28 08:40:11 -05:00
token,
2017-12-28 08:29:57 -05:00
query: { start: 'hello' },
statusCodeExpected: 400
})
}
2017-12-28 08:40:11 -05:00
function checkBadCountPagination (url: string, path: string, token?: string) {
2017-12-28 08:29:57 -05:00
return makeGetRequest({
url,
path,
2017-12-28 08:40:11 -05:00
token,
2017-12-28 08:29:57 -05:00
query: { count: 'hello' },
statusCodeExpected: 400
})
}
2017-12-28 08:40:11 -05:00
function checkBadSortPagination (url: string, path: string, token?: string) {
2017-12-28 08:29:57 -05:00
return makeGetRequest({
url,
path,
2017-12-28 08:40:11 -05:00
token,
2017-12-28 08:29:57 -05:00
query: { sort: 'hello' },
statusCodeExpected: 400
})
}
// ---------------------------------------------------------------------------
export {
checkBadStartPagination,
checkBadCountPagination,
checkBadSortPagination
}