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.ts28
1 files changed, 16 insertions, 12 deletions
diff --git a/server/tests/api/check-params/config.ts b/server/tests/api/check-params/config.ts
index 9549070ef..291de93ea 100644
--- a/server/tests/api/check-params/config.ts
+++ b/server/tests/api/check-params/config.ts
@@ -1,22 +1,20 @@
1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ 1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
2 2
3import { omit } from 'lodash'
4import 'mocha' 3import 'mocha'
5import { CustomConfig } from '../../../../shared/models/server/custom-config.model' 4import { omit } from 'lodash'
6 5import { HttpStatusCode } from '@shared/core-utils'
7import { 6import {
8 cleanupTests, 7 cleanupTests,
9 createUser, 8 createUser,
10 flushAndRunServer, 9 flushAndRunServer,
11 immutableAssign,
12 makeDeleteRequest, 10 makeDeleteRequest,
13 makeGetRequest, 11 makeGetRequest,
14 makePutBodyRequest, 12 makePutBodyRequest,
15 ServerInfo, 13 ServerInfo,
16 setAccessTokensToServers, 14 setAccessTokensToServers,
17 userLogin 15 userLogin
18} from '../../../../shared/extra-utils' 16} from '@shared/extra-utils'
19import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' 17import { CustomConfig } from '@shared/models'
20 18
21describe('Test config API validators', function () { 19describe('Test config API validators', function () {
22 const path = '/api/v1/config/custom' 20 const path = '/api/v1/config/custom'
@@ -265,11 +263,13 @@ describe('Test config API validators', function () {
265 }) 263 })
266 264
267 it('Should fail with a bad default NSFW policy', async function () { 265 it('Should fail with a bad default NSFW policy', async function () {
268 const newUpdateParams = immutableAssign(updateParams, { 266 const newUpdateParams = {
267 ...updateParams,
268
269 instance: { 269 instance: {
270 defaultNSFWPolicy: 'hello' 270 defaultNSFWPolicy: 'hello'
271 } 271 }
272 }) 272 }
273 273
274 await makePutBodyRequest({ 274 await makePutBodyRequest({
275 url: server.url, 275 url: server.url,
@@ -282,13 +282,15 @@ describe('Test config API validators', function () {
282 282
283 it('Should fail if email disabled and signup requires email verification', async function () { 283 it('Should fail if email disabled and signup requires email verification', async function () {
284 // opposite scenario - success when enable enabled - covered via tests/api/users/user-verification.ts 284 // opposite scenario - success when enable enabled - covered via tests/api/users/user-verification.ts
285 const newUpdateParams = immutableAssign(updateParams, { 285 const newUpdateParams = {
286 ...updateParams,
287
286 signup: { 288 signup: {
287 enabled: true, 289 enabled: true,
288 limit: 5, 290 limit: 5,
289 requiresEmailVerification: true 291 requiresEmailVerification: true
290 } 292 }
291 }) 293 }
292 294
293 await makePutBodyRequest({ 295 await makePutBodyRequest({
294 url: server.url, 296 url: server.url,
@@ -300,7 +302,9 @@ describe('Test config API validators', function () {
300 }) 302 })
301 303
302 it('Should fail with a disabled webtorrent & hls transcoding', async function () { 304 it('Should fail with a disabled webtorrent & hls transcoding', async function () {
303 const newUpdateParams = immutableAssign(updateParams, { 305 const newUpdateParams = {
306 ...updateParams,
307
304 transcoding: { 308 transcoding: {
305 hls: { 309 hls: {
306 enabled: false 310 enabled: false
@@ -309,7 +313,7 @@ describe('Test config API validators', function () {
309 enabled: false 313 enabled: false
310 } 314 }
311 } 315 }
312 }) 316 }
313 317
314 await makePutBodyRequest({ 318 await makePutBodyRequest({
315 url: server.url, 319 url: server.url,