aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils/users
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-16 09:47:51 +0200
committerChocobozzz <me@florianbigard.com>2021-07-20 15:27:18 +0200
commit254d3579f5338f5fd775c17d15cdfc37078bcfb4 (patch)
treeeaeb13fda16c16e98cd6991d202b0ca6a4cbdb63 /shared/extra-utils/users
parent89d241a79c262b9775c233b73cff080043ebb5e6 (diff)
downloadPeerTube-254d3579f5338f5fd775c17d15cdfc37078bcfb4.tar.gz
PeerTube-254d3579f5338f5fd775c17d15cdfc37078bcfb4.tar.zst
PeerTube-254d3579f5338f5fd775c17d15cdfc37078bcfb4.zip
Use an object to represent a server
Diffstat (limited to 'shared/extra-utils/users')
-rw-r--r--shared/extra-utils/users/accounts.ts4
-rw-r--r--shared/extra-utils/users/login.ts4
-rw-r--r--shared/extra-utils/users/notifications.ts7
3 files changed, 8 insertions, 7 deletions
diff --git a/shared/extra-utils/users/accounts.ts b/shared/extra-utils/users/accounts.ts
index 2c9a4b71c..9fc1bcfc4 100644
--- a/shared/extra-utils/users/accounts.ts
+++ b/shared/extra-utils/users/accounts.ts
@@ -4,10 +4,10 @@ import { expect } from 'chai'
4import { pathExists, readdir } from 'fs-extra' 4import { pathExists, readdir } from 'fs-extra'
5import { join } from 'path' 5import { join } from 'path'
6import { root } from '@server/helpers/core-utils' 6import { root } from '@server/helpers/core-utils'
7import { ServerInfo } from '../server' 7import { PeerTubeServer } from '../server'
8 8
9async function expectAccountFollows (options: { 9async function expectAccountFollows (options: {
10 server: ServerInfo 10 server: PeerTubeServer
11 handle: string 11 handle: string
12 followers: number 12 followers: number
13 following: number 13 following: number
diff --git a/shared/extra-utils/users/login.ts b/shared/extra-utils/users/login.ts
index d0c26a4f0..f1df027d3 100644
--- a/shared/extra-utils/users/login.ts
+++ b/shared/extra-utils/users/login.ts
@@ -1,6 +1,6 @@
1import { ServerInfo } from '../server/servers' 1import { PeerTubeServer } from '../server/server'
2 2
3function setAccessTokensToServers (servers: ServerInfo[]) { 3function setAccessTokensToServers (servers: PeerTubeServer[]) {
4 const tasks: Promise<any>[] = [] 4 const tasks: Promise<any>[] = []
5 5
6 for (const server of servers) { 6 for (const server of servers) {
diff --git a/shared/extra-utils/users/notifications.ts b/shared/extra-utils/users/notifications.ts
index 9196f0bf5..4c42fad3e 100644
--- a/shared/extra-utils/users/notifications.ts
+++ b/shared/extra-utils/users/notifications.ts
@@ -5,8 +5,9 @@ import { inspect } from 'util'
5import { AbuseState, PluginType } from '@shared/models' 5import { AbuseState, PluginType } from '@shared/models'
6import { UserNotification, UserNotificationSetting, UserNotificationSettingValue, UserNotificationType } from '../../models/users' 6import { UserNotification, UserNotificationSetting, UserNotificationSettingValue, UserNotificationType } from '../../models/users'
7import { MockSmtpServer } from '../mock-servers/mock-email' 7import { MockSmtpServer } from '../mock-servers/mock-email'
8import { PeerTubeServer } from '../server'
8import { doubleFollow } from '../server/follows' 9import { doubleFollow } from '../server/follows'
9import { flushAndRunMultipleServers, ServerInfo } from '../server/servers' 10import { createMultipleServers } from '../server/servers'
10import { setAccessTokensToServers } from './login' 11import { setAccessTokensToServers } from './login'
11 12
12function getAllNotificationsSettings (): UserNotificationSetting { 13function getAllNotificationsSettings (): UserNotificationSetting {
@@ -31,7 +32,7 @@ function getAllNotificationsSettings (): UserNotificationSetting {
31} 32}
32 33
33type CheckerBaseParams = { 34type CheckerBaseParams = {
34 server: ServerInfo 35 server: PeerTubeServer
35 emails: any[] 36 emails: any[]
36 socketNotifications: UserNotification[] 37 socketNotifications: UserNotification[]
37 token: string 38 token: string
@@ -642,7 +643,7 @@ async function prepareNotificationsTest (serversCount = 3, overrideConfigArg: an
642 limit: 20 643 limit: 20
643 } 644 }
644 } 645 }
645 const servers = await flushAndRunMultipleServers(serversCount, Object.assign(overrideConfig, overrideConfigArg)) 646 const servers = await createMultipleServers(serversCount, Object.assign(overrideConfig, overrideConfigArg))
646 647
647 await setAccessTokensToServers(servers) 648 await setAccessTokensToServers(servers)
648 649