]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/videos/video-imports.ts
Fix peertube subtitles import
[github/Chocobozzz/PeerTube.git] / server / tests / api / videos / video-imports.ts
index 878452ed2c988315d66bf842ad6e0936cba81ef1..192b2aeb9ae7c705090ee2ecf90d1eaeb23e8ef0 100644 (file)
@@ -449,6 +449,16 @@ describe('Test video imports', function () {
             const video = await server.videos.get({ id: videoUUID })
 
             expect(video.name).to.equal('E2E tests')
+
+            const { data: captions } = await server.captions.list({ videoId: videoUUID })
+            expect(captions).to.have.lengthOf(1)
+            expect(captions[0].language.id).to.equal('fr')
+
+            const str = `WEBVTT FILE\r?\n\r?\n` +
+            `1\r?\n` +
+            `00:00:04.000 --> 00:00:09.000\r?\n` +
+            `January 1, 1994. The North American`
+            await testCaptionFile(server.url, captions[0].captionPath, new RegExp(str))
           }
         }
       })