aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/check-params/config.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api/check-params/config.ts')
-rw-r--r--server/tests/api/check-params/config.ts19
1 files changed, 18 insertions, 1 deletions
diff --git a/server/tests/api/check-params/config.ts b/server/tests/api/check-params/config.ts
index 3fe517fad..58b780f38 100644
--- a/server/tests/api/check-params/config.ts
+++ b/server/tests/api/check-params/config.ts
@@ -6,7 +6,7 @@ import { CustomConfig } from '../../../../shared/models/server/custom-config.mod
6 6
7import { 7import {
8 createUser, flushTests, killallServers, makeDeleteRequest, makeGetRequest, makePutBodyRequest, runServer, ServerInfo, 8 createUser, flushTests, killallServers, makeDeleteRequest, makeGetRequest, makePutBodyRequest, runServer, ServerInfo,
9 setAccessTokensToServers, userLogin 9 setAccessTokensToServers, userLogin, immutableAssign
10} from '../../utils' 10} from '../../utils'
11 11
12describe('Test config API validators', function () { 12describe('Test config API validators', function () {
@@ -20,6 +20,7 @@ describe('Test config API validators', function () {
20 description: 'my super description', 20 description: 'my super description',
21 terms: 'my super terms', 21 terms: 'my super terms',
22 defaultClientRoute: '/videos/recently-added', 22 defaultClientRoute: '/videos/recently-added',
23 defaultNSFWPolicy: 'blur',
23 customizations: { 24 customizations: {
24 javascript: 'alert("coucou")', 25 javascript: 'alert("coucou")',
25 css: 'body { background-color: red; }' 26 css: 'body { background-color: red; }'
@@ -122,6 +123,22 @@ describe('Test config API validators', function () {
122 }) 123 })
123 }) 124 })
124 125
126 it('Should fail with a bad default NSFW policy', async function () {
127 const newUpdateParams = immutableAssign(updateParams, {
128 instance: {
129 defaultNSFWPolicy: 'hello'
130 }
131 })
132
133 await makePutBodyRequest({
134 url: server.url,
135 path,
136 fields: newUpdateParams,
137 token: server.accessToken,
138 statusCodeExpected: 400
139 })
140 })
141
125 it('Should success with the correct parameters', async function () { 142 it('Should success with the correct parameters', async function () {
126 await makePutBodyRequest({ 143 await makePutBodyRequest({
127 url: server.url, 144 url: server.url,