aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/utils
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/utils
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/utils')
-rw-r--r--server/tests/utils/pods.ts16
1 files changed, 15 insertions, 1 deletions
diff --git a/server/tests/utils/pods.ts b/server/tests/utils/pods.ts
index a86dd20d9..52e807e70 100644
--- a/server/tests/utils/pods.ts
+++ b/server/tests/utils/pods.ts
@@ -12,6 +12,19 @@ function getFriendsList (url: string) {
12 .expect('Content-Type', /json/) 12 .expect('Content-Type', /json/)
13} 13}
14 14
15function getPodsListPaginationAndSort (url: string, start: number, count: number, sort: string) {
16 const path = '/api/v1/pods/'
17
18 return request(url)
19 .get(path)
20 .query({ start })
21 .query({ count })
22 .query({ sort })
23 .set('Accept', 'application/json')
24 .expect(200)
25 .expect('Content-Type', /json/)
26}
27
15async function makeFriends (url: string, accessToken: string, expectedStatus = 204) { 28async function makeFriends (url: string, accessToken: string, expectedStatus = 204) {
16 // Which pod makes friends with which pod 29 // Which pod makes friends with which pod
17 const friendsMatrix = { 30 const friendsMatrix = {
@@ -85,5 +98,6 @@ export {
85 getFriendsList, 98 getFriendsList,
86 makeFriends, 99 makeFriends,
87 quitFriends, 100 quitFriends,
88 quitOneFriend 101 quitOneFriend,
102 getPodsListPaginationAndSort
89} 103}