diff options
author | Chocobozzz <me@florianbigard.com> | 2021-07-07 09:16:40 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-07-20 15:27:17 +0200 |
commit | c3d29f694bf8c910f917be655626d0f80871124f (patch) | |
tree | c90dfdc1245c8a9aca49e9ea9c71ed8e6b9dd35f /server/tests/api/notifications/moderation-notifications.ts | |
parent | 883a9019085ff9013079d6b1539b86f2f519175a (diff) | |
download | PeerTube-c3d29f694bf8c910f917be655626d0f80871124f.tar.gz PeerTube-c3d29f694bf8c910f917be655626d0f80871124f.tar.zst PeerTube-c3d29f694bf8c910f917be655626d0f80871124f.zip |
Introduce follows command
Diffstat (limited to 'server/tests/api/notifications/moderation-notifications.ts')
-rw-r--r-- | server/tests/api/notifications/moderation-notifications.ts | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/server/tests/api/notifications/moderation-notifications.ts b/server/tests/api/notifications/moderation-notifications.ts index c4f63200a..9a93ce401 100644 --- a/server/tests/api/notifications/moderation-notifications.ts +++ b/server/tests/api/notifications/moderation-notifications.ts | |||
@@ -21,7 +21,6 @@ import { | |||
21 | checkVideoIsPublished, | 21 | checkVideoIsPublished, |
22 | cleanupTests, | 22 | cleanupTests, |
23 | createUser, | 23 | createUser, |
24 | follow, | ||
25 | generateUserAccessToken, | 24 | generateUserAccessToken, |
26 | getAccount, | 25 | getAccount, |
27 | getCustomConfig, | 26 | getCustomConfig, |
@@ -35,7 +34,6 @@ import { | |||
35 | removeUserSubscription, | 34 | removeUserSubscription, |
36 | removeVideoFromBlacklist, | 35 | removeVideoFromBlacklist, |
37 | ServerInfo, | 36 | ServerInfo, |
38 | unfollow, | ||
39 | updateCustomConfig, | 37 | updateCustomConfig, |
40 | updateCustomSubConfig, | 38 | updateCustomSubConfig, |
41 | uploadVideo, | 39 | uploadVideo, |
@@ -386,7 +384,7 @@ describe('Test moderation notifications', function () { | |||
386 | it('Should send a notification only to admin when there is a new instance follower', async function () { | 384 | it('Should send a notification only to admin when there is a new instance follower', async function () { |
387 | this.timeout(20000) | 385 | this.timeout(20000) |
388 | 386 | ||
389 | await follow(servers[2].url, [ servers[0].url ], servers[2].accessToken) | 387 | await servers[2].followsCommand.follow({ targets: [ servers[0].url ] }) |
390 | 388 | ||
391 | await waitJobs(servers) | 389 | await waitJobs(servers) |
392 | 390 | ||
@@ -399,7 +397,7 @@ describe('Test moderation notifications', function () { | |||
399 | it('Should send a notification on auto follow back', async function () { | 397 | it('Should send a notification on auto follow back', async function () { |
400 | this.timeout(40000) | 398 | this.timeout(40000) |
401 | 399 | ||
402 | await unfollow(servers[2].url, servers[2].accessToken, servers[0]) | 400 | await servers[2].followsCommand.unfollow({ target: servers[0] }) |
403 | await waitJobs(servers) | 401 | await waitJobs(servers) |
404 | 402 | ||
405 | const config = { | 403 | const config = { |
@@ -411,7 +409,7 @@ describe('Test moderation notifications', function () { | |||
411 | } | 409 | } |
412 | await updateCustomSubConfig(servers[0].url, servers[0].accessToken, config) | 410 | await updateCustomSubConfig(servers[0].url, servers[0].accessToken, config) |
413 | 411 | ||
414 | await follow(servers[2].url, [ servers[0].url ], servers[2].accessToken) | 412 | await servers[2].followsCommand.follow({ targets: [ servers[0].url ] }) |
415 | 413 | ||
416 | await waitJobs(servers) | 414 | await waitJobs(servers) |
417 | 415 | ||
@@ -424,13 +422,13 @@ describe('Test moderation notifications', function () { | |||
424 | 422 | ||
425 | config.followings.instance.autoFollowBack.enabled = false | 423 | config.followings.instance.autoFollowBack.enabled = false |
426 | await updateCustomSubConfig(servers[0].url, servers[0].accessToken, config) | 424 | await updateCustomSubConfig(servers[0].url, servers[0].accessToken, config) |
427 | await unfollow(servers[0].url, servers[0].accessToken, servers[2]) | 425 | await servers[0].followsCommand.unfollow({ target: servers[2] }) |
428 | await unfollow(servers[2].url, servers[2].accessToken, servers[0]) | 426 | await servers[2].followsCommand.unfollow({ target: servers[0] }) |
429 | }) | 427 | }) |
430 | 428 | ||
431 | it('Should send a notification on auto instances index follow', async function () { | 429 | it('Should send a notification on auto instances index follow', async function () { |
432 | this.timeout(30000) | 430 | this.timeout(30000) |
433 | await unfollow(servers[0].url, servers[0].accessToken, servers[1]) | 431 | await servers[0].followsCommand.unfollow({ target: servers[1] }) |
434 | 432 | ||
435 | await updateCustomSubConfig(servers[0].url, servers[0].accessToken, config) | 433 | await updateCustomSubConfig(servers[0].url, servers[0].accessToken, config) |
436 | 434 | ||
@@ -443,7 +441,7 @@ describe('Test moderation notifications', function () { | |||
443 | 441 | ||
444 | config.followings.instance.autoFollowIndex.enabled = false | 442 | config.followings.instance.autoFollowIndex.enabled = false |
445 | await updateCustomSubConfig(servers[0].url, servers[0].accessToken, config) | 443 | await updateCustomSubConfig(servers[0].url, servers[0].accessToken, config) |
446 | await unfollow(servers[0].url, servers[0].accessToken, servers[1]) | 444 | await servers[0].followsCommand.unfollow({ target: servers[1] }) |
447 | }) | 445 | }) |
448 | }) | 446 | }) |
449 | 447 | ||