Refactor tests and services for improved type safety and error handling
All checks were successful
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Successful in 4m24s
All checks were successful
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Successful in 4m24s
- Updated FlyerCorrectionTool tests to remove unused error notification. - Enhanced ProfileManager tests and component to include points in user profile. - Fixed error handling in ProfileManager to correctly log error messages. - Adjusted AI routes tests to ensure proper mocking and added missing properties in mock responses. - Refined AI routes to improve error message extraction and payload handling. - Cleaned up gamification routes tests by removing unnecessary parameters. - Simplified public routes by removing unused parameters in async handlers. - Improved system routes tests to handle exec command callbacks more robustly. - Updated user routes tests to remove unnecessary middleware parameters. - Enhanced AI API client tests to use File objects for simulating uploads. - Modified AI service tests to improve type safety and mock implementations. - Refined database service tests to ensure proper type assertions and mock setups. - Updated express type definitions for better clarity and organization. - Cleaned up notification service tests to mock local re-exports instead of library directly.
This commit is contained in:
@@ -160,7 +160,7 @@ export const ProfileManager: React.FC<ProfileManagerProps> = ({ isOpen, onClose,
|
||||
setAddress(prev => ({ ...prev, latitude: lat, longitude: lng }));
|
||||
toast.success('Address re-geocoded successfully!');
|
||||
} catch (error) {
|
||||
toast.error('Failed to re-geocode address: ${error.message}.');
|
||||
toast.error(`Failed to re-geocode address: ${(error as Error).message}.`);
|
||||
} finally {
|
||||
setIsGeocoding(false);
|
||||
}
|
||||
@@ -192,7 +192,7 @@ export const ProfileManager: React.FC<ProfileManagerProps> = ({ isOpen, onClose,
|
||||
setAddress(prev => ({ ...prev, latitude: lat, longitude: lng }));
|
||||
toast.success('Address geocoded successfully!');
|
||||
} catch (error) {
|
||||
toast.error('Failed to geocode address: ${error.message}.');
|
||||
toast.error(`Failed to geocode address: ${(error as Error).message}.`);
|
||||
} finally {
|
||||
setIsGeocoding(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user