aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/utils/requests/check-api-params.ts
blob: 7550eb3d8e10bd463f05bae0e78198dc2bdb9013 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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
}