+ const newUpdateParams = { ...updateParams, admin: omit(updateParams.admin, [ 'email' ]) }
+
+ await makePutBodyRequest({
+ url: server.url,
+ path,
+ fields: newUpdateParams,
+ token: server.accessToken,
+ expectedStatus: HttpStatusCode.BAD_REQUEST_400
+ })
+ })
+
+ it('Should fail with a bad default NSFW policy', async function () {
+ const newUpdateParams = {
+ ...updateParams,
+
+ instance: {
+ defaultNSFWPolicy: 'hello'
+ }
+ }
+
+ await makePutBodyRequest({
+ url: server.url,
+ path,
+ fields: newUpdateParams,
+ token: server.accessToken,
+ expectedStatus: HttpStatusCode.BAD_REQUEST_400
+ })
+ })
+
+ it('Should fail if email disabled and signup requires email verification', async function () {
+ // opposite scenario - success when enable enabled - covered via tests/api/users/user-verification.ts
+ const newUpdateParams = {
+ ...updateParams,
+
+ signup: {
+ enabled: true,
+ limit: 5,
+ requiresApproval: true,
+ requiresEmailVerification: true
+ }
+ }
+
+ await makePutBodyRequest({
+ url: server.url,
+ path,
+ fields: newUpdateParams,
+ token: server.accessToken,
+ expectedStatus: HttpStatusCode.BAD_REQUEST_400
+ })
+ })
+
+ it('Should fail with a disabled webtorrent & hls transcoding', async function () {
+ const newUpdateParams = {
+ ...updateParams,
+
+ transcoding: {
+ hls: {
+ enabled: false
+ },
+ webtorrent: {
+ enabled: false
+ }
+ }
+ }
+
+ await makePutBodyRequest({
+ url: server.url,
+ path,
+ fields: newUpdateParams,
+ token: server.accessToken,
+ expectedStatus: HttpStatusCode.BAD_REQUEST_400
+ })
+ })
+
+ it('Should fail with a disabled http upload & enabled sync', async function () {
+ const newUpdateParams: CustomConfig = merge({}, updateParams, {
+ import: {
+ videos: {
+ http: { enabled: false }
+ },
+ videoChannelSynchronization: { enabled: true }
+ }
+ })