From bae616273d455d225d131eb17c56db6c20a0b6b3 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 5 May 2022 10:29:35 +0200 Subject: Convert followers/following in raw SQL queries Prevent weird bug in SQL generation --- server/tests/api/redundancy/manage-redundancy.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'server/tests/api/redundancy') diff --git a/server/tests/api/redundancy/manage-redundancy.ts b/server/tests/api/redundancy/manage-redundancy.ts index cbf3106bd..d415ac3bf 100644 --- a/server/tests/api/redundancy/manage-redundancy.ts +++ b/server/tests/api/redundancy/manage-redundancy.ts @@ -69,6 +69,7 @@ describe('Test manage videos redundancy', function () { // Server 1 and server 2 follow each other await doubleFollow(servers[0], servers[1]) + await doubleFollow(servers[0], servers[2]) await commands[0].updateRedundancy({ host: servers[1].host, redundancyAllowed: true }) await waitJobs(servers) @@ -83,6 +84,16 @@ describe('Test manage videos redundancy', function () { } }) + it('Should correctly list followings by redundancy', async function () { + const body = await servers[0].follows.getFollowings({ sort: '-redundancyAllowed' }) + + expect(body.total).to.equal(2) + expect(body.data).to.have.lengthOf(2) + + expect(body.data[0].following.host).to.equal(servers[1].host) + expect(body.data[1].following.host).to.equal(servers[2].host) + }) + it('Should not have "remote-videos" redundancies on server 2', async function () { this.timeout(120000) -- cgit v1.2.3