aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-05-18 08:44:20 +0200
committerChocobozzz <me@florianbigard.com>2022-05-18 08:44:20 +0200
commit0cc253c9719b1e361d33d62adcef4c292cc98be9 (patch)
treed2af4ee1d55bb2d708d440b4a544a6fc46632fea /server/tests/api
parentf4120aea7a4b4785cc59b690b9187621c84126af (diff)
downloadPeerTube-0cc253c9719b1e361d33d62adcef4c292cc98be9.tar.gz
PeerTube-0cc253c9719b1e361d33d62adcef4c292cc98be9.tar.zst
PeerTube-0cc253c9719b1e361d33d62adcef4c292cc98be9.zip
Fix import tests
Diffstat (limited to 'server/tests/api')
-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 }