1 import { makeGetRequest } from './requests'
2 import { immutableAssign } from '../miscs/miscs'
4 function checkBadStartPagination (url: string, path: string, token?: string, query = {}) {
5 return makeGetRequest({
9 query: immutableAssign(query, { start: 'hello' }),
10 statusCodeExpected: 400
14 async function checkBadCountPagination (url: string, path: string, token?: string, query = {}) {
15 await makeGetRequest({
19 query: immutableAssign(query, { count: 'hello' }),
20 statusCodeExpected: 400
23 await makeGetRequest({
27 query: immutableAssign(query, { count: 2000 }),
28 statusCodeExpected: 400
32 function checkBadSortPagination (url: string, path: string, token?: string, query = {}) {
33 return makeGetRequest({
37 query: immutableAssign(query, { sort: 'hello' }),
38 statusCodeExpected: 400
42 // ---------------------------------------------------------------------------
45 checkBadStartPagination,
46 checkBadCountPagination,
47 checkBadSortPagination