Return an error on invalid count pagination

This commit is contained in:
Chocobozzz
2020-01-09 09:36:31 +01:00
parent 240458d0c9
commit e0b56b7495
5 changed files with 35 additions and 12 deletions

View File

@@ -11,14 +11,22 @@ function checkBadStartPagination (url: string, path: string, token?: string, que
})
}
function checkBadCountPagination (url: string, path: string, token?: string, query = {}) {
return makeGetRequest({
async function checkBadCountPagination (url: string, path: string, token?: string, query = {}) {
await makeGetRequest({
url,
path,
token,
query: immutableAssign(query, { count: 'hello' }),
statusCodeExpected: 400
})
await makeGetRequest({
url,
path,
token,
query: immutableAssign(query, { count: 2000 }),
statusCodeExpected: 400
})
}
function checkBadSortPagination (url: string, path: string, token?: string, query = {}) {