]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/videos/single-server.ts
Try parallel check params tests
[github/Chocobozzz/PeerTube.git] / server / tests / api / videos / single-server.ts
index 8995a85257d20c73c072e44a1c0f57b13633c83a..1f366b642f07a3e1d9858f0d3ecd08ea6d54ba5b 100644 (file)
@@ -6,8 +6,9 @@ import 'mocha'
 import { VideoPrivacy } from '../../../../shared/models/videos'
 import {
   checkVideoFilesWereRemoved,
+  cleanupTests,
   completeVideoCheck,
-  flushTests,
+  flushAndRunServer,
   getVideo,
   getVideoCategories,
   getVideoLanguages,
@@ -17,10 +18,8 @@ import {
   getVideosListPagination,
   getVideosListSort,
   getVideosWithFilters,
-  killallServers,
   rateVideo,
   removeVideo,
-  runServer,
   ServerInfo,
   setAccessTokensToServers,
   testImage,
@@ -28,7 +27,7 @@ import {
   uploadVideo,
   viewVideo,
   wait
-} from '../../utils'
+} from '../../../../shared/extra-utils'
 
 const expect = chai.expect
 
@@ -55,7 +54,7 @@ describe('Test a single server', function () {
     tags: [ 'tag1', 'tag2', 'tag3' ],
     privacy: VideoPrivacy.PUBLIC,
     commentsEnabled: true,
-    downloadingEnabled: true,
+    downloadEnabled: true,
     channel: {
       displayName: 'Main root channel',
       name: 'root_channel',
@@ -88,7 +87,7 @@ describe('Test a single server', function () {
     privacy: VideoPrivacy.PUBLIC,
     duration: 5,
     commentsEnabled: false,
-    downloadingEnabled: false,
+    downloadEnabled: false,
     channel: {
       name: 'root_channel',
       displayName: 'Main root channel',
@@ -107,9 +106,7 @@ describe('Test a single server', function () {
   before(async function () {
     this.timeout(30000)
 
-    await flushTests()
-
-    server = await runServer(1)
+    server = await flushAndRunServer(1)
 
     await setAccessTokensToServers([ server ])
   })
@@ -120,7 +117,7 @@ describe('Test a single server', function () {
     const categories = res.body
     expect(Object.keys(categories)).to.have.length.above(10)
 
-    expect(categories[11]).to.equal('News')
+    expect(categories[11]).to.equal('News & Politics')
   })
 
   it('Should list video licences', async function () {
@@ -358,7 +355,7 @@ describe('Test a single server', function () {
       nsfw: false,
       description: 'my super description updated',
       commentsEnabled: false,
-      downloadingEnabled: false,
+      downloadEnabled: false,
       tags: [ 'tagup1', 'tagup2' ]
     }
     await updateVideo(server.url, server.accessToken, videoId, attributes)
@@ -427,11 +424,6 @@ describe('Test a single server', function () {
   })
 
   after(async function () {
-    killallServers([ server ])
-
-    // Keep the logs if the test failed
-    if (this['ok']) {
-      await flushTests()
-    }
+    await cleanupTests([ server ])
   })
 })