fix(vitest): fix alias for tests and test: add unit tests for components languageswitcher, loginform and ui accordition - 3 test files
Description:
This MR fixes Vitest configuration issues and adds unit tests for key frontend components.
Fixed alias resolution in vitest.config.ts to properly support @/components/... imports. Added unit tests for LanguageSwitcher, Accordion (UI), and LoginForm components. Ensured proper mocking for dependencies like react-i18next, @/i18n, and dropdown UI components. Achieved 100% coverage for LanguageSwitcher and Accordion, and ~60–67% coverage for LoginForm.
LanguageSwitcher: Tests language selection, rendering, and i18n.changeLanguage behavior. Accordion (UI): Tests expand/collapse functionality and UI state changes. LoginForm: Tests login/signup flows, validations, and API interaction scenarios.
Type of Change:
-
Bug Fix -
Feature Development -
Documentation
Testing:
-
Tested on desktop -
Tested on mobile -
Tested in different browsers
Screenshots (if applicable):
Checklist:
-
Code follows project style guidelines -
Self-review completed -
No console errors -
TypeScript types are correct
Related Issues / References
- Closes #245 (closed)