From 6c5065a011b099618681a37bd77eaa7bd3db752e Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 13 Jul 2021 09:43:59 +0200 Subject: Introduce server commands --- server/tests/api/notifications/moderation-notifications.ts | 13 +++++++------ server/tests/api/notifications/notifications-api.ts | 11 +++++------ 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'server/tests/api/notifications') 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 { createUser, generateUserAccessToken, getVideoIdFromUUID, - immutableAssign, MockInstancesIndex, MockSmtpServer, prepareNotificationsTest, @@ -347,7 +346,7 @@ describe('Test moderation notifications', function () { await checkUserRegistered(baseParams, 'user_45', 'presence') const userOverride = { socketNotifications: userNotifications, token: userAccessToken, check: { web: true, mail: false } } - await checkUserRegistered(immutableAssign(baseParams, userOverride), 'user_45', 'absence') + await checkUserRegistered({ ...baseParams, ...userOverride }, 'user_45', 'absence') }) }) @@ -389,7 +388,7 @@ describe('Test moderation notifications', function () { await checkNewInstanceFollower(baseParams, 'localhost:' + servers[2].port, 'presence') const userOverride = { socketNotifications: userNotifications, token: userAccessToken, check: { web: true, mail: false } } - await checkNewInstanceFollower(immutableAssign(baseParams, userOverride), 'localhost:' + servers[2].port, 'absence') + await checkNewInstanceFollower({ ...baseParams, ...userOverride }, 'localhost:' + servers[2].port, 'absence') }) it('Should send a notification on auto follow back', async function () { @@ -416,7 +415,7 @@ describe('Test moderation notifications', function () { await checkAutoInstanceFollowing(baseParams, followerHost, followingHost, 'presence') const userOverride = { socketNotifications: userNotifications, token: userAccessToken, check: { web: true, mail: false } } - await checkAutoInstanceFollowing(immutableAssign(baseParams, userOverride), followerHost, followingHost, 'absence') + await checkAutoInstanceFollowing({ ...baseParams, ...userOverride }, followerHost, followingHost, 'absence') config.followings.instance.autoFollowBack.enabled = false await servers[0].configCommand.updateCustomSubConfig({ newConfig: config }) @@ -476,7 +475,9 @@ describe('Test moderation notifications', function () { currentCustomConfig = await servers[0].configCommand.getCustomConfig() - const autoBlacklistTestsCustomConfig = immutableAssign(currentCustomConfig, { + const autoBlacklistTestsCustomConfig = { + ...currentCustomConfig, + autoBlacklist: { videos: { ofUsers: { @@ -484,7 +485,7 @@ describe('Test moderation notifications', function () { } } } - }) + } // enable transcoding otherwise own publish notification after transcoding not expected autoBlacklistTestsCustomConfig.transcoding.enabled = true diff --git a/server/tests/api/notifications/notifications-api.ts b/server/tests/api/notifications/notifications-api.ts index 447492c5f..e5864f1c2 100644 --- a/server/tests/api/notifications/notifications-api.ts +++ b/server/tests/api/notifications/notifications-api.ts @@ -8,7 +8,6 @@ import { cleanupTests, getAllNotificationsSettings, getMyUserInformation, - immutableAssign, MockSmtpServer, prepareNotificationsTest, ServerInfo, @@ -118,7 +117,7 @@ describe('Test notifications API', function () { const { name, uuid } = await uploadRandomVideo(server) const check = { web: true, mail: true } - await checkNewVideoFromSubscription(immutableAssign(baseParams, { check }), name, uuid, 'absence') + await checkNewVideoFromSubscription({ ...baseParams, ...check }, name, uuid, 'absence') }) it('Should only have web notifications', async function () { @@ -139,12 +138,12 @@ describe('Test notifications API', function () { { const check = { mail: true, web: false } - await checkNewVideoFromSubscription(immutableAssign(baseParams, { check }), name, uuid, 'absence') + await checkNewVideoFromSubscription({ ...baseParams, ...check }, name, uuid, 'absence') } { const check = { mail: false, web: true } - await checkNewVideoFromSubscription(immutableAssign(baseParams, { check }), name, uuid, 'presence') + await checkNewVideoFromSubscription({ ...baseParams, ...check }, name, uuid, 'presence') } }) @@ -166,12 +165,12 @@ describe('Test notifications API', function () { { const check = { mail: false, web: true } - await checkNewVideoFromSubscription(immutableAssign(baseParams, { check }), name, uuid, 'absence') + await checkNewVideoFromSubscription({ ...baseParams, ...check }, name, uuid, 'absence') } { const check = { mail: true, web: false } - await checkNewVideoFromSubscription(immutableAssign(baseParams, { check }), name, uuid, 'presence') + await checkNewVideoFromSubscription({ ...baseParams, ...check }, name, uuid, 'presence') } }) -- cgit v1.2.3