diff options
author | Chocobozzz <me@florianbigard.com> | 2021-02-18 14:06:12 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-02-18 14:08:16 +0100 |
commit | 53c06121a45a2ec943002833a0152bbfd4856ee4 (patch) | |
tree | e934d6ac102d5f7b29fe3316f57d6d2164aceeb9 /server/tests/api/videos | |
parent | 8efc27bf14f1fe3ed23cd8a6d2de1f0918a7f769 (diff) | |
download | PeerTube-53c06121a45a2ec943002833a0152bbfd4856ee4.tar.gz PeerTube-53c06121a45a2ec943002833a0152bbfd4856ee4.tar.zst PeerTube-53c06121a45a2ec943002833a0152bbfd4856ee4.zip |
Fix import tests
Diffstat (limited to 'server/tests/api/videos')
-rw-r--r-- | server/tests/api/videos/video-imports.ts | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/server/tests/api/videos/video-imports.ts b/server/tests/api/videos/video-imports.ts index 61e7a81ee..80834ca86 100644 --- a/server/tests/api/videos/video-imports.ts +++ b/server/tests/api/videos/video-imports.ts | |||
@@ -129,8 +129,10 @@ describe('Test video imports', function () { | |||
129 | const attributes = immutableAssign(baseAttributes, { targetUrl: getYoutubeVideoUrl() }) | 129 | const attributes = immutableAssign(baseAttributes, { targetUrl: getYoutubeVideoUrl() }) |
130 | const res = await importVideo(servers[0].url, servers[0].accessToken, attributes) | 130 | const res = await importVideo(servers[0].url, servers[0].accessToken, attributes) |
131 | expect(res.body.video.name).to.equal('small video - youtube') | 131 | expect(res.body.video.name).to.equal('small video - youtube') |
132 | expect(res.body.video.thumbnailPath).to.equal(`/static/thumbnails/${res.body.video.uuid}.jpg`) | 132 | |
133 | expect(res.body.video.previewPath).to.equal(`/lazy-static/previews/${res.body.video.uuid}.jpg`) | 133 | expect(res.body.video.thumbnailPath).to.match(new RegExp(`^/static/thumbnails/.+.jpg$`)) |
134 | expect(res.body.video.previewPath).to.match(new RegExp(`^/lazy-static/previews/.+.jpg$`)) | ||
135 | |||
134 | await testImage(servers[0].url, 'video_import_thumbnail', res.body.video.thumbnailPath) | 136 | await testImage(servers[0].url, 'video_import_thumbnail', res.body.video.thumbnailPath) |
135 | await testImage(servers[0].url, 'video_import_preview', res.body.video.previewPath) | 137 | await testImage(servers[0].url, 'video_import_preview', res.body.video.previewPath) |
136 | 138 | ||
@@ -141,7 +143,7 @@ describe('Test video imports', function () { | |||
141 | const enCaption = videoCaptions.find(caption => caption.language.id === 'en') | 143 | const enCaption = videoCaptions.find(caption => caption.language.id === 'en') |
142 | expect(enCaption).to.exist | 144 | expect(enCaption).to.exist |
143 | expect(enCaption.language.label).to.equal('English') | 145 | expect(enCaption.language.label).to.equal('English') |
144 | expect(enCaption.captionPath).to.equal(`/lazy-static/video-captions/${res.body.video.uuid}-en.vtt`) | 146 | expect(enCaption.captionPath).to.match(new RegExp(`^/lazy-static/video-captions/.+-en.vtt$`)) |
145 | await testCaptionFile(servers[0].url, enCaption.captionPath, `WEBVTT | 147 | await testCaptionFile(servers[0].url, enCaption.captionPath, `WEBVTT |
146 | Kind: captions | 148 | Kind: captions |
147 | Language: en | 149 | Language: en |
@@ -158,7 +160,7 @@ Adding subtitles is very easy to do`) | |||
158 | const frCaption = videoCaptions.find(caption => caption.language.id === 'fr') | 160 | const frCaption = videoCaptions.find(caption => caption.language.id === 'fr') |
159 | expect(frCaption).to.exist | 161 | expect(frCaption).to.exist |
160 | expect(frCaption.language.label).to.equal('French') | 162 | expect(frCaption.language.label).to.equal('French') |
161 | expect(frCaption.captionPath).to.equal(`/lazy-static/video-captions/${res.body.video.uuid}-fr.vtt`) | 163 | expect(frCaption.captionPath).to.match(new RegExp(`^/lazy-static/video-captions/.+-fr.vtt`)) |
162 | await testCaptionFile(servers[0].url, frCaption.captionPath, `WEBVTT | 164 | await testCaptionFile(servers[0].url, frCaption.captionPath, `WEBVTT |
163 | Kind: captions | 165 | Kind: captions |
164 | Language: fr | 166 | Language: fr |