Add and fixup invite link related tests
This commit is contained in:
@@ -659,6 +659,9 @@ async function sendPasswordResetEmail(user, email, auditSource) {
|
||||
assert.strictEqual(typeof email, 'string');
|
||||
assert.strictEqual(typeof auditSource, 'object');
|
||||
|
||||
const error = validateEmail(email);
|
||||
if (error) throw error;
|
||||
|
||||
const resetLink = await getPasswordResetLink(user, auditSource);
|
||||
await mailer.passwordReset(user, email, resetLink);
|
||||
}
|
||||
@@ -767,6 +770,10 @@ async function sendInviteEmail(user, email, auditSource) {
|
||||
assert.strictEqual(typeof user, 'object');
|
||||
assert.strictEqual(typeof email, 'string');
|
||||
assert.strictEqual(typeof auditSource, 'object');
|
||||
|
||||
const error = validateEmail(email);
|
||||
if (error) throw error;
|
||||
|
||||
const inviteLink = await getInviteLink(user, auditSource);
|
||||
await mailer.sendInvite(user, null /* invitor */, email, inviteLink);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user