]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/server/config.ts
Merge branch 'release/4.2.0' into develop
[github/Chocobozzz/PeerTube.git] / server / tests / api / server / config.ts
index ea524723cfee2d20976fba22ffd87c7fb8e80f92..0f2fb5493cf84ae70e2c249557fdfe76a4b4bdaa 100644 (file)
@@ -2,16 +2,16 @@
 
 import 'mocha'
 import * as chai from 'chai'
+import { parallelTests } from '@shared/core-utils'
+import { CustomConfig, HttpStatusCode } from '@shared/models'
 import {
   cleanupTests,
   createSingleServer,
   killallServers,
   makeGetRequest,
-  parallelTests,
   PeerTubeServer,
   setAccessTokensToServers
-} from '@shared/extra-utils'
-import { CustomConfig, HttpStatusCode } from '@shared/models'
+} from '@shared/server-commands'
 
 const expect = chai.expect
 
@@ -43,6 +43,9 @@ function checkInitialConfig (server: PeerTubeServer, data: CustomConfig) {
   expect(data.services.twitter.username).to.equal('@Chocobozzz')
   expect(data.services.twitter.whitelisted).to.be.false
 
+  expect(data.client.videos.miniature.preferAuthorDisplayName).to.be.false
+  expect(data.client.menu.login.redirectOnSingleExternalAuth).to.be.false
+
   expect(data.cache.previews.size).to.equal(1)
   expect(data.cache.captions.size).to.equal(1)
   expect(data.cache.torrents.size).to.equal(1)
@@ -79,6 +82,7 @@ function checkInitialConfig (server: PeerTubeServer, data: CustomConfig) {
 
   expect(data.live.enabled).to.be.false
   expect(data.live.allowReplay).to.be.false
+  expect(data.live.latencySetting.enabled).to.be.true
   expect(data.live.maxDuration).to.equal(-1)
   expect(data.live.maxInstanceLives).to.equal(20)
   expect(data.live.maxUserLives).to.equal(3)
@@ -94,6 +98,8 @@ function checkInitialConfig (server: PeerTubeServer, data: CustomConfig) {
   expect(data.live.transcoding.resolutions['1440p']).to.be.false
   expect(data.live.transcoding.resolutions['2160p']).to.be.false
 
+  expect(data.videoStudio.enabled).to.be.false
+
   expect(data.import.videos.concurrency).to.equal(2)
   expect(data.import.videos.http.enabled).to.be.true
   expect(data.import.videos.torrent.enabled).to.be.true
@@ -138,6 +144,9 @@ function checkUpdatedConfig (data: CustomConfig) {
   expect(data.services.twitter.username).to.equal('@Kuja')
   expect(data.services.twitter.whitelisted).to.be.true
 
+  expect(data.client.videos.miniature.preferAuthorDisplayName).to.be.true
+  expect(data.client.menu.login.redirectOnSingleExternalAuth).to.be.true
+
   expect(data.cache.previews.size).to.equal(2)
   expect(data.cache.captions.size).to.equal(3)
   expect(data.cache.torrents.size).to.equal(4)
@@ -177,6 +186,7 @@ function checkUpdatedConfig (data: CustomConfig) {
 
   expect(data.live.enabled).to.be.true
   expect(data.live.allowReplay).to.be.true
+  expect(data.live.latencySetting.enabled).to.be.false
   expect(data.live.maxDuration).to.equal(5000)
   expect(data.live.maxInstanceLives).to.equal(-1)
   expect(data.live.maxUserLives).to.equal(10)
@@ -191,6 +201,8 @@ function checkUpdatedConfig (data: CustomConfig) {
   expect(data.live.transcoding.resolutions['1080p']).to.be.true
   expect(data.live.transcoding.resolutions['2160p']).to.be.true
 
+  expect(data.videoStudio.enabled).to.be.true
+
   expect(data.import.videos.concurrency).to.equal(4)
   expect(data.import.videos.http.enabled).to.be.false
   expect(data.import.videos.torrent.enabled).to.be.false
@@ -246,6 +258,18 @@ const newCustomConfig: CustomConfig = {
       whitelisted: true
     }
   },
+  client: {
+    videos: {
+      miniature: {
+        preferAuthorDisplayName: true
+      }
+    },
+    menu: {
+      login: {
+        redirectOnSingleExternalAuth: true
+      }
+    }
+  },
   cache: {
     previews: {
       size: 2
@@ -304,6 +328,9 @@ const newCustomConfig: CustomConfig = {
   live: {
     enabled: true,
     allowReplay: true,
+    latencySetting: {
+      enabled: false
+    },
     maxDuration: 5000,
     maxInstanceLives: -1,
     maxUserLives: 10,
@@ -323,6 +350,9 @@ const newCustomConfig: CustomConfig = {
       }
     }
   },
+  videoStudio: {
+    enabled: true
+  },
   import: {
     videos: {
       concurrency: 4,
@@ -337,7 +367,7 @@ const newCustomConfig: CustomConfig = {
   trending: {
     videos: {
       algorithms: {
-        enabled: [ 'best', 'hot', 'most-viewed', 'most-liked' ],
+        enabled: [ 'hot', 'most-viewed', 'most-liked' ],
         default: 'hot'
       }
     }