aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-01-03 17:25:47 +0100
committerChocobozzz <me@florianbigard.com>2018-01-03 17:35:00 +0100
commitcf117aaafc1e9ae1ab4c388fc5d2e5ba9349efee (patch)
treeab51ac2f2c7ec8dfc7fcde99565a4430874da599 /server/tests/api
parent265ba139ebf56bbdc1c65f6ea4f367774c691fc0 (diff)
downloadPeerTube-cf117aaafc1e9ae1ab4c388fc5d2e5ba9349efee.tar.gz
PeerTube-cf117aaafc1e9ae1ab4c388fc5d2e5ba9349efee.tar.zst
PeerTube-cf117aaafc1e9ae1ab4c388fc5d2e5ba9349efee.zip
Add avatar in comments
Diffstat (limited to 'server/tests/api')
-rw-r--r--server/tests/api/videos/video-comments.ts16
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 @@
3import * as chai from 'chai' 3import * as chai from 'chai'
4import 'mocha' 4import 'mocha'
5import { VideoComment, VideoCommentThreadTree } from '../../../../shared/models/videos/video-comment.model' 5import { VideoComment, VideoCommentThreadTree } from '../../../../shared/models/videos/video-comment.model'
6import { dateIsValid, flushTests, killallServers, runServer, ServerInfo, setAccessTokensToServers, uploadVideo } from '../../utils/index' 6import { testVideoImage } from '../../utils'
7import {
8 dateIsValid, flushTests, killallServers, runServer, ServerInfo, setAccessTokensToServers, updateMyAvatar,
9 uploadVideo
10} from '../../utils/index'
7import { 11import {
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