aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-06-20 10:23:19 +0200
committerChocobozzz <me@florianbigard.com>2022-06-20 10:23:19 +0200
commit714e33a7428b71ef98129ce85a4bd64140bcd912 (patch)
tree59bd3e4b359bcd04f4ad97c404246688ccd84e68 /server/tests/api
parentaa2ce188d102ab38452df316d06286040b5d9075 (diff)
parentd47b18079bfe4aed472ddcc0a89302ba85f03a48 (diff)
downloadPeerTube-714e33a7428b71ef98129ce85a4bd64140bcd912.tar.gz
PeerTube-714e33a7428b71ef98129ce85a4bd64140bcd912.tar.zst
PeerTube-714e33a7428b71ef98129ce85a4bd64140bcd912.zip
Merge branch 'release/4.2.0' into develop
Diffstat (limited to 'server/tests/api')
-rw-r--r--server/tests/api/moderation/blocklist.ts28
-rw-r--r--server/tests/api/server/stats.ts4
2 files changed, 32 insertions, 0 deletions
diff --git a/server/tests/api/moderation/blocklist.ts b/server/tests/api/moderation/blocklist.ts
index e1344a245..a5a92317d 100644
--- a/server/tests/api/moderation/blocklist.ts
+++ b/server/tests/api/moderation/blocklist.ts
@@ -256,6 +256,13 @@ describe('Test blocklist', function () {
256 } 256 }
257 }) 257 })
258 258
259 it('Should search blocked accounts', async function () {
260 const body = await command.listMyAccountBlocklist({ start: 0, count: 10, search: 'user2' })
261 expect(body.total).to.equal(1)
262
263 expect(body.data[0].blockedAccount.name).to.equal('user2')
264 })
265
259 it('Should get blocked status', async function () { 266 it('Should get blocked status', async function () {
260 const remoteHandle = 'user2@' + servers[1].host 267 const remoteHandle = 'user2@' + servers[1].host
261 const localHandle = 'user1@' + servers[0].host 268 const localHandle = 'user1@' + servers[0].host
@@ -475,6 +482,13 @@ describe('Test blocklist', function () {
475 expect(block.blockedServer.host).to.equal('localhost:' + servers[1].port) 482 expect(block.blockedServer.host).to.equal('localhost:' + servers[1].port)
476 }) 483 })
477 484
485 it('Should search blocked servers', async function () {
486 const body = await command.listMyServerBlocklist({ start: 0, count: 10, search: servers[1].host })
487 expect(body.total).to.equal(1)
488
489 expect(body.data[0].blockedServer.host).to.equal(servers[1].host)
490 })
491
478 it('Should get blocklist status', async function () { 492 it('Should get blocklist status', async function () {
479 const blockedServer = servers[1].host 493 const blockedServer = servers[1].host
480 const notBlockedServer = 'example.com' 494 const notBlockedServer = 'example.com'
@@ -645,6 +659,13 @@ describe('Test blocklist', function () {
645 } 659 }
646 }) 660 })
647 661
662 it('Should search blocked accounts', async function () {
663 const body = await command.listServerAccountBlocklist({ start: 0, count: 10, search: 'user2' })
664 expect(body.total).to.equal(1)
665
666 expect(body.data[0].blockedAccount.name).to.equal('user2')
667 })
668
648 it('Should get blocked status', async function () { 669 it('Should get blocked status', async function () {
649 const remoteHandle = 'user2@' + servers[1].host 670 const remoteHandle = 'user2@' + servers[1].host
650 const localHandle = 'user1@' + servers[0].host 671 const localHandle = 'user1@' + servers[0].host
@@ -805,6 +826,13 @@ describe('Test blocklist', function () {
805 expect(block.blockedServer.host).to.equal('localhost:' + servers[1].port) 826 expect(block.blockedServer.host).to.equal('localhost:' + servers[1].port)
806 }) 827 })
807 828
829 it('Should search blocked servers', async function () {
830 const body = await command.listServerServerBlocklist({ start: 0, count: 10, search: servers[1].host })
831 expect(body.total).to.equal(1)
832
833 expect(body.data[0].blockedServer.host).to.equal(servers[1].host)
834 })
835
808 it('Should get blocklist status', async function () { 836 it('Should get blocklist status', async function () {
809 const blockedServer = servers[1].host 837 const blockedServer = servers[1].host
810 const notBlockedServer = 'example.com' 838 const notBlockedServer = 'example.com'
diff --git a/server/tests/api/server/stats.ts b/server/tests/api/server/stats.ts
index a9ae236fb..6654eaaee 100644
--- a/server/tests/api/server/stats.ts
+++ b/server/tests/api/server/stats.ts
@@ -10,6 +10,8 @@ import {
10 doubleFollow, 10 doubleFollow,
11 PeerTubeServer, 11 PeerTubeServer,
12 setAccessTokensToServers, 12 setAccessTokensToServers,
13 setDefaultAccountAvatar,
14 setDefaultChannelAvatar,
13 waitJobs 15 waitJobs
14} from '@shared/server-commands' 16} from '@shared/server-commands'
15 17
@@ -29,6 +31,8 @@ describe('Test stats (excluding redundancy)', function () {
29 servers = await createMultipleServers(3) 31 servers = await createMultipleServers(3)
30 32
31 await setAccessTokensToServers(servers) 33 await setAccessTokensToServers(servers)
34 await setDefaultChannelAvatar(servers)
35 await setDefaultAccountAvatar(servers)
32 36
33 await doubleFollow(servers[0], servers[1]) 37 await doubleFollow(servers[0], servers[1])
34 38