Files
Orchestrator/privat/CV/andreknie.de/server/services/mailer.test.js

13 lines
604 B
JavaScript

import { describe, expect, it } from 'vitest'
import { isMailerReady, MailerNotReadyError, sendConfirmationEmail } from './mailer.js'
describe('mailer readiness', () => {
it('reports missing SMTP configuration without exposing credentials', async () => {
expect(isMailerReady()).toBe(false)
await expect(sendConfirmationEmail('test@example.invalid', 'contact', 'synthetic-token'))
.rejects.toBeInstanceOf(MailerNotReadyError)
await expect(sendConfirmationEmail('test@example.invalid', 'contact', 'synthetic-token'))
.rejects.toMatchObject({ code: 'MAILER_NOT_READY' })
})
})