diff options
author | Chocobozzz <me@florianbigard.com> | 2022-06-20 10:23:19 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-06-20 10:23:19 +0200 |
commit | 714e33a7428b71ef98129ce85a4bd64140bcd912 (patch) | |
tree | 59bd3e4b359bcd04f4ad97c404246688ccd84e68 /server/tests/api/moderation | |
parent | aa2ce188d102ab38452df316d06286040b5d9075 (diff) | |
parent | d47b18079bfe4aed472ddcc0a89302ba85f03a48 (diff) | |
download | PeerTube-714e33a7428b71ef98129ce85a4bd64140bcd912.tar.gz PeerTube-714e33a7428b71ef98129ce85a4bd64140bcd912.tar.zst PeerTube-714e33a7428b71ef98129ce85a4bd64140bcd912.zip |
Merge branch 'release/4.2.0' into develop
Diffstat (limited to 'server/tests/api/moderation')
-rw-r--r-- | server/tests/api/moderation/blocklist.ts | 28 |
1 files changed, 28 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' |