aboutsummaryrefslogtreecommitdiffhomepage
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to 'server')
-rw-r--r--server/tests/api/videos/video-imports.ts16
1 files changed, 10 insertions, 6 deletions
diff --git a/server/tests/api/videos/video-imports.ts b/server/tests/api/videos/video-imports.ts
index 28da69e8e..7482a7ceb 100644
--- a/server/tests/api/videos/video-imports.ts
+++ b/server/tests/api/videos/video-imports.ts
@@ -143,9 +143,11 @@ describe('Test video imports', function () {
143 expect(enCaption.language.label).to.equal('English') 143 expect(enCaption.language.label).to.equal('English')
144 expect(enCaption.captionPath).to.match(new RegExp(`^/lazy-static/video-captions/.+-en.vtt$`)) 144 expect(enCaption.captionPath).to.match(new RegExp(`^/lazy-static/video-captions/.+-en.vtt$`))
145 145
146 const regex = `WEBVTT[ \n]+Kind: captions[ \n]+Language: en[ \n]+00:00:01.600 --> 00:00:04.200[ \n]+English \\(US\\)[ \n]+` + 146 const regex = `WEBVTT[ \n]+Kind: captions[ \n]+` +
147 `00:00:05.900 --> 00:00:07.999[ \n]+This is a subtitle in American English[ \n]+` + 147 `(Language: en[ \n]+)?` +
148 `00:00:10.000 --> 00:00:14.000[ \n]+Adding subtitles is very easy to do` 148 `00:00:01.600 --> 00:00:04.200 (position:\\d+% line:\\d+%)?[ \n]+English \\(US\\)[ \n]+` +
149 `00:00:05.900 --> 00:00:07.999 (position:\\d+% line:\\d+%)?[ \n]+This is a subtitle in American English[ \n]+` +
150 `00:00:10.000 --> 00:00:14.000 (position:\\d+% line:\\d+%)?[ \n]+Adding subtitles is very easy to do`
149 await testCaptionFile(servers[0].url, enCaption.captionPath, new RegExp(regex)) 151 await testCaptionFile(servers[0].url, enCaption.captionPath, new RegExp(regex))
150 } 152 }
151 153
@@ -155,9 +157,11 @@ describe('Test video imports', function () {
155 expect(frCaption.language.label).to.equal('French') 157 expect(frCaption.language.label).to.equal('French')
156 expect(frCaption.captionPath).to.match(new RegExp(`^/lazy-static/video-captions/.+-fr.vtt`)) 158 expect(frCaption.captionPath).to.match(new RegExp(`^/lazy-static/video-captions/.+-fr.vtt`))
157 159
158 const regex = `WEBVTT[ \n]+Kind: captions[ \n]+Language: fr[ \n]+00:00:01.600 --> 00:00:04.200[ \n]+` + 160 const regex = `WEBVTT[ \n]+Kind: captions[ \n]+` +
159 `Français \\(FR\\)[ \n]+00:00:05.900 --> 00:00:07.999[ \n]+C'est un sous-titre français[ \n]+` + 161 `(Language: fr[ \n]+)?` +
160 `00:00:10.000 --> 00:00:14.000[ \n]+Ajouter un sous-titre est vraiment facile` 162 `00:00:01.600 --> 00:00:04.200 (position:\\d+% line:\\d+%)?[ \n]+Français \\(FR\\)[ \n]+` +
163 `00:00:05.900 --> 00:00:07.999 (position:\\d+% line:\\d+%)?[ \n]+C'est un sous-titre français[ \n]+` +
164 `00:00:10.000 --> 00:00:14.000 (position:\\d+% line:\\d+%)?[ \n]+Ajouter un sous-titre est vraiment facile`
161 165
162 await testCaptionFile(servers[0].url, frCaption.captionPath, new RegExp(regex)) 166 await testCaptionFile(servers[0].url, frCaption.captionPath, new RegExp(regex))
163 } 167 }