diff options
Diffstat (limited to 'shared/extra-utils/server/follows.ts')
-rw-r--r-- | shared/extra-utils/server/follows.ts | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/shared/extra-utils/server/follows.ts b/shared/extra-utils/server/follows.ts index 1505804de..0379bb109 100644 --- a/shared/extra-utils/server/follows.ts +++ b/shared/extra-utils/server/follows.ts | |||
@@ -1,17 +1,21 @@ | |||
1 | import * as request from 'supertest' | 1 | import * as request from 'supertest' |
2 | import { ServerInfo } from './servers' | 2 | import { ServerInfo } from './servers' |
3 | import { waitJobs } from './jobs' | 3 | import { waitJobs } from './jobs' |
4 | import { makeGetRequest, makePostBodyRequest } from '..' | 4 | import { makePostBodyRequest } from '../requests/requests' |
5 | 5 | ||
6 | function getFollowersListPaginationAndSort (url: string, start: number, count: number, sort: string, search?: string) { | 6 | function getFollowersListPaginationAndSort (url: string, start: number, count: number, sort: string, search?: string) { |
7 | const path = '/api/v1/server/followers' | 7 | const path = '/api/v1/server/followers' |
8 | 8 | ||
9 | const query = { | ||
10 | start, | ||
11 | count, | ||
12 | sort, | ||
13 | search | ||
14 | } | ||
15 | |||
9 | return request(url) | 16 | return request(url) |
10 | .get(path) | 17 | .get(path) |
11 | .query({ start }) | 18 | .query(query) |
12 | .query({ count }) | ||
13 | .query({ sort }) | ||
14 | .query({ search }) | ||
15 | .set('Accept', 'application/json') | 19 | .set('Accept', 'application/json') |
16 | .expect(200) | 20 | .expect(200) |
17 | .expect('Content-Type', /json/) | 21 | .expect('Content-Type', /json/) |
@@ -42,12 +46,16 @@ function rejectFollower (url: string, token: string, follower: string, statusCod | |||
42 | function getFollowingListPaginationAndSort (url: string, start: number, count: number, sort: string, search?: string) { | 46 | function getFollowingListPaginationAndSort (url: string, start: number, count: number, sort: string, search?: string) { |
43 | const path = '/api/v1/server/following' | 47 | const path = '/api/v1/server/following' |
44 | 48 | ||
49 | const query = { | ||
50 | start, | ||
51 | count, | ||
52 | sort, | ||
53 | search | ||
54 | } | ||
55 | |||
45 | return request(url) | 56 | return request(url) |
46 | .get(path) | 57 | .get(path) |
47 | .query({ start }) | 58 | .query(query) |
48 | .query({ count }) | ||
49 | .query({ sort }) | ||
50 | .query({ search }) | ||
51 | .set('Accept', 'application/json') | 59 | .set('Accept', 'application/json') |
52 | .expect(200) | 60 | .expect(200) |
53 | .expect('Content-Type', /json/) | 61 | .expect('Content-Type', /json/) |