test: add test cases for audio and auth
Description:
Added unit tests for core utility modules to improve reliability and ensure robust handling of audio processing and authentication flows.
-
Audio Validation Tests (
audiovalidation.test.ts): Covered validation of audio files including supported formats (wav, mp3, ogg, webm, flac, aac, mp4, m4a), duration limits (10s–15min), silence detection, noise level checks, and corrupt file handling. Also verified error mapping to user-friendly messages. -
Audio Recording Service Tests (
audiorecordingservice.test.ts): Tested full recording lifecycle (start, pause, resume, stop), permission handling, state management, file/blob creation, device capability checks, and error handling for Capacitor plugin responses. -
Authentication Tests (
auth.test.ts): Covered password reset flow including OTP initiation and confirmation. Validated API interactions, error handling (400–503 responses), network failures, edge cases (empty/invalid inputs), and correct request formatting.
These tests significantly improve coverage for critical features like audio handling and authentication.
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
closes #261 (closed)
