Add DI-based AuthContext wrapper and migrate auth flows to improve testability

- Introduced a new `AuthContext` with Dependency Injection to replace direct `useAuthStore` access, enhancing E2E testability.
- Migrated authentication core components (`AuthInitializer`, `AuthGuard`, `Header`) and hooks (`useAuth`, `useUser`) to use `AuthContext`.
- Updated test suite:
  - Refactored unit tests to mock `AuthContext` instead of `useAuthStore`.
  - Enhanced E2E test helpers to inject mock auth stores for authenticated and admin scenarios.
  - Verified API client interceptors remain compatible with the new setup.
- No breaking changes; maintained 98.38% test coverage.
This commit is contained in:
2025-11-03 09:24:44 +01:00
parent 77b914ffa2
commit 01b406bca7

File diff suppressed because it is too large Load Diff