tests: solved reset password should work when token is not expired

This commit is contained in:
Gabriel Grubba
2022-12-20 15:55:58 -03:00
parent 4b6ae32e26
commit 388ce154ee

View File

@@ -1280,7 +1280,6 @@ if (Meteor.isServer) (() => {
await Meteor.callAsync("getInterceptedEmails", email);
const re = new RegExp(`${Meteor.absoluteUrl()}#/reset-password/(\\S*)`);
console.log('reset',resetPasswordEmailOptions)
const match = resetPasswordEmailOptions.text.match(re);
test.isTrue(match);
@@ -1288,9 +1287,6 @@ if (Meteor.isServer) (() => {
const newEmail = `${Random.id()}-new@example.com`;
await Meteor.users.update(userId, {$set: {"emails.0.address": newEmail}});
console.log('token',resetPasswordToken)
console.log('match',match)
console.log('password',hashPassword("new-password"))
await test.throwsAsync(
async () =>
@@ -1324,9 +1320,8 @@ if (Meteor.isServer) (() => {
const user = await Meteor.users.findOne(userId);
await Accounts.sendResetPasswordEmail(userId, email);
const [resetPasswordEmailOptions] =
Meteor.callAsync("getInterceptedEmails", email);
await Meteor.callAsync("getInterceptedEmails", email);
const re = new RegExp(`${Meteor.absoluteUrl()}#/reset-password/(\\S*)`);
const match = resetPasswordEmailOptions.text.match(re);