Add comprehensive unit tests for auth endpoints

22 tests covering:
- Helper functions (_domain_of, _check_domain_allowed, _default_tier, _is_admin_email)
- POST /register (success, duplicate email, domain restriction)
- POST /login (success, user not found, wrong password, inactive, admin auto-promotion)
- POST /google (existing user, new user, unverified email, domain restriction)
- GET /google/authorize-url (correct URL construction)

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:30:38 +00:00
parent 55536c964f
commit 4d07d04c63
3 changed files with 494 additions and 1 deletions
+1 -1
View File
@@ -122,7 +122,7 @@ Comprehensive task breakdown for repository improvements and production readines
- [x] **Frontend test coverage**: Added 113 new tests across 7 new test suites covering all components and utility functions. Installed `@testing-library/react`, `@testing-library/jest-dom`, `@testing-library/user-event`. New suites: `date-utils` (30 tests), API interceptors (9 tests), `AuthGuard` (6 tests), `QueryProvider` (2 tests), `DashboardLayout` (14 tests), `NotificationWizard` (32 tests), `ProviderWizard` (20 tests). Total frontend: 119 tests across 8 suites.
### In Progress 🔨
- [ ] Write unit tests for authentication (target 80%+ coverage)
- [x] Write unit tests for authentication (22 tests covering register, login, Google OAuth, authorize-url, and helper functions)
- [ ] Write unit tests for mail processing
- [ ] Write integration tests for API endpoints