X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Fcheck-params%2Fvideo-channels.ts;h=bf464152b2c424a962d63ff1fe30082b39caf7d4;hb=93e4a311f37d7fc82ec81190553f8beae28fdef5;hp=b99b5eda8b7933426c2f9cf6c132bda86bfcd1ec;hpb=5f04dd2f743961e0a06c29531cc3ccc9e4928d56;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/check-params/video-channels.ts b/server/tests/api/check-params/video-channels.ts index b99b5eda8..bf464152b 100644 --- a/server/tests/api/check-params/video-channels.ts +++ b/server/tests/api/check-params/video-channels.ts @@ -1,7 +1,6 @@ /* tslint:disable:no-unused-expression */ import * as request from 'supertest' -import { join } from 'path' import 'mocha' import * as chai from 'chai' const expect = chai.expect @@ -13,17 +12,15 @@ import { makePutBodyRequest, setAccessTokensToServers, killallServers, - getMyUserInformation, makePostBodyRequest, getVideoChannelsList, createUser, - getUserAccessToken + userLogin } from '../../utils' describe('Test videos API validator', function () { const path = '/api/v1/videos/channels' let server: ServerInfo - let channelId: number let accessTokenUser: string // --------------------------------------------------------------- @@ -37,16 +34,13 @@ describe('Test videos API validator', function () { await setAccessTokensToServers([ server ]) - const res = await getMyUserInformation(server.url, server.accessToken) - channelId = res.body.videoChannels[0].id - const user = { username: 'fake', password: 'fake_password' } await createUser(server.url, server.accessToken, user.username, user.password) - accessTokenUser = await getUserAccessToken(server, user) + accessTokenUser = await userLogin(server, user) }) describe('When listing a video channels', function () { @@ -75,9 +69,9 @@ describe('Test videos API validator', function () { }) }) - describe('When listing author video channels', function () { - it('Should fail with bad author', async function () { - const path = '/api/v1/videos/authors/hello/channels' + describe('When listing account video channels', function () { + it('Should fail with bad account', async function () { + const path = '/api/v1/videos/accounts/hello/channels' await request(server.url) .get(path) @@ -85,8 +79,8 @@ describe('Test videos API validator', function () { .expect(400) }) - it('Should fail with a unknown author', async function () { - const path = '/api/v1/videos/authors/156/channels' + it('Should fail with a unknown account', async function () { + const path = '/api/v1/videos/accounts/156/channels' await request(server.url) .get(path) @@ -120,6 +114,9 @@ describe('Test videos API validator', function () { it('Should fail with a long name', async function () { const fields = { name: 'hello tooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo' + + 'oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo' + + 'oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo' + + 'oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo' + 'oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo long', description: 'super description' } @@ -179,6 +176,9 @@ describe('Test videos API validator', function () { it('Should fail with a long name', async function () { const fields = { name: 'hello tooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo' + + 'oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo' + + 'oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo' + + 'oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo' + 'oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo long', description: 'super description' }