X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Fserver%2Ffollows.ts;h=9e5aa00c75f1323129991f28c65efb13ce0f6225;hb=9de33c6bd9580ab43cc7bc089c54b2fe2bdfd72d;hp=b686af4e4eb4f79310edfc591f33c23af7a0d0b4;hpb=610d0be13b3d01f653ef269271dd667a57c85ef2;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/server/follows.ts b/server/tests/api/server/follows.ts index b686af4e4..9e5aa00c7 100644 --- a/server/tests/api/server/follows.ts +++ b/server/tests/api/server/follows.ts @@ -1,37 +1,35 @@ /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ -import * as chai from 'chai' import 'mocha' -import { Video, VideoPrivacy } from '../../../../shared/models/videos' -import { VideoComment, VideoCommentThreadTree } from '../../../../shared/models/videos/video-comment.model' -import { cleanupTests, completeVideoCheck, deleteVideoComment } from '../../../../shared/extra-utils' +import * as chai from 'chai' import { + addVideoCommentReply, + addVideoCommentThread, + cleanupTests, + completeVideoCheck, + createUser, + createVideoCaption, + dateIsValid, + deleteVideoComment, + expectAccountFollows, flushAndRunMultipleServers, - getVideosList, - ServerInfo, - setAccessTokensToServers, - uploadVideo -} from '../../../../shared/extra-utils/index' -import { dateIsValid } from '../../../../shared/extra-utils/miscs/miscs' -import { follow, getFollowersListPaginationAndSort, getFollowingListPaginationAndSort, - unfollow -} from '../../../../shared/extra-utils/server/follows' -import { expectAccountFollows } from '../../../../shared/extra-utils/users/accounts' -import { userLogin } from '../../../../shared/extra-utils/users/login' -import { createUser } from '../../../../shared/extra-utils/users/users' -import { - addVideoCommentReply, - addVideoCommentThread, getVideoCommentThreads, - getVideoThreadComments -} from '../../../../shared/extra-utils/videos/video-comments' -import { rateVideo } from '../../../../shared/extra-utils/videos/videos' -import { waitJobs } from '../../../../shared/extra-utils/server/jobs' -import { createVideoCaption, listVideoCaptions, testCaptionFile } from '../../../../shared/extra-utils/videos/video-captions' -import { VideoCaption } from '../../../../shared/models/videos/caption/video-caption.model' + getVideosList, + getVideoThreadComments, + listVideoCaptions, + rateVideo, + ServerInfo, + setAccessTokensToServers, + testCaptionFile, + unfollow, + uploadVideo, + userLogin, + waitJobs +} from '@shared/extra-utils' +import { Video, VideoCaption, VideoComment, VideoCommentThreadTree, VideoPrivacy } from '@shared/models' const expect = chai.expect @@ -302,7 +300,7 @@ describe('Test follows', function () { }) it('Should upload a video on server 2 and 3 and propagate only the video of server 2', async function () { - this.timeout(35000) + this.timeout(60000) await uploadVideo(servers[1].url, servers[1].accessToken, { name: 'server2' }) await uploadVideo(servers[2].url, servers[2].accessToken, { name: 'server3' }) @@ -326,7 +324,7 @@ describe('Test follows', function () { let video4: Video before(async function () { - this.timeout(20000) + this.timeout(50000) const video4Attributes = { name: 'server3-4', @@ -521,7 +519,7 @@ describe('Test follows', function () { expect(deletedComment.text).to.equal('') expect(deletedComment.inReplyToCommentId).to.be.null expect(deletedComment.account).to.be.null - expect(deletedComment.totalReplies).to.equal(3) + expect(deletedComment.totalReplies).to.equal(2) expect(dateIsValid(deletedComment.deletedAt as string)).to.be.true const res2 = await getVideoThreadComments(servers[0].url, video4.id, deletedComment.threadId) @@ -558,7 +556,7 @@ describe('Test follows', function () { const caption1: VideoCaption = res.body.data[0] expect(caption1.language.id).to.equal('ar') expect(caption1.language.label).to.equal('Arabic') - expect(caption1.captionPath).to.equal('/static/video-captions/' + video4.uuid + '-ar.vtt') + expect(caption1.captionPath).to.match(new RegExp('^/lazy-static/video-captions/.+-ar.vtt$')) await testCaptionFile(servers[0].url, caption1.captionPath, 'Subtitle good 2.') })