X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Fcheck-params%2Faccounts.ts;h=afc0049ff9fdd733fcc7b3d5209ebf4b397cb46d;hb=HEAD;hp=d1712cff61999ab6f19ee785bede7942b204d4de;hpb=f2eb23cd87cf32b8fe545178143b5f49e06a58da;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/check-params/accounts.ts b/server/tests/api/check-params/accounts.ts index d1712cff6..afc0049ff 100644 --- a/server/tests/api/check-params/accounts.ts +++ b/server/tests/api/check-params/accounts.ts @@ -1,26 +1,19 @@ /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ -import 'mocha' - -import { cleanupTests, flushAndRunServer, ServerInfo } from '../../../../shared/extra-utils' -import { - checkBadCountPagination, - checkBadSortPagination, - checkBadStartPagination -} from '../../../../shared/extra-utils/requests/check-api-params' -import { getAccount } from '../../../../shared/extra-utils/users/accounts' -import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' +import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '@server/tests/shared' +import { HttpStatusCode } from '@shared/models' +import { cleanupTests, createSingleServer, PeerTubeServer } from '@shared/server-commands' describe('Test accounts API validators', function () { const path = '/api/v1/accounts/' - let server: ServerInfo + let server: PeerTubeServer // --------------------------------------------------------------- before(async function () { this.timeout(30000) - server = await flushAndRunServer(1) + server = await createSingleServer(1) }) describe('When listing accounts', function () { @@ -38,8 +31,9 @@ describe('Test accounts API validators', function () { }) describe('When getting an account', function () { + it('Should return 404 with a non existing name', async function () { - await getAccount(server.url, 'arfaze', HttpStatusCode.NOT_FOUND_404) + await server.accounts.get({ accountName: 'arfaze', expectedStatus: HttpStatusCode.NOT_FOUND_404 }) }) })