Add unit tests for mail account endpoints (30 tests)

Comprehensive test coverage for backend/app/api/v1/endpoints/mail_accounts.py:
- CRUD operations (create, list, get, update, delete)
- Subscription limit enforcement and superuser bypass
- Account toggle with ERROR→ACTIVE status reset
- Pull-now with disabled account guard
- Test connection (new and existing) with decrypt failure handling
- Auto-detect mail settings
- Paginated processing runs and logs

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-03-29 00:37:44 +00:00
parent 4d07d04c63
commit 65318b8c1b
3 changed files with 776 additions and 0 deletions
+1
View File
@@ -123,6 +123,7 @@ Comprehensive task breakdown for repository improvements and production readines
### In Progress 🔨
- [x] Write unit tests for authentication (22 tests covering register, login, Google OAuth, authorize-url, and helper functions)
- [x] Write unit tests for mail account endpoints (30 tests covering CRUD, toggle, pull-now, test connection, auto-detect, processing runs/logs)
- [ ] Write unit tests for mail processing
- [ ] Write integration tests for API endpoints