mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Test that 'sendEmailTranslated' on 'CONFIG.EMAIL_TEST_MODUS = true' replaces the receiver with by the fake test mail accaount
This commit is contained in:
parent
2b65c6b261
commit
0cccdb56de
@ -107,4 +107,41 @@ describe('sendEmailTranslated', () => {
|
||||
expect(i18n.__).toBeCalled()
|
||||
})
|
||||
})
|
||||
|
||||
describe('with email EMAIL_TEST_MODUS true', () => {
|
||||
beforeEach(async () => {
|
||||
jest.clearAllMocks()
|
||||
CONFIG.EMAIL = true
|
||||
CONFIG.EMAIL_TEST_MODUS = true
|
||||
result = await sendEmailTranslated({
|
||||
receiver: {
|
||||
to: 'receiver@mail.org',
|
||||
cc: 'support@gradido.net',
|
||||
},
|
||||
template: 'accountMultiRegistration',
|
||||
locals: {
|
||||
locale: 'en',
|
||||
},
|
||||
})
|
||||
})
|
||||
|
||||
it('call of "sendEmailTranslated" with faked "to"', () => {
|
||||
expect(result).toMatchObject({
|
||||
envelope: {
|
||||
from: CONFIG.EMAIL_SENDER,
|
||||
to: [CONFIG.EMAIL_TEST_RECEIVER, 'support@gradido.net'],
|
||||
},
|
||||
message: expect.any(String),
|
||||
originalMessage: expect.objectContaining({
|
||||
to: CONFIG.EMAIL_TEST_RECEIVER,
|
||||
cc: 'support@gradido.net',
|
||||
from: `Gradido (nicht antworten) <${CONFIG.EMAIL_SENDER}>`,
|
||||
attachments: [],
|
||||
subject: 'Gradido: Try To Register Again With Your Email',
|
||||
html: expect.stringContaining('Gradido: Try To Register Again With Your Email'),
|
||||
text: expect.stringContaining('GRADIDO: TRY TO REGISTER AGAIN WITH YOUR EMAIL'),
|
||||
}),
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user