]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/cli/create-import-video-file-job.ts
Relax bitrate/fps test
[github/Chocobozzz/PeerTube.git] / server / tests / cli / create-import-video-file-job.ts
index 1e278bacccb00136287abfdc9086da5574867c3a..2cf2dd8f855aadc6960d54475138df0f334b912f 100644 (file)
@@ -1,22 +1,19 @@
 /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
 
-import 'mocha'
-import * as chai from 'chai'
+import { expect } from 'chai'
+import { areObjectStorageTestsDisabled } from '@shared/core-utils'
+import { HttpStatusCode, VideoDetails, VideoFile, VideoInclude } from '@shared/models'
 import {
-  areObjectStorageTestsDisabled,
   cleanupTests,
   createMultipleServers,
   doubleFollow,
-  expectStartWith,
   makeRawRequest,
   ObjectStorageCommand,
   PeerTubeServer,
   setAccessTokensToServers,
   waitJobs
-} from '@shared/extra-utils'
-import { HttpStatusCode, VideoDetails, VideoFile, VideoInclude } from '@shared/models'
-
-const expect = chai.expect
+} from '@shared/server-commands'
+import { expectStartWith } from '../shared'
 
 function assertVideoProperties (video: VideoFile, resolution: number, extname: string, size?: number) {
   expect(video).to.have.nested.property('resolution.id', resolution)
@@ -69,6 +66,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 () {
@@ -139,6 +140,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)
   })