diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-10-19 09:43:01 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-10-19 09:43:01 +0200 |
commit | 8a02bd0433b7101c5ea36e87a4edb63204d2adec (patch) | |
tree | d7ab4b6164aef752c216bd2f22f8b3b270a724b8 /server/tests/api/friends-basic.ts | |
parent | 9fd540562c356cb54b98861d2d9e7d4fbfcd00e0 (diff) | |
download | PeerTube-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.ts | 19 |
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 | ||
21 | describe('Test basic friends', function () { | 22 | describe('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 | ||