import { makeGetRequest, makePostBodyRequest, makePutBodyRequest } from '../requests/requests'
import { UserNotification, UserNotificationSetting, UserNotificationType } from '../../models/users'
import { makeGetRequest, makePostBodyRequest, makePutBodyRequest } from '../requests/requests'
import { UserNotification, UserNotificationSetting, UserNotificationType } from '../../models/users'
function markAsReadAllNotifications (url: string, token: string, statusCodeExpected = 204) {
const path = '/api/v1/users/me/notifications/read-all'
function markAsReadAllNotifications (url: string, token: string, statusCodeExpected = 204) {
const path = '/api/v1/users/me/notifications/read-all'
if (checkType === 'presence') {
const obj = inspect(base.socketNotifications, { depth: 5 })
if (checkType === 'presence') {
const obj = inspect(base.socketNotifications, { depth: 5 })
- await checkNotification(base, notificationChecker, emailFinder, type)
+ await checkNotification(base, notificationChecker, emailNotificationFinder, type)
}
async function checkVideoIsPublished (base: CheckerBaseParams, videoName: string, videoUUID: string, type: CheckerType) {
}
async function checkVideoIsPublished (base: CheckerBaseParams, videoName: string, videoUUID: string, type: CheckerType) {
- await checkNotification(base, notificationChecker, emailFinder, type)
+ await checkNotification(base, notificationChecker, emailNotificationFinder, type)
- await checkNotification(base, notificationChecker, emailFinder, type)
+ await checkNotification(base, notificationChecker, emailNotificationFinder, type)
- await checkNotification(base, notificationChecker, emailFinder, type)
+ await checkNotification(base, notificationChecker, emailNotificationFinder, type)
- await checkNotification(base, notificationChecker, emailFinder, type)
+ await checkNotification(base, notificationChecker, emailNotificationFinder, type)
}
async function checkNewInstanceFollower (base: CheckerBaseParams, followerHost: string, type: CheckerType) {
}
async function checkNewInstanceFollower (base: CheckerBaseParams, followerHost: string, type: CheckerType) {
- await checkNotification(base, notificationChecker, emailFinder, type)
+ await checkNotification(base, notificationChecker, emailNotificationFinder, type)
}
async function checkAutoInstanceFollowing (base: CheckerBaseParams, followerHost: string, followingHost: string, type: CheckerType) {
}
async function checkAutoInstanceFollowing (base: CheckerBaseParams, followerHost: string, followingHost: string, type: CheckerType) {
- await checkNotification(base, notificationChecker, emailFinder, type)
+ await checkNotification(base, notificationChecker, emailNotificationFinder, type)
- await checkNotification(base, notificationChecker, emailFinder, type)
+ await checkNotification(base, notificationChecker, emailNotificationFinder, type)
async function checkNewCommentOnMyVideo (base: CheckerBaseParams, uuid: string, commentId: number, threadId: number, type: CheckerType) {
const notificationType = UserNotificationType.NEW_COMMENT_ON_MY_VIDEO
async function checkNewCommentOnMyVideo (base: CheckerBaseParams, uuid: string, commentId: number, threadId: number, type: CheckerType) {
const notificationType = UserNotificationType.NEW_COMMENT_ON_MY_VIDEO
- await checkNotification(base, notificationChecker, emailFinder, type)
+ await checkNotification(base, notificationChecker, emailNotificationFinder, type)
if (type === 'presence') {
// We cannot detect email duplicates, so check we received another email
if (type === 'presence') {
// We cannot detect email duplicates, so check we received another email
- await checkNotification(base, notificationChecker, emailFinder, type)
+ await checkNotification(base, notificationChecker, emailNotificationFinder, type)
}
async function checkVideoAutoBlacklistForModerators (base: CheckerBaseParams, videoUUID: string, videoName: string, type: CheckerType) {
}
async function checkVideoAutoBlacklistForModerators (base: CheckerBaseParams, videoUUID: string, videoName: string, type: CheckerType) {
function notificationChecker (notification: UserNotification, type: CheckerType) {
if (type === 'presence') {
function notificationChecker (notification: UserNotification, type: CheckerType) {
if (type === 'presence') {
- function emailFinder (email: object) {
- const text = email[ 'text' ]
- return text.indexOf(videoUUID) !== -1 && email[ 'text' ].indexOf('video-auto-blacklist/list') !== -1
+ function emailNotificationFinder (email: object) {
+ const text = email['text']
+ return text.indexOf(videoUUID) !== -1 && email['text'].indexOf('video-auto-blacklist/list') !== -1
- await checkNotification(base, notificationChecker, emailFinder, type)
+ await checkNotification(base, notificationChecker, emailNotificationFinder, type)
function notificationChecker (notification: UserNotification) {
expect(notification).to.not.be.undefined
function notificationChecker (notification: UserNotification) {
expect(notification).to.not.be.undefined
- await checkNotification(base, notificationChecker, emailFinder, 'presence')
+ await checkNotification(base, notificationChecker, emailNotificationFinder, 'presence')