Commit Graph

4 Commits

Author SHA1 Message Date
William Valentin
5623f7efd2 test: add comprehensive hook tests
- Add extensive tests for useTheme hook with theme switching and system preference detection
- Add tests for useUserData hook with user data management
- Fix documentElement readonly property issues and fetch mock type issues in tests
- Test theme persistence, system theme detection, and edge cases
- Improve hook test coverage and reliability

This adds comprehensive testing for React hooks used throughout the application.
2025-09-08 11:38:37 -07:00
William Valentin
2556250f2c feat: add comprehensive test coverage and fix lint issues
- Add comprehensive tests for MailgunService (439 lines)
  * Email sending functionality with template generation
  * Configuration status validation
  * Error handling and edge cases
  * Mock setup for fetch API and FormData

- Add DatabaseService tests (451 lines)
  * Strategy pattern testing (Mock vs Production)
  * All CRUD operations for users, medications, settings
  * Legacy compatibility method testing
  * Proper TypeScript typing

- Add MockDatabaseStrategy tests (434 lines)
  * Complete coverage of mock database implementation
  * User operations, medication management
  * Settings and custom reminders functionality
  * Data persistence and error handling

- Add React hooks tests
  * useLocalStorage hook with comprehensive edge cases (340 lines)
  * useSettings hook with fetch operations and error handling (78 lines)

- Fix auth integration tests
  * Update mocking to use new database service instead of legacy couchdb.factory
  * Fix service variable references and expectations

- Simplify mailgun config tests
  * Remove redundant edge case testing
  * Focus on core functionality validation

- Fix all TypeScript and ESLint issues
  * Proper FormData mock typing
  * Correct database entity type usage
  * Remove non-existent property references

Test Results:
- 184 total tests passing
- Comprehensive coverage of core services
- Zero TypeScript compilation errors
- Full ESLint compliance
2025-09-08 10:13:50 -07:00
William Valentin
315303b120 Fix pre-commit script to properly handle multiple files and resolve ESLint warnings 2025-09-07 13:34:39 -07:00
William Valentin
e48adbcb00 Initial commit: Complete NodeJS-native setup
- Migrated from Python pre-commit to NodeJS-native solution
- Reorganized documentation structure
- Set up Husky + lint-staged for efficient pre-commit hooks
- Fixed Dockerfile healthcheck issue
- Added comprehensive documentation index
2025-09-06 01:42:48 -07:00