Commit Graph

2 Commits

  • feat(i18n): add Japanese language support
    - Add complete Japanese translation file (ja.json)
    - Update frontend types and hooks to support "ja" language option
    - Add Japanese tray menu texts in Rust backend
    - Add Japanese option to language settings component
    - Update Zod schema to include Japanese language validation
    - Add test case for Japanese language preference
    - Update i18n documentation to reflect three-language support
  • test: add comprehensive tests for hooks and components
    Add extensive unit and component tests covering import/export, settings,
    and provider list functionality, advancing to Sprint 2 of test development.
    
    Hook Tests:
    - useImportExport (11 tests):
      * File selection success/failure flows
      * Import process with success/failure/exception paths
      * Export functionality with error handling
      * User cancellation scenarios
      * State management (clear selection, reset status)
      * Fake timers for async callback testing
    
    - useSettingsForm (5 tests):
      * Settings normalization on initialization
      * Language persistence from localStorage
      * Field updates with language sync
      * Reset functionality with initial language restoration
      * Optimization to avoid redundant language changes
    
    Component Tests:
    - ProviderList (3 tests):
      * Loading state with skeleton placeholders
      * Empty state with create callback
      * Render order from useDragSort with action callbacks
      * Props pass-through (isCurrent, isEditMode, dragHandleProps)
      * Mock ProviderCard to isolate component under test
    
    Technical Highlights:
    - Fake timers (vi.useFakeTimers) for async control
    - i18n mock with changeLanguage spy
    - Partial mock of @dnd-kit/sortable using vi.importActual
    - ProviderCard render spy for props verification
    - Comprehensive error handling coverage
    
    Test Coverage:
      ✓ 19 new test cases (11 + 5 + 3)
      ✓ Total: 35 tests passing
      ✓ Execution time: 865ms
      ✓ TypeScript: 0 errors
    
    Related: Import/export, settings management, provider list rendering
    Sprint Progress: Sprint 1 complete, Sprint 2 in progress (component tests)