mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
29 lines
713 B
TypeScript
29 lines
713 B
TypeScript
import { sendResetPasswordEmail } from './sendResetPasswordEmail'
|
|
import { sendEMail } from './sendEMail'
|
|
|
|
jest.mock('./sendEMail', () => {
|
|
return {
|
|
__esModule: true,
|
|
sendEMail: jest.fn(),
|
|
}
|
|
})
|
|
|
|
describe('sendResetPasswordEmail', () => {
|
|
beforeEach(async () => {
|
|
await sendResetPasswordEmail({
|
|
link: 'resetLink',
|
|
firstName: 'Peter',
|
|
lastName: 'Lustig',
|
|
email: 'peter@lustig.de',
|
|
})
|
|
})
|
|
|
|
it('calls sendEMail', () => {
|
|
expect(sendEMail).toBeCalledWith({
|
|
to: `Peter Lustig <peter@lustig.de>`,
|
|
subject: 'Gradido: Passwort zurücksetzen',
|
|
text: expect.stringContaining('Hallo Peter Lustig') && expect.stringContaining('resetLink'),
|
|
})
|
|
})
|
|
})
|