X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Fvideos%2Fvideo-comments.ts;h=ce1b17e35f881dfb4cc569d36cea642d68ed47dc;hb=73471b1a52f242e86364ffb077ea6cadb3b07ae2;hp=18d484ccf0b811d18b25c85f5034aad938346bcd;hpb=4cb6d4578893db310297d7e118ce2fb7ecb952a3;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/videos/video-comments.ts b/server/tests/api/videos/video-comments.ts index 18d484ccf..ce1b17e35 100644 --- a/server/tests/api/videos/video-comments.ts +++ b/server/tests/api/videos/video-comments.ts @@ -3,15 +3,24 @@ import * as chai from 'chai' import 'mocha' import { VideoComment, VideoCommentThreadTree } from '../../../../shared/models/videos/video-comment.model' -import { testVideoImage } from '../../utils' +import { testImage } from '../../../../shared/utils' import { - dateIsValid, flushTests, killallServers, runServer, ServerInfo, setAccessTokensToServers, updateMyAvatar, + dateIsValid, + flushTests, + killallServers, + runServer, + ServerInfo, + setAccessTokensToServers, + updateMyAvatar, uploadVideo -} from '../../utils/index' +} from '../../../../shared/utils/index' import { - addVideoCommentReply, addVideoCommentThread, deleteVideoComment, getVideoCommentThreads, + addVideoCommentReply, + addVideoCommentThread, + deleteVideoComment, + getVideoCommentThreads, getVideoThreadComments -} from '../../utils/videos/video-comments' +} from '../../../../shared/utils/videos/video-comments' const expect = chai.expect @@ -23,7 +32,7 @@ describe('Test video comments', function () { let replyToDeleteId: number before(async function () { - this.timeout(10000) + this.timeout(30000) await flushTests() @@ -83,8 +92,7 @@ describe('Test video comments', function () { 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) + await testImage(server.url, 'avatar-resized', comment.account.avatar.path, '.png') expect(comment.totalReplies).to.equal(0) expect(dateIsValid(comment.createdAt as string)).to.be.true @@ -195,10 +203,5 @@ describe('Test video comments', function () { after(async function () { killallServers([ server ]) - - // Keep the logs if the test failed - if (this['ok']) { - await flushTests() - } }) })