diff options
Diffstat (limited to 'server/tests/api/server/follows.ts')
-rw-r--r-- | server/tests/api/server/follows.ts | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/server/tests/api/server/follows.ts b/server/tests/api/server/follows.ts index ce42df0a6..a19b47509 100644 --- a/server/tests/api/server/follows.ts +++ b/server/tests/api/server/follows.ts | |||
@@ -26,6 +26,8 @@ import { | |||
26 | } from '../../utils/videos/video-comments' | 26 | } from '../../utils/videos/video-comments' |
27 | import { rateVideo } from '../../utils/videos/videos' | 27 | import { rateVideo } from '../../utils/videos/videos' |
28 | import { waitJobs } from '../../utils/server/jobs' | 28 | import { waitJobs } from '../../utils/server/jobs' |
29 | import { createVideoCaption, listVideoCaptions, testCaptionFile } from '../../utils/videos/video-captions' | ||
30 | import { VideoCaption } from '../../../../shared/models/videos/video-caption.model' | ||
29 | 31 | ||
30 | const expect = chai.expect | 32 | const expect = chai.expect |
31 | 33 | ||
@@ -244,6 +246,16 @@ describe('Test follows', function () { | |||
244 | const text3 = 'my second answer to thread 1' | 246 | const text3 = 'my second answer to thread 1' |
245 | await addVideoCommentReply(servers[ 2 ].url, servers[ 2 ].accessToken, video4.id, threadId, text3) | 247 | await addVideoCommentReply(servers[ 2 ].url, servers[ 2 ].accessToken, video4.id, threadId, text3) |
246 | } | 248 | } |
249 | |||
250 | { | ||
251 | await createVideoCaption({ | ||
252 | url: servers[2].url, | ||
253 | accessToken: servers[2].accessToken, | ||
254 | language: 'ar', | ||
255 | videoId: video4.id, | ||
256 | fixture: 'subtitle-good2.vtt' | ||
257 | }) | ||
258 | } | ||
247 | } | 259 | } |
248 | 260 | ||
249 | await waitJobs(servers) | 261 | await waitJobs(servers) |
@@ -266,7 +278,7 @@ describe('Test follows', function () { | |||
266 | await expectAccountFollows(servers[2].url, 'peertube@localhost:9003', 1, 0) | 278 | await expectAccountFollows(servers[2].url, 'peertube@localhost:9003', 1, 0) |
267 | }) | 279 | }) |
268 | 280 | ||
269 | it('Should propagate videos', async function () { | 281 | it('Should have propagated videos', async function () { |
270 | const res = await getVideosList(servers[ 0 ].url) | 282 | const res = await getVideosList(servers[ 0 ].url) |
271 | expect(res.body.total).to.equal(7) | 283 | expect(res.body.total).to.equal(7) |
272 | 284 | ||
@@ -314,7 +326,7 @@ describe('Test follows', function () { | |||
314 | await completeVideoCheck(servers[ 0 ].url, video4, checkAttributes) | 326 | await completeVideoCheck(servers[ 0 ].url, video4, checkAttributes) |
315 | }) | 327 | }) |
316 | 328 | ||
317 | it('Should propagate comments', async function () { | 329 | it('Should have propagated comments', async function () { |
318 | const res1 = await getVideoCommentThreads(servers[0].url, video4.id, 0, 5) | 330 | const res1 = await getVideoCommentThreads(servers[0].url, video4.id, 0, 5) |
319 | 331 | ||
320 | expect(res1.body.total).to.equal(1) | 332 | expect(res1.body.total).to.equal(1) |
@@ -353,6 +365,18 @@ describe('Test follows', function () { | |||
353 | expect(secondChild.children).to.have.lengthOf(0) | 365 | expect(secondChild.children).to.have.lengthOf(0) |
354 | }) | 366 | }) |
355 | 367 | ||
368 | it('Should have propagated captions', async function () { | ||
369 | const res = await listVideoCaptions(servers[0].url, video4.id) | ||
370 | expect(res.body.total).to.equal(1) | ||
371 | expect(res.body.data).to.have.lengthOf(1) | ||
372 | |||
373 | const caption1: VideoCaption = res.body.data[0] | ||
374 | expect(caption1.language.id).to.equal('ar') | ||
375 | expect(caption1.language.label).to.equal('Arabic') | ||
376 | expect(caption1.captionPath).to.equal('/static/video-captions/' + video4.uuid + '-ar.vtt') | ||
377 | await testCaptionFile(servers[0].url, caption1.captionPath, 'Subtitle good 2.') | ||
378 | }) | ||
379 | |||
356 | it('Should unfollow server 3 on server 1 and does not list server 3 videos', async function () { | 380 | it('Should unfollow server 3 on server 1 and does not list server 3 videos', async function () { |
357 | this.timeout(5000) | 381 | this.timeout(5000) |
358 | 382 | ||