From cf117aaafc1e9ae1ab4c388fc5d2e5ba9349efee Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 3 Jan 2018 17:25:47 +0100 Subject: Add avatar in comments --- server/tests/api/videos/video-comments.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'server/tests') 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 @@ import * as chai from 'chai' import 'mocha' import { VideoComment, VideoCommentThreadTree } from '../../../../shared/models/videos/video-comment.model' -import { dateIsValid, flushTests, killallServers, runServer, ServerInfo, setAccessTokensToServers, uploadVideo } from '../../utils/index' +import { testVideoImage } from '../../utils' +import { + dateIsValid, flushTests, killallServers, runServer, ServerInfo, setAccessTokensToServers, updateMyAvatar, + uploadVideo +} from '../../utils/index' import { addVideoCommentReply, addVideoCommentThread, getVideoCommentThreads, getVideoThreadComments @@ -29,6 +33,12 @@ describe('Test video comments', function () { const res = await uploadVideo(server.url, server.accessToken, {}) videoUUID = res.body.video.uuid videoId = res.body.video.id + + await updateMyAvatar({ + url: server.url, + accessToken: server.accessToken, + fixture: 'avatar.png' + }) }) it('Should not have threads on this video', async function () { @@ -70,6 +80,10 @@ describe('Test video comments', function () { expect(comment.id).to.equal(comment.threadId) expect(comment.account.name).to.equal('root') expect(comment.account.host).to.equal('localhost:9001') + + const test = await testVideoImage(server.url, 'avatar-resized', comment.account.avatar.path, '.png') + expect(test).to.equal(true) + expect(comment.totalReplies).to.equal(0) expect(dateIsValid(comment.createdAt as string)).to.be.true expect(dateIsValid(comment.updatedAt as string)).to.be.true -- cgit v1.2.3