]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/videos/video-imports.ts
Fix import tests
[github/Chocobozzz/PeerTube.git] / server / tests / api / videos / video-imports.ts
index 2eac130d2a638186c2d44b872c4d2a3c6f0c76c3..4686d58002cce8cde45777d6666f2e21b04de3e5 100644 (file)
@@ -288,17 +288,17 @@ Ajouter un sous-titre est vraiment facile`)
   })
 
   it('Should import no HDR version on a HDR video', async function () {
-    this.timeout(120_000)
+    this.timeout(300_000)
 
     const config = {
       transcoding: {
         enabled: true,
         resolutions: {
-          '240p': false,
+          '240p': true,
           '360p': false,
           '480p': false,
           '720p': false,
-          '1080p': true, // the resulting resolution shouldn't be higher than this, and not vp9.2/av01
+          '1080p': false, // the resulting resolution shouldn't be higher than this, and not vp9.2/av01
           '1440p': false,
           '2160p': false
         },
@@ -333,7 +333,33 @@ Ajouter un sous-titre est vraiment facile`)
     const video = await servers[0].videos.get({ id: videoUUID })
     expect(video.name).to.equal('hdr video')
     const maxResolution = Math.max.apply(Math, video.files.map(function (o) { return o.resolution.id }))
-    expect(maxResolution, 'expected max resolution not met').to.equals(VideoResolution.H_1080P)
+    expect(maxResolution, 'expected max resolution not met').to.equals(VideoResolution.H_240P)
+  })
+
+  it('Should import a peertube video', async function () {
+    this.timeout(120_000)
+
+    // TODO: include peertube_short when https://github.com/ytdl-org/youtube-dl/pull/29475 is merged
+    for (const targetUrl of [ FIXTURE_URLS.peertube_long ]) {
+    // for (const targetUrl of [ FIXTURE_URLS.peertube_long, FIXTURE_URLS.peertube_short ]) {
+      await servers[0].config.disableTranscoding()
+
+      const attributes = {
+        targetUrl,
+        channelId: channelIdServer1,
+        privacy: VideoPrivacy.PUBLIC
+      }
+      const { video } = await servers[0].imports.importVideo({ attributes })
+      const videoUUID = video.uuid
+
+      await waitJobs(servers)
+
+      for (const server of servers) {
+        const video = await server.videos.get({ id: videoUUID })
+
+        expect(video.name).to.equal('E2E tests')
+      }
+    }
   })
 
   after(async function () {