]>
Commit | Line | Data |
---|---|---|
265ba139 C |
1 | /* tslint:disable:no-unused-expression */ |
2 | ||
3 | import 'mocha' | |
4 | ||
86ebdf8c | 5 | import { cleanupTests, flushAndRunServer, ServerInfo } from '../../../../shared/extra-utils' |
9639bd17 | 6 | import { |
7 | checkBadCountPagination, | |
8 | checkBadSortPagination, | |
9 | checkBadStartPagination | |
94565d52 C |
10 | } from '../../../../shared/extra-utils/requests/check-api-params' |
11 | import { getAccount } from '../../../../shared/extra-utils/users/accounts' | |
265ba139 | 12 | |
926cd3df | 13 | describe('Test accounts API validators', function () { |
265ba139 C |
14 | const path = '/api/v1/accounts/' |
15 | let server: ServerInfo | |
16 | ||
17 | // --------------------------------------------------------------- | |
18 | ||
19 | before(async function () { | |
e212f887 | 20 | this.timeout(30000) |
265ba139 | 21 | |
210feb6c | 22 | server = await flushAndRunServer(1) |
265ba139 C |
23 | }) |
24 | ||
25 | describe('When listing accounts', function () { | |
26 | it('Should fail with a bad start pagination', async function () { | |
27 | await checkBadStartPagination(server.url, path, server.accessToken) | |
28 | }) | |
29 | ||
30 | it('Should fail with a bad count pagination', async function () { | |
31 | await checkBadCountPagination(server.url, path, server.accessToken) | |
32 | }) | |
33 | ||
34 | it('Should fail with an incorrect sort', async function () { | |
35 | await checkBadSortPagination(server.url, path, server.accessToken) | |
36 | }) | |
37 | }) | |
38 | ||
39 | describe('When getting an account', function () { | |
ad9e39fb C |
40 | it('Should return 404 with a non existing name', async function () { |
41 | await getAccount(server.url, 'arfaze', 404) | |
265ba139 C |
42 | }) |
43 | }) | |
44 | ||
86ebdf8c C |
45 | after(async function () { |
46 | await cleanupTests([ server ]) | |
265ba139 C |
47 | }) |
48 | }) |