import {
createUser, flushTests, killallServers, makeDeleteRequest, makeGetRequest, makePutBodyRequest, runServer, ServerInfo,
- setAccessTokensToServers, userLogin
+ setAccessTokensToServers, userLogin, immutableAssign
} from '../../utils'
describe('Test config API validators', function () {
description: 'my super description',
terms: 'my super terms',
defaultClientRoute: '/videos/recently-added',
+ defaultNSFWPolicy: 'blur',
customizations: {
javascript: 'alert("coucou")',
css: 'body { background-color: red; }'
})
})
+ 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,