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.ts26
1 files changed, 25 insertions, 1 deletions
diff --git a/server/tests/utils/users/users.ts b/server/tests/utils/users/users.ts
index 5dba34b69..cd1b07701 100644
--- a/server/tests/utils/users/users.ts
+++ b/server/tests/utils/users/users.ts
@@ -246,6 +246,28 @@ function resetPassword (url: string, userId: number, verificationString: string,
246 }) 246 })
247} 247}
248 248
249function askSendVerifyEmail (url: string, email: string) {
250 const path = '/api/v1/users/ask-send-verify-email'
251
252 return makePostBodyRequest({
253 url,
254 path,
255 fields: { email },
256 statusCodeExpected: 204
257 })
258}
259
260function verifyEmail (url: string, userId: number, verificationString: string, statusCodeExpected = 204) {
261 const path = '/api/v1/users/' + userId + '/verify-email'
262
263 return makePostBodyRequest({
264 url,
265 path,
266 fields: { verificationString },
267 statusCodeExpected
268 })
269}
270
249// --------------------------------------------------------------------------- 271// ---------------------------------------------------------------------------
250 272
251export { 273export {
@@ -265,5 +287,7 @@ export {
265 unblockUser, 287 unblockUser,
266 askResetPassword, 288 askResetPassword,
267 resetPassword, 289 resetPassword,
268 updateMyAvatar 290 updateMyAvatar,
291 askSendVerifyEmail,
292 verifyEmail
269} 293}