Skip to content

test: added test cases for utils and videorecordingservice

srilatha bandari requested to merge test/utils-video into test_cases

Description:

Added comprehensive unit tests for videoRecordingService.ts and utils.ts to ensure reliability of video recording functionality and shared utility helpers.

  • videoRecordingService.test.ts (117 tests): Tested full video recording workflow across web and native platforms, including platform detection, camera initialization, recording start/stop, permission handling, device errors, MIME type fallback, MediaRecorder events, camera switching, and resource cleanup. Also covered multiple edge cases like repeated actions and invalid states. Achieved 100% coverage across statements, branches, functions, and lines.

  • utils.test.ts: Tested utility functions used across the app:

    • cn() for class name merging
    • formatModernTime() for relative time formatting
    • formatSizeMB() for file size formatting
    • formatDuration() for duration conversion
    • getISTDate() for timezone handling Covered multiple scenarios including edge cases and formatting correctness. Achieved 100% coverage.

These tests improve stability of core features and prevent regressions in critical functionality.


Type of Change:

  • Bug Fix
  • Feature Development
  • Documentation

Testing:

  • Tested on desktop
  • Tested on mobile
  • Tested in different browsers

Screenshots (if applicable):

image


Checklist:

  • Code follows project style guidelines
  • Self-review completed
  • No console errors
  • TypeScript types are correct

closes #265 (closed)

Merge request reports

Loading