aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/utils/users.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/utils/users.ts')
-rw-r--r--server/tests/utils/users.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/server/tests/utils/users.ts b/server/tests/utils/users.ts
index 12569dd42..ce04b9d96 100644
--- a/server/tests/utils/users.ts
+++ b/server/tests/utils/users.ts
@@ -76,17 +76,18 @@ function getUserVideoRating (url: string, accessToken: string, videoId: number)
76 .expect('Content-Type', /json/) 76 .expect('Content-Type', /json/)
77} 77}
78 78
79function getUsersList (url: string) { 79function getUsersList (url: string, accessToken: string) {
80 const path = '/api/v1/users' 80 const path = '/api/v1/users'
81 81
82 return request(url) 82 return request(url)
83 .get(path) 83 .get(path)
84 .set('Accept', 'application/json') 84 .set('Accept', 'application/json')
85 .set('Authorization', 'Bearer ' + accessToken)
85 .expect(200) 86 .expect(200)
86 .expect('Content-Type', /json/) 87 .expect('Content-Type', /json/)
87} 88}
88 89
89function getUsersListPaginationAndSort (url: string, start: number, count: number, sort: string) { 90function getUsersListPaginationAndSort (url: string, accessToken: string, start: number, count: number, sort: string) {
90 const path = '/api/v1/users' 91 const path = '/api/v1/users'
91 92
92 return request(url) 93 return request(url)
@@ -95,6 +96,7 @@ function getUsersListPaginationAndSort (url: string, start: number, count: numbe
95 .query({ count }) 96 .query({ count })
96 .query({ sort }) 97 .query({ sort })
97 .set('Accept', 'application/json') 98 .set('Accept', 'application/json')
99 .set('Authorization', 'Bearer ' + accessToken)
98 .expect(200) 100 .expect(200)
99 .expect('Content-Type', /json/) 101 .expect('Content-Type', /json/)
100} 102}