import {
createUser, flushTests, killallServers, makeDeleteRequest, makeGetRequest, makePutBodyRequest, runServer, ServerInfo,
setAccessTokensToServers, userLogin, immutableAssign
-} from '../../utils'
+} from '../../../../shared/utils'
describe('Test config API validators', function () {
const path = '/api/v1/config/custom'
shortDescription: 'my short description',
description: 'my super description',
terms: 'my super terms',
+ isNSFW: true,
defaultClientRoute: '/videos/recently-added',
defaultNSFWPolicy: 'blur',
customizations: {
},
signup: {
enabled: false,
- limit: 5
+ limit: 5,
+ requiresEmailVerification: false
},
admin: {
email: 'superadmin1@example.com'
},
+ contactForm: {
+ enabled: false
+ },
user: {
- videoQuota: 5242881
+ videoQuota: 5242881,
+ videoQuotaDaily: 318742
},
transcoding: {
enabled: true,
+ allowAdditionalExtensions: true,
threads: 1,
resolutions: {
'240p': false,
'480p': true,
'720p': false,
'1080p': false
+ },
+ hls: {
+ enabled: false
}
},
import: {
enabled: false
}
}
+ },
+ autoBlacklist: {
+ videos: {
+ ofUsers: {
+ enabled: false
+ }
+ }
+ },
+ followers: {
+ instance: {
+ enabled: false
+ }
}
}
})
})
+ it('Should fail if email disabled and signup requires email verification', async function () {
+ // opposite scenario - succcess when enable enabled - covered via tests/api/users/user-verification.ts
+ const newUpdateParams = immutableAssign(updateParams, {
+ signup: {
+ enabled: true,
+ limit: 5,
+ requiresEmailVerification: true
+ }
+ })
+
+ 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,