diff options
Diffstat (limited to 'server/tests/api/videos')
-rw-r--r-- | server/tests/api/videos/video-comments.ts | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/server/tests/api/videos/video-comments.ts b/server/tests/api/videos/video-comments.ts index 3b6578f04..604a3027d 100644 --- a/server/tests/api/videos/video-comments.ts +++ b/server/tests/api/videos/video-comments.ts | |||
@@ -3,7 +3,11 @@ | |||
3 | import * as chai from 'chai' | 3 | import * as chai from 'chai' |
4 | import 'mocha' | 4 | import 'mocha' |
5 | import { VideoComment, VideoCommentThreadTree } from '../../../../shared/models/videos/video-comment.model' | 5 | import { VideoComment, VideoCommentThreadTree } from '../../../../shared/models/videos/video-comment.model' |
6 | import { dateIsValid, flushTests, killallServers, runServer, ServerInfo, setAccessTokensToServers, uploadVideo } from '../../utils/index' | 6 | import { testVideoImage } from '../../utils' |
7 | import { | ||
8 | dateIsValid, flushTests, killallServers, runServer, ServerInfo, setAccessTokensToServers, updateMyAvatar, | ||
9 | uploadVideo | ||
10 | } from '../../utils/index' | ||
7 | import { | 11 | import { |
8 | addVideoCommentReply, addVideoCommentThread, getVideoCommentThreads, | 12 | addVideoCommentReply, addVideoCommentThread, getVideoCommentThreads, |
9 | getVideoThreadComments | 13 | getVideoThreadComments |
@@ -29,6 +33,12 @@ describe('Test video comments', function () { | |||
29 | const res = await uploadVideo(server.url, server.accessToken, {}) | 33 | const res = await uploadVideo(server.url, server.accessToken, {}) |
30 | videoUUID = res.body.video.uuid | 34 | videoUUID = res.body.video.uuid |
31 | videoId = res.body.video.id | 35 | videoId = res.body.video.id |
36 | |||
37 | await updateMyAvatar({ | ||
38 | url: server.url, | ||
39 | accessToken: server.accessToken, | ||
40 | fixture: 'avatar.png' | ||
41 | }) | ||
32 | }) | 42 | }) |
33 | 43 | ||
34 | it('Should not have threads on this video', async function () { | 44 | it('Should not have threads on this video', async function () { |
@@ -70,6 +80,10 @@ describe('Test video comments', function () { | |||
70 | expect(comment.id).to.equal(comment.threadId) | 80 | expect(comment.id).to.equal(comment.threadId) |
71 | expect(comment.account.name).to.equal('root') | 81 | expect(comment.account.name).to.equal('root') |
72 | expect(comment.account.host).to.equal('localhost:9001') | 82 | expect(comment.account.host).to.equal('localhost:9001') |
83 | |||
84 | const test = await testVideoImage(server.url, 'avatar-resized', comment.account.avatar.path, '.png') | ||
85 | expect(test).to.equal(true) | ||
86 | |||
73 | expect(comment.totalReplies).to.equal(0) | 87 | expect(comment.totalReplies).to.equal(0) |
74 | expect(dateIsValid(comment.createdAt as string)).to.be.true | 88 | expect(dateIsValid(comment.createdAt as string)).to.be.true |
75 | expect(dateIsValid(comment.updatedAt as string)).to.be.true | 89 | expect(dateIsValid(comment.updatedAt as string)).to.be.true |