aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/utils/users/users.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/utils/users/users.ts')
-rw-r--r--server/tests/utils/users/users.ts6
1 files changed, 5 insertions, 1 deletions
diff --git a/server/tests/utils/users/users.ts b/server/tests/utils/users/users.ts
index f786de6e3..5dba34b69 100644
--- a/server/tests/utils/users/users.ts
+++ b/server/tests/utils/users/users.ts
@@ -10,6 +10,7 @@ function createUser (
10 username: string, 10 username: string,
11 password: string, 11 password: string,
12 videoQuota = 1000000, 12 videoQuota = 1000000,
13 videoQuotaDaily = -1,
13 role: UserRole = UserRole.USER, 14 role: UserRole = UserRole.USER,
14 specialStatus = 200 15 specialStatus = 200
15) { 16) {
@@ -19,7 +20,8 @@ function createUser (
19 password, 20 password,
20 role, 21 role,
21 email: username + '@example.com', 22 email: username + '@example.com',
22 videoQuota 23 videoQuota,
24 videoQuotaDaily
23 } 25 }
24 26
25 return request(url) 27 return request(url)
@@ -202,6 +204,7 @@ function updateUser (options: {
202 accessToken: string, 204 accessToken: string,
203 email?: string, 205 email?: string,
204 videoQuota?: number, 206 videoQuota?: number,
207 videoQuotaDaily?: number,
205 role?: UserRole 208 role?: UserRole
206}) { 209}) {
207 const path = '/api/v1/users/' + options.userId 210 const path = '/api/v1/users/' + options.userId
@@ -209,6 +212,7 @@ function updateUser (options: {
209 const toSend = {} 212 const toSend = {}
210 if (options.email !== undefined && options.email !== null) toSend['email'] = options.email 213 if (options.email !== undefined && options.email !== null) toSend['email'] = options.email
211 if (options.videoQuota !== undefined && options.videoQuota !== null) toSend['videoQuota'] = options.videoQuota 214 if (options.videoQuota !== undefined && options.videoQuota !== null) toSend['videoQuota'] = options.videoQuota
215 if (options.videoQuotaDaily !== undefined && options.videoQuotaDaily !== null) toSend['videoQuotaDaily'] = options.videoQuotaDaily
212 if (options.role !== undefined && options.role !== null) toSend['role'] = options.role 216 if (options.role !== undefined && options.role !== null) toSend['role'] = options.role
213 217
214 return makePutBodyRequest({ 218 return makePutBodyRequest({