diff options
author | Chocobozzz <me@florianbigard.com> | 2022-06-17 16:06:58 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-06-17 16:06:58 +0200 |
commit | d3976db269a0e5a3256867a7fc614d3c54c58720 (patch) | |
tree | c6cccee493ff773ef18195fba12c6843349f8b80 /server/tests | |
parent | ba73bedda6ad72b0accd51e594b1b3e193d50e87 (diff) | |
download | PeerTube-d3976db269a0e5a3256867a7fc614d3c54c58720.tar.gz PeerTube-d3976db269a0e5a3256867a7fc614d3c54c58720.tar.zst PeerTube-d3976db269a0e5a3256867a7fc614d3c54c58720.zip |
Fix searching in blocklist
Diffstat (limited to 'server/tests')
-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' |