-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
priority-mediumMedium priority issuesMedium priority issuestech-debtTechnical debt and code qualityTechnical debt and code qualitytestingRelated to automated testsRelated to automated tests
Description
Background
We recently improved error handling in our app by replacing the 'Max Mustermann (Recovery)' fallback user with proper error messages that include the Request ID for easier debugging. While we have good unit tests for the ApiService error handling, the Account component tests need improvement.
Current Issues
The Account component tests currently fail because:
- Mock implementation is incomplete
- React Native's async rendering isn't properly handled
- Context providers for navigation are missing
__DEV__flag handling needs to be addressed
Required Improvements
-
Better Mocking:
- Improve mocks for React Native components
- Properly mock router functionality and navigation
- Add mock for
__DEV__flag as the component relies on it
-
Test Environment Adjustments:
- Provide proper React Navigation/Expo Router context
- Improve waiting mechanisms for async UI updates
- Correctly handle state changes
-
More Granular Test Cases:
- Write isolated tests for different paths (Loading, Error, Success)
- Query UI elements more precisely instead of relying on text content
- Test callback functions (button clicks, refresh, etc.)
Acceptance Criteria
- All Account component tests pass successfully
- Tests verify that error messages include Request ID
- Different UI states (loading, error, success) are tested properly
- Code coverage for Account component is increased
Related Changes
This is related to the recent error handling improvements where we've replaced the 'Max Mustermann (Recovery)' fallback user with proper error messages that include Request IDs.
Metadata
Metadata
Assignees
Labels
priority-mediumMedium priority issuesMedium priority issuestech-debtTechnical debt and code qualityTechnical debt and code qualitytestingRelated to automated testsRelated to automated tests