From d50acfab69ce9e05b272dea6c4d34d52960ba14c Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 27 Dec 2017 20:03:37 +0100 Subject: Add comments federation tests --- server/tests/api/check-params/video-channels.ts | 10 +++++----- server/tests/api/check-params/video-comments.ts | 16 +--------------- 2 files changed, 6 insertions(+), 20 deletions(-) (limited to 'server/tests/api/check-params') diff --git a/server/tests/api/check-params/video-channels.ts b/server/tests/api/check-params/video-channels.ts index e72b2cb6c..7103aec25 100644 --- a/server/tests/api/check-params/video-channels.ts +++ b/server/tests/api/check-params/video-channels.ts @@ -69,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) @@ -79,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) diff --git a/server/tests/api/check-params/video-comments.ts b/server/tests/api/check-params/video-comments.ts index 5112274f0..e8d7ddf38 100644 --- a/server/tests/api/check-params/video-comments.ts +++ b/server/tests/api/check-params/video-comments.ts @@ -2,17 +2,13 @@ import 'mocha' import * as request from 'supertest' -import { - createUser, flushTests, getUserAccessToken, killallServers, makePostBodyRequest, runServer, ServerInfo, setAccessTokensToServers, - uploadVideo -} from '../../utils' +import { flushTests, killallServers, makePostBodyRequest, runServer, ServerInfo, setAccessTokensToServers, uploadVideo } from '../../utils' import { addVideoCommentThread } from '../../utils/video-comments' describe('Test video comments API validator', function () { let pathThread: string let pathComment: string let server: ServerInfo - let accessTokenUser: string let videoUUID: string let commentId: number @@ -27,16 +23,6 @@ describe('Test video comments API validator', function () { await setAccessTokensToServers([ server ]) - { - const user = { - username: 'fake', - password: 'fake_password' - } - await createUser(server.url, server.accessToken, user.username, user.password) - - accessTokenUser = await getUserAccessToken(server, user) - } - { const res = await uploadVideo(server.url, server.accessToken, {}) videoUUID = res.body.video.uuid -- cgit v1.2.3