From d3976db269a0e5a3256867a7fc614d3c54c58720 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 17 Jun 2022 16:06:58 +0200 Subject: Fix searching in blocklist --- server/tests/api/moderation/blocklist.ts | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'server/tests/api') 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 () { } }) + it('Should search blocked accounts', async function () { + const body = await command.listMyAccountBlocklist({ start: 0, count: 10, search: 'user2' }) + expect(body.total).to.equal(1) + + expect(body.data[0].blockedAccount.name).to.equal('user2') + }) + it('Should get blocked status', async function () { const remoteHandle = 'user2@' + servers[1].host const localHandle = 'user1@' + servers[0].host @@ -475,6 +482,13 @@ describe('Test blocklist', function () { expect(block.blockedServer.host).to.equal('localhost:' + servers[1].port) }) + it('Should search blocked servers', async function () { + const body = await command.listMyServerBlocklist({ start: 0, count: 10, search: servers[1].host }) + expect(body.total).to.equal(1) + + expect(body.data[0].blockedServer.host).to.equal(servers[1].host) + }) + it('Should get blocklist status', async function () { const blockedServer = servers[1].host const notBlockedServer = 'example.com' @@ -645,6 +659,13 @@ describe('Test blocklist', function () { } }) + it('Should search blocked accounts', async function () { + const body = await command.listServerAccountBlocklist({ start: 0, count: 10, search: 'user2' }) + expect(body.total).to.equal(1) + + expect(body.data[0].blockedAccount.name).to.equal('user2') + }) + it('Should get blocked status', async function () { const remoteHandle = 'user2@' + servers[1].host const localHandle = 'user1@' + servers[0].host @@ -805,6 +826,13 @@ describe('Test blocklist', function () { expect(block.blockedServer.host).to.equal('localhost:' + servers[1].port) }) + it('Should search blocked servers', async function () { + const body = await command.listServerServerBlocklist({ start: 0, count: 10, search: servers[1].host }) + expect(body.total).to.equal(1) + + expect(body.data[0].blockedServer.host).to.equal(servers[1].host) + }) + it('Should get blocklist status', async function () { const blockedServer = servers[1].host const notBlockedServer = 'example.com' -- cgit v1.2.3 From 5e0dbb3e52797cdea7a9069a9dd605c8f84034dd Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 17 Jun 2022 16:16:28 +0200 Subject: Fix users stats --- server/tests/api/server/stats.ts | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'server/tests/api') 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 { doubleFollow, PeerTubeServer, setAccessTokensToServers, + setDefaultAccountAvatar, + setDefaultChannelAvatar, waitJobs } from '@shared/server-commands' @@ -29,6 +31,8 @@ describe('Test stats (excluding redundancy)', function () { servers = await createMultipleServers(3) await setAccessTokensToServers(servers) + await setDefaultChannelAvatar(servers) + await setDefaultAccountAvatar(servers) await doubleFollow(servers[0], servers[1]) -- cgit v1.2.3