Add comprehensive tests for AddMailAccountModal component

28 tests covering:
- Create/edit mode rendering and titles
- Provider wizard flow (select, manual, back)
- Form field changes, username/email sync, checkboxes
- Auto-detect success, failure, and validation
- Test connection success, error, validation, existing account
- Submit mutations (create/update, password omission)
- Modal close interactions (X, backdrop, cancel)
- Saving state indicators
- Error message extraction (string, array, Error)

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:54:28 +00:00
parent 4d1451ecde
commit d79f9caf9e
3 changed files with 548 additions and 0 deletions
+1
View File
@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Unit tests for `AddMailAccountModal` component (`AddMailAccountModal.test.tsx`): 28 tests covering create/edit mode rendering, provider wizard flow, form field changes, checkbox toggles, auto-detect, test connection, submit mutations, error extraction, and modal close interactions
- Unit tests for provider endpoints (`test_providers.py`): 23 tests covering provider presets, Gmail credential CRUD, import labels, authorize URL, debug email, and OAuth callback
- Unit tests for mail account endpoints (`test_mail_accounts.py`): 30 tests covering CRUD, toggle, pull-now, test connection, auto-detect, processing runs, and processing logs
- Unit tests for authentication endpoints (`test_auth.py`): 22 tests covering register, login, Google OAuth, authorize-url, and helper functions