mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
* feat(backend): add support line to emails * - fixed snapshots --------- Co-authored-by: Wolfgang Huß <wolle.huss@pjannto.com> Co-authored-by: Sebastian Stein <sebastian@codepassion.de>
68 lines
1.4 KiB
TypeScript
68 lines
1.4 KiB
TypeScript
import { sendResetPasswordMail, defaultParams } from './sendEmail'
|
|
|
|
describe('sendResetPasswordMail', () => {
|
|
const data: {
|
|
email: string
|
|
nonce: string
|
|
locale: string
|
|
name: string
|
|
} = {
|
|
email: 'user@example.org',
|
|
nonce: '123456',
|
|
locale: 'en',
|
|
name: 'Jenny Rostock',
|
|
}
|
|
|
|
describe('with support', () => {
|
|
beforeEach(() => {
|
|
defaultParams.SUPPORT_EMAIL = 'support@example.org'
|
|
})
|
|
|
|
describe('English', () => {
|
|
beforeEach(() => {
|
|
data.locale = 'en'
|
|
})
|
|
|
|
it('renders correctly', async () => {
|
|
await expect(sendResetPasswordMail(data)).resolves.toMatchSnapshot()
|
|
})
|
|
})
|
|
|
|
describe('German', () => {
|
|
beforeEach(() => {
|
|
data.locale = 'de'
|
|
})
|
|
|
|
it('renders correctly', async () => {
|
|
await expect(sendResetPasswordMail(data)).resolves.toMatchSnapshot()
|
|
})
|
|
})
|
|
})
|
|
|
|
describe('without support', () => {
|
|
beforeEach(() => {
|
|
delete defaultParams.SUPPORT_EMAIL
|
|
})
|
|
|
|
describe('English', () => {
|
|
beforeEach(() => {
|
|
data.locale = 'en'
|
|
})
|
|
|
|
it('renders correctly', async () => {
|
|
await expect(sendResetPasswordMail(data)).resolves.toMatchSnapshot()
|
|
})
|
|
})
|
|
|
|
describe('German', () => {
|
|
beforeEach(() => {
|
|
data.locale = 'de'
|
|
})
|
|
|
|
it('renders correctly', async () => {
|
|
await expect(sendResetPasswordMail(data)).resolves.toMatchSnapshot()
|
|
})
|
|
})
|
|
})
|
|
})
|