diff options
author | Chocobozzz <me@florianbigard.com> | 2017-12-27 20:03:37 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2017-12-27 20:03:37 +0100 |
commit | d50acfab69ce9e05b272dea6c4d34d52960ba14c (patch) | |
tree | 55ce8b70777603b772d2cecb96cd71aac9ccfb9c /server/tests/api/check-params | |
parent | ae45f988bb5ea32152cca02a282d02599dbb633b (diff) | |
download | PeerTube-d50acfab69ce9e05b272dea6c4d34d52960ba14c.tar.gz PeerTube-d50acfab69ce9e05b272dea6c4d34d52960ba14c.tar.zst PeerTube-d50acfab69ce9e05b272dea6c4d34d52960ba14c.zip |
Add comments federation tests
Diffstat (limited to 'server/tests/api/check-params')
-rw-r--r-- | server/tests/api/check-params/video-channels.ts | 10 | ||||
-rw-r--r-- | server/tests/api/check-params/video-comments.ts | 16 |
2 files changed, 6 insertions, 20 deletions
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 () { | |||
69 | }) | 69 | }) |
70 | }) | 70 | }) |
71 | 71 | ||
72 | describe('When listing author video channels', function () { | 72 | describe('When listing account video channels', function () { |
73 | it('Should fail with bad author', async function () { | 73 | it('Should fail with bad account', async function () { |
74 | const path = '/api/v1/videos/authors/hello/channels' | 74 | const path = '/api/v1/videos/accounts/hello/channels' |
75 | 75 | ||
76 | await request(server.url) | 76 | await request(server.url) |
77 | .get(path) | 77 | .get(path) |
@@ -79,8 +79,8 @@ describe('Test videos API validator', function () { | |||
79 | .expect(400) | 79 | .expect(400) |
80 | }) | 80 | }) |
81 | 81 | ||
82 | it('Should fail with a unknown author', async function () { | 82 | it('Should fail with a unknown account', async function () { |
83 | const path = '/api/v1/videos/authors/156/channels' | 83 | const path = '/api/v1/videos/accounts/156/channels' |
84 | 84 | ||
85 | await request(server.url) | 85 | await request(server.url) |
86 | .get(path) | 86 | .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 @@ | |||
2 | 2 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import * as request from 'supertest' | 4 | import * as request from 'supertest' |
5 | import { | 5 | import { flushTests, killallServers, makePostBodyRequest, runServer, ServerInfo, setAccessTokensToServers, uploadVideo } from '../../utils' |
6 | createUser, flushTests, getUserAccessToken, killallServers, makePostBodyRequest, runServer, ServerInfo, setAccessTokensToServers, | ||
7 | uploadVideo | ||
8 | } from '../../utils' | ||
9 | import { addVideoCommentThread } from '../../utils/video-comments' | 6 | import { addVideoCommentThread } from '../../utils/video-comments' |
10 | 7 | ||
11 | describe('Test video comments API validator', function () { | 8 | describe('Test video comments API validator', function () { |
12 | let pathThread: string | 9 | let pathThread: string |
13 | let pathComment: string | 10 | let pathComment: string |
14 | let server: ServerInfo | 11 | let server: ServerInfo |
15 | let accessTokenUser: string | ||
16 | let videoUUID: string | 12 | let videoUUID: string |
17 | let commentId: number | 13 | let commentId: number |
18 | 14 | ||
@@ -28,16 +24,6 @@ describe('Test video comments API validator', function () { | |||
28 | await setAccessTokensToServers([ server ]) | 24 | await setAccessTokensToServers([ server ]) |
29 | 25 | ||
30 | { | 26 | { |
31 | const user = { | ||
32 | username: 'fake', | ||
33 | password: 'fake_password' | ||
34 | } | ||
35 | await createUser(server.url, server.accessToken, user.username, user.password) | ||
36 | |||
37 | accessTokenUser = await getUserAccessToken(server, user) | ||
38 | } | ||
39 | |||
40 | { | ||
41 | const res = await uploadVideo(server.url, server.accessToken, {}) | 27 | const res = await uploadVideo(server.url, server.accessToken, {}) |
42 | videoUUID = res.body.video.uuid | 28 | videoUUID = res.body.video.uuid |
43 | pathThread = '/api/v1/videos/' + videoUUID + '/comment-threads' | 29 | pathThread = '/api/v1/videos/' + videoUUID + '/comment-threads' |