aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/friends-basic.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-10-19 09:43:01 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-10-19 09:43:01 +0200
commit8a02bd0433b7101c5ea36e87a4edb63204d2adec (patch)
treed7ab4b6164aef752c216bd2f22f8b3b270a724b8 /server/tests/api/friends-basic.ts
parent9fd540562c356cb54b98861d2d9e7d4fbfcd00e0 (diff)
downloadPeerTube-8a02bd0433b7101c5ea36e87a4edb63204d2adec.tar.gz
PeerTube-8a02bd0433b7101c5ea36e87a4edb63204d2adec.tar.zst
PeerTube-8a02bd0433b7101c5ea36e87a4edb63204d2adec.zip
Add pod list endpoint with pagination, sort...
Diffstat (limited to 'server/tests/api/friends-basic.ts')
-rw-r--r--server/tests/api/friends-basic.ts19
1 files changed, 18 insertions, 1 deletions
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 {
15 makeFriends, 15 makeFriends,
16 getFriendsList, 16 getFriendsList,
17 dateIsValid, 17 dateIsValid,
18 quitOneFriend 18 quitOneFriend,
19 getPodsListPaginationAndSort
19} from '../utils' 20} from '../utils'
20 21
21describe('Test basic friends', function () { 22describe('Test basic friends', function () {
@@ -120,6 +121,22 @@ describe('Test basic friends', function () {
120 await makeFriends(server.url, server.accessToken, 409) 121 await makeFriends(server.url, server.accessToken, 409)
121 }) 122 })
122 123
124 it('Should list friends correctly', async function () {
125 const start = 1
126 const count = 1
127 const sort = '-host'
128
129 const res = await getPodsListPaginationAndSort(servers[0].url, start, count, sort)
130 expect(res.body.total).to.equal(2)
131 expect(res.body.data).to.have.lengthOf(1)
132
133 const pod = res.body.data[0]
134 expect(pod.host).to.equal('localhost:9002')
135 expect(pod.email).to.equal('admin2@example.com')
136 expect(pod.score).to.equal(20)
137 expect(dateIsValid(pod.createdAt)).to.be.true
138 })
139
123 it('Should quit friends of pod 2', async function () { 140 it('Should quit friends of pod 2', async function () {
124 this.timeout(10000) 141 this.timeout(10000)
125 142