21 lines
589 B
TypeScript
21 lines
589 B
TypeScript
import { describe, expect, it } from 'vitest';
|
|
import { resolveSmtpSecurity } from '../src/services/mail.service.js';
|
|
|
|
describe('mail.service', () => {
|
|
it('uses STARTTLS for port 587 even when secure flag is enabled', () => {
|
|
expect(resolveSmtpSecurity({ smtpPort: 587, smtpSecure: true })).toEqual({
|
|
port: 587,
|
|
secure: false,
|
|
requireTLS: true
|
|
});
|
|
});
|
|
|
|
it('uses implicit TLS for port 465', () => {
|
|
expect(resolveSmtpSecurity({ smtpPort: 465, smtpSecure: false })).toEqual({
|
|
port: 465,
|
|
secure: true,
|
|
requireTLS: false
|
|
});
|
|
});
|
|
});
|