aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/moderation/abuses.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-07 13:38:26 +0200
committerChocobozzz <me@florianbigard.com>2021-07-20 15:27:17 +0200
commit9fff08cf83f34339df7ed4ac770e1dee536adf9d (patch)
tree36eac5147a12ae257a3e8aaeffae37c9aed23d0a /server/tests/api/moderation/abuses.ts
parent87e2635a50ac2decb1c330e55c2ff7b6d07a85de (diff)
downloadPeerTube-9fff08cf83f34339df7ed4ac770e1dee536adf9d.tar.gz
PeerTube-9fff08cf83f34339df7ed4ac770e1dee536adf9d.tar.zst
PeerTube-9fff08cf83f34339df7ed4ac770e1dee536adf9d.zip
Introduce accounts command
Diffstat (limited to 'server/tests/api/moderation/abuses.ts')
-rw-r--r--server/tests/api/moderation/abuses.ts13
1 files changed, 5 insertions, 8 deletions
diff --git a/server/tests/api/moderation/abuses.ts b/server/tests/api/moderation/abuses.ts
index a9f5332ce..124833cf6 100644
--- a/server/tests/api/moderation/abuses.ts
+++ b/server/tests/api/moderation/abuses.ts
@@ -13,7 +13,6 @@ import {
13 doubleFollow, 13 doubleFollow,
14 flushAndRunMultipleServers, 14 flushAndRunMultipleServers,
15 generateUserAccessToken, 15 generateUserAccessToken,
16 getAccount,
17 getVideoCommentThreads, 16 getVideoCommentThreads,
18 getVideoIdFromUUID, 17 getVideoIdFromUUID,
19 getVideosList, 18 getVideosList,
@@ -606,10 +605,8 @@ describe('Test abuses', function () {
606 605
607 describe('Account abuses', function () { 606 describe('Account abuses', function () {
608 607
609 async function getAccountFromServer (url: string, name: string, server: ServerInfo) { 608 function getAccountFromServer (server: ServerInfo, targetName: string, targetServer: ServerInfo) {
610 const res = await getAccount(url, name + '@' + server.host) 609 return server.accountsCommand.get({ accountName: targetName + '@' + targetServer.host })
611
612 return res.body as Account
613 } 610 }
614 611
615 before(async function () { 612 before(async function () {
@@ -626,7 +623,7 @@ describe('Test abuses', function () {
626 it('Should report abuse on an account', async function () { 623 it('Should report abuse on an account', async function () {
627 this.timeout(15000) 624 this.timeout(15000)
628 625
629 const account = await getAccountFromServer(servers[0].url, 'user_1', servers[0]) 626 const account = await getAccountFromServer(servers[0], 'user_1', servers[0])
630 627
631 const reason = 'it is a bad account' 628 const reason = 'it is a bad account'
632 await commands[0].report({ accountId: account.id, reason }) 629 await commands[0].report({ accountId: account.id, reason })
@@ -664,7 +661,7 @@ describe('Test abuses', function () {
664 it('Should report abuse on a remote account', async function () { 661 it('Should report abuse on a remote account', async function () {
665 this.timeout(10000) 662 this.timeout(10000)
666 663
667 const account = await getAccountFromServer(servers[0].url, 'user_2', servers[1]) 664 const account = await getAccountFromServer(servers[0], 'user_2', servers[1])
668 665
669 const reason = 'it is a really bad account' 666 const reason = 'it is a really bad account'
670 await commands[0].report({ accountId: account.id, reason }) 667 await commands[0].report({ accountId: account.id, reason })
@@ -718,7 +715,7 @@ describe('Test abuses', function () {
718 it('Should keep the account abuse when deleting the account', async function () { 715 it('Should keep the account abuse when deleting the account', async function () {
719 this.timeout(10000) 716 this.timeout(10000)
720 717
721 const account = await getAccountFromServer(servers[1].url, 'user_2', servers[1]) 718 const account = await getAccountFromServer(servers[1], 'user_2', servers[1])
722 await removeUser(servers[1].url, account.userId, servers[1].accessToken) 719 await removeUser(servers[1].url, account.userId, servers[1].accessToken)
723 720
724 await waitJobs(servers) 721 await waitJobs(servers)