1 /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
5 checkBadCountPagination,
6 checkBadSortPagination,
7 checkBadStartPagination,
11 } from '@shared/extra-utils'
12 import { HttpStatusCode } from '@shared/models'
14 describe('Test accounts API validators', function () {
15 const path = '/api/v1/accounts/'
16 let server: PeerTubeServer
18 // ---------------------------------------------------------------
20 before(async function () {
23 server = await createSingleServer(1)
26 describe('When listing accounts', function () {
27 it('Should fail with a bad start pagination', async function () {
28 await checkBadStartPagination(server.url, path, server.accessToken)
31 it('Should fail with a bad count pagination', async function () {
32 await checkBadCountPagination(server.url, path, server.accessToken)
35 it('Should fail with an incorrect sort', async function () {
36 await checkBadSortPagination(server.url, path, server.accessToken)
40 describe('When getting an account', function () {
42 it('Should return 404 with a non existing name', async function () {
43 await server.accounts.get({ accountName: 'arfaze', expectedStatus: HttpStatusCode.NOT_FOUND_404 })
47 after(async function () {
48 await cleanupTests([ server ])