X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=shared%2Fextra-utils%2Fusers%2Fuser-notifications.ts;h=961cfcc0f5d0514d1df863c786d7a01f4c31dc50;hb=9fff08cf83f34339df7ed4ac770e1dee536adf9d;hp=249e82925c0c7a241c17af2c99fa79e697f67dda;hpb=32a18cbf33a7cdbbe3d4885d32e4b67e19cdc1cf;p=github%2FChocobozzz%2FPeerTube.git diff --git a/shared/extra-utils/users/user-notifications.ts b/shared/extra-utils/users/user-notifications.ts index 249e82925..961cfcc0f 100644 --- a/shared/extra-utils/users/user-notifications.ts +++ b/shared/extra-utils/users/user-notifications.ts @@ -5,11 +5,10 @@ import { inspect } from 'util' import { AbuseState, PluginType } from '@shared/models' import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes' import { UserNotification, UserNotificationSetting, UserNotificationSettingValue, UserNotificationType } from '../../models/users' -import { MockSmtpServer } from '../miscs/email' +import { MockSmtpServer } from '../mock-servers/mock-email' import { makeGetRequest, makePostBodyRequest, makePutBodyRequest } from '../requests/requests' import { doubleFollow } from '../server/follows' import { flushAndRunMultipleServers, ServerInfo } from '../server/servers' -import { getUserNotificationSocket } from '../socket/socket-io' import { setAccessTokensToServers, userLogin } from './login' import { createUser, getMyUserInformation } from './users' @@ -431,7 +430,7 @@ async function checkNewCommentOnMyVideo (base: CheckerBaseParams, uuid: string, } } - const commentUrl = `http://localhost:${base.server.port}/videos/watch/${uuid};threadId=${threadId}` + const commentUrl = `http://localhost:${base.server.port}/w/${uuid};threadId=${threadId}` function emailNotificationFinder (email: object) { return email['text'].indexOf(commentUrl) !== -1 @@ -748,16 +747,16 @@ async function prepareNotificationsTest (serversCount = 3, overrideConfigArg: an } { - const socket = getUserNotificationSocket(servers[0].url, userAccessToken) + const socket = servers[0].socketIOCommand.getUserNotificationSocket({ token: userAccessToken }) socket.on('new-notification', n => userNotifications.push(n)) } { - const socket = getUserNotificationSocket(servers[0].url, servers[0].accessToken) + const socket = servers[0].socketIOCommand.getUserNotificationSocket() socket.on('new-notification', n => adminNotifications.push(n)) } if (serversCount > 1) { - const socket = getUserNotificationSocket(servers[1].url, servers[1].accessToken) + const socket = servers[1].socketIOCommand.getUserNotificationSocket() socket.on('new-notification', n => adminNotificationsServer2.push(n)) }