test(T1): add edge-case coverage for EmailRepositoryImpl #30

Merged
guettlibot merged 1 commits from task/t1-email-repo-coverage into main 2026-05-14 02:43:13 +00:00
guettlibot commented 2026-05-14 02:39:55 +00:00 (Migrated from codeberg.org)

Summary

  • Adds three new test groups to test/unit/email_repository_impl_test.dart (54 → 57 tests)
  • Concurrent moves: two simultaneous moveEmail calls on the same email complete without DB corruption, and both changes are enqueued in pending_changes
  • SMTP auth failure: sendEmail for an IMAP account propagates a 535 exception thrown by a fake smtpConnect
  • IMAP UID validity change: a uidValidity mismatch between the stored checkpoint and the server triggers a full re-sync that deletes stale local emails and updates the checkpoint to the new validity value
  • Extends _makeRepos() with optional imapConnect/smtpConnect parameters so each test can inject its own transport fake without affecting others

Test plan

  • task check-fast passes (dart format + analyze + 271 tests green)
  • Three new test groups each pass in isolation with --name filter
## Summary - Adds three new test groups to `test/unit/email_repository_impl_test.dart` (54 → 57 tests) - **Concurrent moves**: two simultaneous `moveEmail` calls on the same email complete without DB corruption, and both changes are enqueued in `pending_changes` - **SMTP auth failure**: `sendEmail` for an IMAP account propagates a `535` exception thrown by a fake `smtpConnect` - **IMAP UID validity change**: a `uidValidity` mismatch between the stored checkpoint and the server triggers a full re-sync that deletes stale local emails and updates the checkpoint to the new validity value - Extends `_makeRepos()` with optional `imapConnect`/`smtpConnect` parameters so each test can inject its own transport fake without affecting others ## Test plan - [x] `task check-fast` passes (dart format + analyze + 271 tests green) - [x] Three new test groups each pass in isolation with `--name` filter
Sign in to join this conversation.