]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/check-params/config.ts
Add audit logs for video import
[github/Chocobozzz/PeerTube.git] / server / tests / api / check-params / config.ts
index a66e51a6a53f502cc203832b2fee6800e4a87016..03855237fa4ea3a110832d964bdc4e0df8cdf418 100644 (file)
@@ -6,7 +6,7 @@ import { CustomConfig } from '../../../../shared/models/server/custom-config.mod
 
 import {
   createUser, flushTests, killallServers, makeDeleteRequest, makeGetRequest, makePutBodyRequest, runServer, ServerInfo,
-  setAccessTokensToServers, userLogin
+  setAccessTokensToServers, userLogin, immutableAssign
 } from '../../utils'
 
 describe('Test config API validators', function () {
@@ -16,16 +16,28 @@ describe('Test config API validators', function () {
   const updateParams: CustomConfig = {
     instance: {
       name: 'PeerTube updated',
+      shortDescription: 'my short description',
       description: 'my super description',
       terms: 'my super terms',
+      defaultClientRoute: '/videos/recently-added',
+      defaultNSFWPolicy: 'blur',
       customizations: {
         javascript: 'alert("coucou")',
         css: 'body { background-color: red; }'
       }
     },
+    services: {
+      twitter: {
+        username: '@MySuperUsername',
+        whitelisted: true
+      }
+    },
     cache: {
       previews: {
         size: 2
+      },
+      captions: {
+        size: 3
       }
     },
     signup: {
@@ -120,6 +132,22 @@ describe('Test config API validators', function () {
       })
     })
 
+    it('Should fail with a bad default NSFW policy', async function () {
+      const newUpdateParams = immutableAssign(updateParams, {
+        instance: {
+          defaultNSFWPolicy: 'hello'
+        }
+      })
+
+      await makePutBodyRequest({
+        url: server.url,
+        path,
+        fields: newUpdateParams,
+        token: server.accessToken,
+        statusCodeExpected: 400
+      })
+    })
+
     it('Should success with the correct parameters', async function () {
       await makePutBodyRequest({
         url: server.url,