aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/notifications
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-07 16:02:46 +0200
committerChocobozzz <me@florianbigard.com>2021-07-20 15:27:17 +0200
commit5f8bd4cbb178290da7d8f81e996f19f0eccc8e4c (patch)
tree02d056121540652b0867fc2ef56699138afe6271 /server/tests/api/notifications
parent9fff08cf83f34339df7ed4ac770e1dee536adf9d (diff)
downloadPeerTube-5f8bd4cbb178290da7d8f81e996f19f0eccc8e4c.tar.gz
PeerTube-5f8bd4cbb178290da7d8f81e996f19f0eccc8e4c.tar.zst
PeerTube-5f8bd4cbb178290da7d8f81e996f19f0eccc8e4c.zip
Introduce blocklist command
Diffstat (limited to 'server/tests/api/notifications')
-rw-r--r--server/tests/api/notifications/comments-notifications.ts10
1 files changed, 4 insertions, 6 deletions
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 @@
3import 'mocha' 3import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { 5import {
6 addAccountToAccountBlocklist,
7 addVideoCommentReply, 6 addVideoCommentReply,
8 addVideoCommentThread, 7 addVideoCommentThread,
9 checkCommentMention, 8 checkCommentMention,
@@ -14,7 +13,6 @@ import {
14 getVideoThreadComments, 13 getVideoThreadComments,
15 MockSmtpServer, 14 MockSmtpServer,
16 prepareNotificationsTest, 15 prepareNotificationsTest,
17 removeAccountFromAccountBlocklist,
18 ServerInfo, 16 ServerInfo,
19 updateMyUser, 17 updateMyUser,
20 uploadVideo, 18 uploadVideo,
@@ -86,7 +84,7 @@ describe('Test comments notifications', function () {
86 it('Should not send a new comment notification if the account is muted', async function () { 84 it('Should not send a new comment notification if the account is muted', async function () {
87 this.timeout(20000) 85 this.timeout(20000)
88 86
89 await addAccountToAccountBlocklist(servers[0].url, userAccessToken, 'root') 87 await servers[0].blocklistCommand.addToMyBlocklist({ token: userAccessToken, account: 'root' })
90 88
91 const resVideo = await uploadVideo(servers[0].url, userAccessToken, { name: 'super video' }) 89 const resVideo = await uploadVideo(servers[0].url, userAccessToken, { name: 'super video' })
92 const uuid = resVideo.body.video.uuid 90 const uuid = resVideo.body.video.uuid
@@ -97,7 +95,7 @@ describe('Test comments notifications', function () {
97 await waitJobs(servers) 95 await waitJobs(servers)
98 await checkNewCommentOnMyVideo(baseParams, uuid, commentId, commentId, 'absence') 96 await checkNewCommentOnMyVideo(baseParams, uuid, commentId, commentId, 'absence')
99 97
100 await removeAccountFromAccountBlocklist(servers[0].url, userAccessToken, 'root') 98 await servers[0].blocklistCommand.removeFromMyBlocklist({ token: userAccessToken, account: 'root' })
101 }) 99 })
102 100
103 it('Should send a new comment notification after a local comment on my video', async function () { 101 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 () {
244 it('Should not send a new mention notification if the account is muted', async function () { 242 it('Should not send a new mention notification if the account is muted', async function () {
245 this.timeout(10000) 243 this.timeout(10000)
246 244
247 await addAccountToAccountBlocklist(servers[0].url, userAccessToken, 'root') 245 await servers[0].blocklistCommand.addToMyBlocklist({ token: userAccessToken, account: 'root' })
248 246
249 const resVideo = await uploadVideo(servers[0].url, servers[0].accessToken, { name: 'super video' }) 247 const resVideo = await uploadVideo(servers[0].url, servers[0].accessToken, { name: 'super video' })
250 const uuid = resVideo.body.video.uuid 248 const uuid = resVideo.body.video.uuid
@@ -255,7 +253,7 @@ describe('Test comments notifications', function () {
255 await waitJobs(servers) 253 await waitJobs(servers)
256 await checkCommentMention(baseParams, uuid, commentId, commentId, 'super root name', 'absence') 254 await checkCommentMention(baseParams, uuid, commentId, commentId, 'super root name', 'absence')
257 255
258 await removeAccountFromAccountBlocklist(servers[0].url, userAccessToken, 'root') 256 await servers[0].blocklistCommand.removeFromMyBlocklist({ token: userAccessToken, account: 'root' })
259 }) 257 })
260 258
261 it('Should not send a new mention notification if the remote account mention a local account', async function () { 259 it('Should not send a new mention notification if the remote account mention a local account', async function () {