feat(auth): #127 forgot-password + reset-password API (BDD + mail)
Made-with: Cursor
This commit is contained in:
@@ -68,4 +68,20 @@ describe('MailService (ticket #28)', () => {
|
||||
expect(html).toContain('2025-000001');
|
||||
expect(html).toContain(`https://app.test/create-password?token=${encodeURIComponent(token)}`);
|
||||
});
|
||||
|
||||
it('sendPasswordResetEmail utilise Handlebars + lien /reset-password', async () => {
|
||||
const token = 'aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee';
|
||||
await service.sendPasswordResetEmail({
|
||||
email: 'u@test.fr',
|
||||
prenom: 'Marie',
|
||||
nom: 'Curie',
|
||||
token,
|
||||
});
|
||||
expect(sendEmailSpy).toHaveBeenCalledTimes(1);
|
||||
const [, subject, html] = sendEmailSpy.mock.calls[0];
|
||||
expect(subject).toContain('Réinitialisation');
|
||||
expect(html).toContain('Marie');
|
||||
expect(html).toContain(`https://app.test/reset-password?token=${encodeURIComponent(token)}`);
|
||||
expect(html).not.toContain('create-password');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user