test : Add and maintain 100% unit test coverage for RequireAuth.tsx
Issue Summary
Added comprehensive unit tests for RequireAuth.tsx and achieved 100% test coverage.
Current behavior:
-
RequireAuth.tsxhandles three authentication guard states:- shows a loading message while auth state is not ready
- redirects unauthenticated users to
/login - renders protected children for authenticated users
What was done:
- wrote unit tests covering all auth guard branches
- verified loading-state rendering
- verified redirect behavior for unauthenticated users
- verified protected content rendering for authenticated users
- confirmed redirect preserves the current location in navigation state
Result:
-
RequireAuth.tsxnow has 100% statement, branch, function, and line coverage - route protection behavior is fully validated and regression-safe