Files
sharedinbox/test/unit/account_model_test.dart
T
Thomas GüttlerandClaude Opus 4.7 1a62907703 feat: default new SMTP accounts to implicit TLS (port 465)
The SMTP SSL/TLS toggle in the add-account form now defaults to on with
port 465. Previously the default was port 587 with the toggle off
(STARTTLS — TLS was active under the hood, but the off toggle made users
think the connection was insecure). The MX-record fallback in the
discovery service was flipped the same way; autoconfig XML parsing is
unchanged so servers that advertise STARTTLS still get STARTTLS.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-28 15:50:37 +02:00

40 lines
1.2 KiB
Dart

import 'package:sharedinbox/core/models/account.dart';
// Import the abstract interface so it appears in coverage.
import 'package:sharedinbox/core/repositories/account_repository.dart'; // ignore: unused_import
import 'package:test/test.dart';
void main() {
group('Account', () {
const account = Account(
id: 'a1',
displayName: 'Work',
email: 'me@example.com',
imapHost: 'imap.example.com',
smtpHost: 'smtp.example.com',
);
test('stores all fields', () {
expect(account.id, 'a1');
expect(account.displayName, 'Work');
expect(account.email, 'me@example.com');
expect(account.imapHost, 'imap.example.com');
expect(account.imapPort, 993);
expect(account.imapSsl, isTrue);
expect(account.smtpHost, 'smtp.example.com');
expect(account.smtpPort, 465);
expect(account.smtpSsl, isTrue);
});
test('const constructor produces equal instances', () {
const same = Account(
id: 'a1',
displayName: 'Work',
email: 'me@example.com',
imapHost: 'imap.example.com',
smtpHost: 'smtp.example.com',
);
expect(identical(account, same), isTrue);
});
});
}