aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/utils
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-08-16 22:31:45 +0200
committerChocobozzz <florian.bigard@gmail.com>2016-08-16 22:31:45 +0200
commit5c39adb7313e0696aabb4b71196ab7b0b378c359 (patch)
treeac44b67890509338b984f8cbf11660dc77cdd0fd /server/tests/utils
parent089ff2f2046fdbaf9531726eea1f8c6726ebf0c0 (diff)
downloadPeerTube-5c39adb7313e0696aabb4b71196ab7b0b378c359.tar.gz
PeerTube-5c39adb7313e0696aabb4b71196ab7b0b378c359.tar.zst
PeerTube-5c39adb7313e0696aabb4b71196ab7b0b378c359.zip
Server: add user list sort/pagination
Diffstat (limited to 'server/tests/utils')
-rw-r--r--server/tests/utils/users.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/server/tests/utils/users.js b/server/tests/utils/users.js
index 3b560e409..0cf4e4adb 100644
--- a/server/tests/utils/users.js
+++ b/server/tests/utils/users.js
@@ -6,6 +6,7 @@ const usersUtils = {
6 createUser: createUser, 6 createUser: createUser,
7 getUserInformation: getUserInformation, 7 getUserInformation: getUserInformation,
8 getUsersList: getUsersList, 8 getUsersList: getUsersList,
9 getUsersListPaginationAndSort: getUsersListPaginationAndSort,
9 removeUser: removeUser, 10 removeUser: removeUser,
10 updateUser: updateUser 11 updateUser: updateUser
11} 12}
@@ -52,6 +53,20 @@ function getUsersList (url, end) {
52 .end(end) 53 .end(end)
53} 54}
54 55
56function getUsersListPaginationAndSort (url, start, count, sort, end) {
57 const path = '/api/v1/users'
58
59 request(url)
60 .get(path)
61 .query({ start: start })
62 .query({ count: count })
63 .query({ sort: sort })
64 .set('Accept', 'application/json')
65 .expect(200)
66 .expect('Content-Type', /json/)
67 .end(end)
68}
69
55function removeUser (url, userId, accessToken, expectedStatus, end) { 70function removeUser (url, userId, accessToken, expectedStatus, end) {
56 if (!end) { 71 if (!end) {
57 end = expectedStatus 72 end = expectedStatus