]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/cli/create-import-video-file-job.ts
Fix services tests
[github/Chocobozzz/PeerTube.git] / server / tests / cli / create-import-video-file-job.ts
index 01817216e8b294adb8e117ae9aab49ee626cb8b2..c06b9550cb4d611216c657f9c15da7aa2978d850 100644 (file)
@@ -14,7 +14,7 @@ import {
   setAccessTokensToServers,
   waitJobs
 } from '@shared/extra-utils'
-import { HttpStatusCode, VideoDetails, VideoFile } from '@shared/models'
+import { HttpStatusCode, VideoDetails, VideoFile, VideoInclude } from '@shared/models'
 
 const expect = chai.expect
 
@@ -69,6 +69,10 @@ function runTests (objectStorage: boolean) {
     }
 
     await waitJobs(servers)
+
+    for (const server of servers) {
+      await server.config.enableTranscoding()
+    }
   })
 
   it('Should run a import job on video 1 with a lower resolution', async function () {
@@ -100,7 +104,7 @@ function runTests (objectStorage: boolean) {
     await waitJobs(servers)
 
     for (const server of servers) {
-      const { data: videos } = await server.videos.list()
+      const { data: videos } = await server.videos.listWithToken({ include: VideoInclude.NOT_PUBLISHED_STATE })
       expect(videos).to.have.lengthOf(2)
 
       const video = videos.find(({ uuid }) => uuid === video2UUID)
@@ -124,7 +128,7 @@ function runTests (objectStorage: boolean) {
     await waitJobs(servers)
 
     for (const server of servers) {
-      const { data: videos } = await server.videos.list()
+      const { data: videos } = await server.videos.listWithToken({ include: VideoInclude.NOT_PUBLISHED_STATE })
       expect(videos).to.have.lengthOf(2)
 
       const video = videos.find(({ shortUUID }) => shortUUID === video1ShortId)
@@ -139,6 +143,11 @@ function runTests (objectStorage: boolean) {
     }
   })
 
+  it('Should not have run transcoding after an import job', async function () {
+    const { data } = await servers[0].jobs.list({ jobType: 'video-transcoding' })
+    expect(data).to.have.lengthOf(0)
+  })
+
   after(async function () {
     await cleanupTests(servers)
   })