X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Ffriends-basic.ts;h=efca4fda23532ae970fbcfc053366a19b9a468d2;hb=8a02bd0433b7101c5ea36e87a4edb63204d2adec;hp=13edf627312da7d75ff396eff470402a6e956be0;hpb=9fd540562c356cb54b98861d2d9e7d4fbfcd00e0;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/friends-basic.ts b/server/tests/api/friends-basic.ts index 13edf6273..efca4fda2 100644 --- a/server/tests/api/friends-basic.ts +++ b/server/tests/api/friends-basic.ts @@ -15,7 +15,8 @@ import { makeFriends, getFriendsList, dateIsValid, - quitOneFriend + quitOneFriend, + getPodsListPaginationAndSort } from '../utils' describe('Test basic friends', function () { @@ -120,6 +121,22 @@ describe('Test basic friends', function () { await makeFriends(server.url, server.accessToken, 409) }) + it('Should list friends correctly', async function () { + const start = 1 + const count = 1 + const sort = '-host' + + const res = await getPodsListPaginationAndSort(servers[0].url, start, count, sort) + expect(res.body.total).to.equal(2) + expect(res.body.data).to.have.lengthOf(1) + + const pod = res.body.data[0] + expect(pod.host).to.equal('localhost:9002') + expect(pod.email).to.equal('admin2@example.com') + expect(pod.score).to.equal(20) + expect(dateIsValid(pod.createdAt)).to.be.true + }) + it('Should quit friends of pod 2', async function () { this.timeout(10000)