aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/check-params/accounts.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api/check-params/accounts.ts')
-rw-r--r--server/tests/api/check-params/accounts.ts19
1 files changed, 10 insertions, 9 deletions
diff --git a/server/tests/api/check-params/accounts.ts b/server/tests/api/check-params/accounts.ts
index d1712cff6..141d869b7 100644
--- a/server/tests/api/check-params/accounts.ts
+++ b/server/tests/api/check-params/accounts.ts
@@ -1,26 +1,26 @@
1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ 1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
2 2
3import 'mocha' 3import 'mocha'
4
5import { cleanupTests, flushAndRunServer, ServerInfo } from '../../../../shared/extra-utils'
6import { 4import {
7 checkBadCountPagination, 5 checkBadCountPagination,
8 checkBadSortPagination, 6 checkBadSortPagination,
9 checkBadStartPagination 7 checkBadStartPagination,
10} from '../../../../shared/extra-utils/requests/check-api-params' 8 cleanupTests,
11import { getAccount } from '../../../../shared/extra-utils/users/accounts' 9 createSingleServer,
12import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' 10 PeerTubeServer
11} from '@shared/extra-utils'
12import { HttpStatusCode } from '@shared/models'
13 13
14describe('Test accounts API validators', function () { 14describe('Test accounts API validators', function () {
15 const path = '/api/v1/accounts/' 15 const path = '/api/v1/accounts/'
16 let server: ServerInfo 16 let server: PeerTubeServer
17 17
18 // --------------------------------------------------------------- 18 // ---------------------------------------------------------------
19 19
20 before(async function () { 20 before(async function () {
21 this.timeout(30000) 21 this.timeout(30000)
22 22
23 server = await flushAndRunServer(1) 23 server = await createSingleServer(1)
24 }) 24 })
25 25
26 describe('When listing accounts', function () { 26 describe('When listing accounts', function () {
@@ -38,8 +38,9 @@ describe('Test accounts API validators', function () {
38 }) 38 })
39 39
40 describe('When getting an account', function () { 40 describe('When getting an account', function () {
41
41 it('Should return 404 with a non existing name', async function () { 42 it('Should return 404 with a non existing name', async function () {
42 await getAccount(server.url, 'arfaze', HttpStatusCode.NOT_FOUND_404) 43 await server.accounts.get({ accountName: 'arfaze', expectedStatus: HttpStatusCode.NOT_FOUND_404 })
43 }) 44 })
44 }) 45 })
45 46