aboutsummaryrefslogblamecommitdiffhomepage
path: root/server/tests/utils/requests/check-api-params.ts
blob: 7550eb3d8e10bd463f05bae0e78198dc2bdb9013 (plain) (tree)
1
2
3
4
5
6
7

                                           
                                                                              


                         
          




                              
                                                                              


                         
          




                              
                                                                             


                         
          











                                                                              
import { makeGetRequest } from './requests'

function checkBadStartPagination (url: string, path: string, token?: string) {
  return makeGetRequest({
    url,
    path,
    token,
    query: { start: 'hello' },
    statusCodeExpected: 400
  })
}

function checkBadCountPagination (url: string, path: string, token?: string) {
  return makeGetRequest({
    url,
    path,
    token,
    query: { count: 'hello' },
    statusCodeExpected: 400
  })
}

function checkBadSortPagination (url: string, path: string, token?: string) {
  return makeGetRequest({
    url,
    path,
    token,
    query: { sort: 'hello' },
    statusCodeExpected: 400
  })
}

// ---------------------------------------------------------------------------

export {
  checkBadStartPagination,
  checkBadCountPagination,
  checkBadSortPagination
}