diff options
author | Chocobozzz <me@florianbigard.com> | 2021-07-13 14:23:01 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-07-20 15:27:18 +0200 |
commit | 7926c5f9b3ffcabb1ffb0dcfa5e48b8e0b88fbc0 (patch) | |
tree | 7a166515e4d57a06eb3c08be569f106ed049988b /shared/extra-utils/users/notifications.ts | |
parent | d0a0fa429d4651710ed951a3c11af0219e408964 (diff) | |
download | PeerTube-7926c5f9b3ffcabb1ffb0dcfa5e48b8e0b88fbc0.tar.gz PeerTube-7926c5f9b3ffcabb1ffb0dcfa5e48b8e0b88fbc0.tar.zst PeerTube-7926c5f9b3ffcabb1ffb0dcfa5e48b8e0b88fbc0.zip |
Introduce user command
Diffstat (limited to 'shared/extra-utils/users/notifications.ts')
-rw-r--r-- | shared/extra-utils/users/notifications.ts | 18 |
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' | |||
8 | import { doubleFollow } from '../server/follows' | 8 | import { doubleFollow } from '../server/follows' |
9 | import { flushAndRunMultipleServers, ServerInfo } from '../server/servers' | 9 | import { flushAndRunMultipleServers, ServerInfo } from '../server/servers' |
10 | import { setAccessTokensToServers } from './login' | 10 | import { setAccessTokensToServers } from './login' |
11 | import { createUser, getMyUserInformation } from './users' | ||
12 | 11 | ||
13 | function getAllNotificationsSettings (): UserNotificationSetting { | 12 | function 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, |