aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils/users/notifications.ts
diff options
context:
space:
mode:
Diffstat (limited to 'shared/extra-utils/users/notifications.ts')
-rw-r--r--shared/extra-utils/users/notifications.ts18
1 files changed, 4 insertions, 14 deletions
diff --git a/shared/extra-utils/users/notifications.ts b/shared/extra-utils/users/notifications.ts
index 79cb6f617..0af7d8a18 100644
--- a/shared/extra-utils/users/notifications.ts
+++ b/shared/extra-utils/users/notifications.ts
@@ -8,7 +8,6 @@ import { MockSmtpServer } from '../mock-servers/mock-email'
8import { doubleFollow } from '../server/follows' 8import { doubleFollow } from '../server/follows'
9import { flushAndRunMultipleServers, ServerInfo } from '../server/servers' 9import { flushAndRunMultipleServers, ServerInfo } from '../server/servers'
10import { setAccessTokensToServers } from './login' 10import { setAccessTokensToServers } from './login'
11import { createUser, getMyUserInformation } from './users'
12 11
13function getAllNotificationsSettings (): UserNotificationSetting { 12function getAllNotificationsSettings (): UserNotificationSetting {
14 return { 13 return {
@@ -651,17 +650,8 @@ async function prepareNotificationsTest (serversCount = 3, overrideConfigArg: an
651 await doubleFollow(servers[0], servers[1]) 650 await doubleFollow(servers[0], servers[1])
652 } 651 }
653 652
654 const user = { 653 const user = { username: 'user_1', password: 'super password' }
655 username: 'user_1', 654 await servers[0].usersCommand.create({ ...user, videoQuota: 10 * 1000 * 1000 })
656 password: 'super password'
657 }
658 await createUser({
659 url: servers[0].url,
660 accessToken: servers[0].accessToken,
661 username: user.username,
662 password: user.password,
663 videoQuota: 10 * 1000 * 1000
664 })
665 const userAccessToken = await servers[0].loginCommand.getAccessToken(user) 655 const userAccessToken = await servers[0].loginCommand.getAccessToken(user)
666 656
667 await servers[0].notificationsCommand.updateMySettings({ token: userAccessToken, settings: getAllNotificationsSettings() }) 657 await servers[0].notificationsCommand.updateMySettings({ token: userAccessToken, settings: getAllNotificationsSettings() })
@@ -685,8 +675,8 @@ async function prepareNotificationsTest (serversCount = 3, overrideConfigArg: an
685 socket.on('new-notification', n => adminNotificationsServer2.push(n)) 675 socket.on('new-notification', n => adminNotificationsServer2.push(n))
686 } 676 }
687 677
688 const resChannel = await getMyUserInformation(servers[0].url, servers[0].accessToken) 678 const { videoChannels } = await servers[0].usersCommand.getMyInfo()
689 const channelId = resChannel.body.videoChannels[0].id 679 const channelId = videoChannels[0].id
690 680
691 return { 681 return {
692 userNotifications, 682 userNotifications,