+ const attributes = { ...baseAttributes, targetUrl: FIXTURE_URLS.youtube }
+ const { video } = await servers[0].imports.importVideo({ attributes })
+ expect(video.name).to.equal('small video - youtube')
+
+ expect(video.thumbnailPath).to.match(new RegExp(`^/static/thumbnails/.+.jpg$`))
+ expect(video.previewPath).to.match(new RegExp(`^/lazy-static/previews/.+.jpg$`))
+
+ await testImage(servers[0].url, 'video_import_thumbnail', video.thumbnailPath)
+ await testImage(servers[0].url, 'video_import_preview', video.previewPath)
+
+ const bodyCaptions = await servers[0].captions.list({ videoId: video.id })
+ const videoCaptions = bodyCaptions.data
+ expect(videoCaptions).to.have.lengthOf(2)
+
+ const enCaption = videoCaptions.find(caption => caption.language.id === 'en')
+ expect(enCaption).to.exist
+ expect(enCaption.language.label).to.equal('English')
+ expect(enCaption.captionPath).to.match(new RegExp(`^/lazy-static/video-captions/.+-en.vtt$`))
+ await testCaptionFile(servers[0].url, enCaption.captionPath, `WEBVTT
+Kind: captions
+Language: en
+
+00:00:01.600 --> 00:00:04.200
+English (US)
+
+00:00:05.900 --> 00:00:07.999
+This is a subtitle in American English
+
+00:00:10.000 --> 00:00:14.000
+Adding subtitles is very easy to do`)
+
+ const frCaption = videoCaptions.find(caption => caption.language.id === 'fr')
+ expect(frCaption).to.exist
+ expect(frCaption.language.label).to.equal('French')
+ expect(frCaption.captionPath).to.match(new RegExp(`^/lazy-static/video-captions/.+-fr.vtt`))
+ await testCaptionFile(servers[0].url, frCaption.captionPath, `WEBVTT
+Kind: captions
+Language: fr
+
+00:00:01.600 --> 00:00:04.200
+Français (FR)
+
+00:00:05.900 --> 00:00:07.999
+C'est un sous-titre français
+
+00:00:10.000 --> 00:00:14.000
+Ajouter un sous-titre est vraiment facile`)