From 5f8bd4cbb178290da7d8f81e996f19f0eccc8e4c Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 7 Jul 2021 16:02:46 +0200 Subject: Introduce blocklist command --- server/tests/api/notifications/comments-notifications.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'server/tests/api/notifications') diff --git a/server/tests/api/notifications/comments-notifications.ts b/server/tests/api/notifications/comments-notifications.ts index d2badf237..13fcee843 100644 --- a/server/tests/api/notifications/comments-notifications.ts +++ b/server/tests/api/notifications/comments-notifications.ts @@ -3,7 +3,6 @@ import 'mocha' import * as chai from 'chai' import { - addAccountToAccountBlocklist, addVideoCommentReply, addVideoCommentThread, checkCommentMention, @@ -14,7 +13,6 @@ import { getVideoThreadComments, MockSmtpServer, prepareNotificationsTest, - removeAccountFromAccountBlocklist, ServerInfo, updateMyUser, uploadVideo, @@ -86,7 +84,7 @@ describe('Test comments notifications', function () { it('Should not send a new comment notification if the account is muted', async function () { this.timeout(20000) - await addAccountToAccountBlocklist(servers[0].url, userAccessToken, 'root') + await servers[0].blocklistCommand.addToMyBlocklist({ token: userAccessToken, account: 'root' }) const resVideo = await uploadVideo(servers[0].url, userAccessToken, { name: 'super video' }) const uuid = resVideo.body.video.uuid @@ -97,7 +95,7 @@ describe('Test comments notifications', function () { await waitJobs(servers) await checkNewCommentOnMyVideo(baseParams, uuid, commentId, commentId, 'absence') - await removeAccountFromAccountBlocklist(servers[0].url, userAccessToken, 'root') + await servers[0].blocklistCommand.removeFromMyBlocklist({ token: userAccessToken, account: 'root' }) }) it('Should send a new comment notification after a local comment on my video', async function () { @@ -244,7 +242,7 @@ describe('Test comments notifications', function () { it('Should not send a new mention notification if the account is muted', async function () { this.timeout(10000) - await addAccountToAccountBlocklist(servers[0].url, userAccessToken, 'root') + await servers[0].blocklistCommand.addToMyBlocklist({ token: userAccessToken, account: 'root' }) const resVideo = await uploadVideo(servers[0].url, servers[0].accessToken, { name: 'super video' }) const uuid = resVideo.body.video.uuid @@ -255,7 +253,7 @@ describe('Test comments notifications', function () { await waitJobs(servers) await checkCommentMention(baseParams, uuid, commentId, commentId, 'super root name', 'absence') - await removeAccountFromAccountBlocklist(servers[0].url, userAccessToken, 'root') + await servers[0].blocklistCommand.removeFromMyBlocklist({ token: userAccessToken, account: 'root' }) }) it('Should not send a new mention notification if the remote account mention a local account', async function () { -- cgit v1.2.3