aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/notifications/moderation-notifications.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-13 09:43:59 +0200
committerChocobozzz <me@florianbigard.com>2021-07-20 15:27:18 +0200
commit6c5065a011b099618681a37bd77eaa7bd3db752e (patch)
tree352252a00b25013c4b1902f6bcd9668aba295c7b /server/tests/api/notifications/moderation-notifications.ts
parent0d8ecb7592577f54012413a2b5a9b159cfc90399 (diff)
downloadPeerTube-6c5065a011b099618681a37bd77eaa7bd3db752e.tar.gz
PeerTube-6c5065a011b099618681a37bd77eaa7bd3db752e.tar.zst
PeerTube-6c5065a011b099618681a37bd77eaa7bd3db752e.zip
Introduce server commands
Diffstat (limited to 'server/tests/api/notifications/moderation-notifications.ts')
-rw-r--r--server/tests/api/notifications/moderation-notifications.ts13
1 files changed, 7 insertions, 6 deletions
diff --git a/server/tests/api/notifications/moderation-notifications.ts b/server/tests/api/notifications/moderation-notifications.ts
index 229f78811..99b434606 100644
--- a/server/tests/api/notifications/moderation-notifications.ts
+++ b/server/tests/api/notifications/moderation-notifications.ts
@@ -20,7 +20,6 @@ import {
20 createUser, 20 createUser,
21 generateUserAccessToken, 21 generateUserAccessToken,
22 getVideoIdFromUUID, 22 getVideoIdFromUUID,
23 immutableAssign,
24 MockInstancesIndex, 23 MockInstancesIndex,
25 MockSmtpServer, 24 MockSmtpServer,
26 prepareNotificationsTest, 25 prepareNotificationsTest,
@@ -347,7 +346,7 @@ describe('Test moderation notifications', function () {
347 await checkUserRegistered(baseParams, 'user_45', 'presence') 346 await checkUserRegistered(baseParams, 'user_45', 'presence')
348 347
349 const userOverride = { socketNotifications: userNotifications, token: userAccessToken, check: { web: true, mail: false } } 348 const userOverride = { socketNotifications: userNotifications, token: userAccessToken, check: { web: true, mail: false } }
350 await checkUserRegistered(immutableAssign(baseParams, userOverride), 'user_45', 'absence') 349 await checkUserRegistered({ ...baseParams, ...userOverride }, 'user_45', 'absence')
351 }) 350 })
352 }) 351 })
353 352
@@ -389,7 +388,7 @@ describe('Test moderation notifications', function () {
389 await checkNewInstanceFollower(baseParams, 'localhost:' + servers[2].port, 'presence') 388 await checkNewInstanceFollower(baseParams, 'localhost:' + servers[2].port, 'presence')
390 389
391 const userOverride = { socketNotifications: userNotifications, token: userAccessToken, check: { web: true, mail: false } } 390 const userOverride = { socketNotifications: userNotifications, token: userAccessToken, check: { web: true, mail: false } }
392 await checkNewInstanceFollower(immutableAssign(baseParams, userOverride), 'localhost:' + servers[2].port, 'absence') 391 await checkNewInstanceFollower({ ...baseParams, ...userOverride }, 'localhost:' + servers[2].port, 'absence')
393 }) 392 })
394 393
395 it('Should send a notification on auto follow back', async function () { 394 it('Should send a notification on auto follow back', async function () {
@@ -416,7 +415,7 @@ describe('Test moderation notifications', function () {
416 await checkAutoInstanceFollowing(baseParams, followerHost, followingHost, 'presence') 415 await checkAutoInstanceFollowing(baseParams, followerHost, followingHost, 'presence')
417 416
418 const userOverride = { socketNotifications: userNotifications, token: userAccessToken, check: { web: true, mail: false } } 417 const userOverride = { socketNotifications: userNotifications, token: userAccessToken, check: { web: true, mail: false } }
419 await checkAutoInstanceFollowing(immutableAssign(baseParams, userOverride), followerHost, followingHost, 'absence') 418 await checkAutoInstanceFollowing({ ...baseParams, ...userOverride }, followerHost, followingHost, 'absence')
420 419
421 config.followings.instance.autoFollowBack.enabled = false 420 config.followings.instance.autoFollowBack.enabled = false
422 await servers[0].configCommand.updateCustomSubConfig({ newConfig: config }) 421 await servers[0].configCommand.updateCustomSubConfig({ newConfig: config })
@@ -476,7 +475,9 @@ describe('Test moderation notifications', function () {
476 475
477 currentCustomConfig = await servers[0].configCommand.getCustomConfig() 476 currentCustomConfig = await servers[0].configCommand.getCustomConfig()
478 477
479 const autoBlacklistTestsCustomConfig = immutableAssign(currentCustomConfig, { 478 const autoBlacklistTestsCustomConfig = {
479 ...currentCustomConfig,
480
480 autoBlacklist: { 481 autoBlacklist: {
481 videos: { 482 videos: {
482 ofUsers: { 483 ofUsers: {
@@ -484,7 +485,7 @@ describe('Test moderation notifications', function () {
484 } 485 }
485 } 486 }
486 } 487 }
487 }) 488 }
488 489
489 // enable transcoding otherwise own publish notification after transcoding not expected 490 // enable transcoding otherwise own publish notification after transcoding not expected
490 autoBlacklistTestsCustomConfig.transcoding.enabled = true 491 autoBlacklistTestsCustomConfig.transcoding.enabled = true