diff options
Diffstat (limited to 'server/tests/utils/users')
-rw-r--r-- | server/tests/utils/users/accounts.ts | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/server/tests/utils/users/accounts.ts b/server/tests/utils/users/accounts.ts new file mode 100644 index 000000000..71712100e --- /dev/null +++ b/server/tests/utils/users/accounts.ts | |||
@@ -0,0 +1,29 @@ | |||
1 | import { makeGetRequest } from '../requests/requests' | ||
2 | |||
3 | function getAccountsList (url: string, sort = '-createdAt', statusCodeExpected = 200) { | ||
4 | const path = '/api/v1/accounts' | ||
5 | |||
6 | return makeGetRequest({ | ||
7 | url, | ||
8 | query: { sort }, | ||
9 | path, | ||
10 | statusCodeExpected | ||
11 | }) | ||
12 | } | ||
13 | |||
14 | function getAccount (url: string, accountId: number | string, statusCodeExpected = 200) { | ||
15 | const path = '/api/v1/accounts/' + accountId | ||
16 | |||
17 | return makeGetRequest({ | ||
18 | url, | ||
19 | path, | ||
20 | statusCodeExpected | ||
21 | }) | ||
22 | } | ||
23 | |||
24 | // --------------------------------------------------------------------------- | ||
25 | |||
26 | export { | ||
27 | getAccount, | ||
28 | getAccountsList | ||
29 | } | ||