test: setup vitest for unit testing
test(frontend): add unit tests for api and utils The frontend codebase currently lacks unit test coverage for its core logic layers. This issue aims to add unit tests for:
- API/service layer logic
- Utility/helper functions
This merge request adds unit test coverage for the frontend core logic, focusing on both utility helpers and the API/service layer.
The goal is to improve reliability, error handling, and maintainability of the frontend codebase.
✅ Utility Tests
Added unit tests for shared utility helpers:
cn (class name merge helper)
decodeJwt
isTokenExpired
Covered:
valid cases
edge cases
invalid input handling
Added unit tests for API helper functions using Vitest
Axios calls are mocked to avoid real network requests
Covered:
successful API responses
error handling scenarios
helper functions such as isApiError
Ensured API functions return correctly mapped response data
Edited by Laxman Reddy