1 import { makeGetRequest } from './requests'
2 import { immutableAssign } from '../miscs/miscs'
3 import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'
5 function checkBadStartPagination (url: string, path: string, token?: string, query = {}) {
6 return makeGetRequest({
10 query: immutableAssign(query, { start: 'hello' }),
11 statusCodeExpected: HttpStatusCode.BAD_REQUEST_400
15 async function checkBadCountPagination (url: string, path: string, token?: string, query = {}) {
16 await makeGetRequest({
20 query: immutableAssign(query, { count: 'hello' }),
21 statusCodeExpected: HttpStatusCode.BAD_REQUEST_400
24 await makeGetRequest({
28 query: immutableAssign(query, { count: 2000 }),
29 statusCodeExpected: HttpStatusCode.BAD_REQUEST_400
33 function checkBadSortPagination (url: string, path: string, token?: string, query = {}) {
34 return makeGetRequest({
38 query: immutableAssign(query, { sort: 'hello' }),
39 statusCodeExpected: HttpStatusCode.BAD_REQUEST_400
43 // ---------------------------------------------------------------------------
46 checkBadStartPagination,
47 checkBadCountPagination,
48 checkBadSortPagination