From 8a02bd0433b7101c5ea36e87a4edb63204d2adec Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 19 Oct 2017 09:43:01 +0200 Subject: Add pod list endpoint with pagination, sort... --- server/tests/utils/pods.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'server/tests/utils') 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) { .expect('Content-Type', /json/) } +function getPodsListPaginationAndSort (url: string, start: number, count: number, sort: string) { + const path = '/api/v1/pods/' + + return request(url) + .get(path) + .query({ start }) + .query({ count }) + .query({ sort }) + .set('Accept', 'application/json') + .expect(200) + .expect('Content-Type', /json/) +} + async function makeFriends (url: string, accessToken: string, expectedStatus = 204) { // Which pod makes friends with which pod const friendsMatrix = { @@ -85,5 +98,6 @@ export { getFriendsList, makeFriends, quitFriends, - quitOneFriend + quitOneFriend, + getPodsListPaginationAndSort } -- cgit v1.2.3