]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - server/tests/api/check-params/accounts.ts
Bumped to version v5.2.1
[github/Chocobozzz/PeerTube.git] / server / tests / api / check-params / accounts.ts
CommitLineData
a1587156 1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
265ba139 2
c55e3d72 3import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '@server/tests/shared'
4c7e60bc 4import { HttpStatusCode } from '@shared/models'
c55e3d72 5import { cleanupTests, createSingleServer, PeerTubeServer } from '@shared/server-commands'
265ba139 6
926cd3df 7describe('Test accounts API validators', function () {
265ba139 8 const path = '/api/v1/accounts/'
254d3579 9 let server: PeerTubeServer
265ba139
C
10
11 // ---------------------------------------------------------------
12
13 before(async function () {
e212f887 14 this.timeout(30000)
265ba139 15
254d3579 16 server = await createSingleServer(1)
265ba139
C
17 })
18
19 describe('When listing accounts', function () {
20 it('Should fail with a bad start pagination', async function () {
21 await checkBadStartPagination(server.url, path, server.accessToken)
22 })
23
24 it('Should fail with a bad count pagination', async function () {
25 await checkBadCountPagination(server.url, path, server.accessToken)
26 })
27
28 it('Should fail with an incorrect sort', async function () {
29 await checkBadSortPagination(server.url, path, server.accessToken)
30 })
31 })
32
33 describe('When getting an account', function () {
9fff08cf 34
ad9e39fb 35 it('Should return 404 with a non existing name', async function () {
89d241a7 36 await server.accounts.get({ accountName: 'arfaze', expectedStatus: HttpStatusCode.NOT_FOUND_404 })
265ba139
C
37 })
38 })
39
86ebdf8c
C
40 after(async function () {
41 await cleanupTests([ server ])
265ba139
C
42 })
43})