chore: remove NHTSA code and update documentation (refs #227)
Delete vehicles/external/nhtsa/ directory (3 files), remove VPICVariable and VPICResponse from platform models. Update all documentation to reflect Gemini VIN decode via OCR service architecture. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -74,7 +74,7 @@ docker compose exec mvp-frontend npm test -- --coverage
|
||||
|
||||
Example: `vehicles.service.test.ts`
|
||||
- Tests VIN validation logic
|
||||
- Tests vehicle creation with mocked vPIC responses
|
||||
- Tests vehicle creation with mocked OCR service responses
|
||||
- Tests caching behavior with mocked Redis
|
||||
- Tests error handling paths
|
||||
|
||||
@@ -194,7 +194,7 @@ All 15 features have test suites with unit and/or integration tests:
|
||||
- `vehicles` - Unit + integration tests
|
||||
|
||||
### Mock Strategy
|
||||
- **External APIs**: Completely mocked (vPIC, Google Maps)
|
||||
- **External APIs**: Completely mocked (OCR service, Google Maps)
|
||||
- **Database**: Real database with transactions
|
||||
- **Redis**: Mocked for unit tests, real for integration
|
||||
- **Auth**: Mocked JWT tokens for protected endpoints
|
||||
@@ -319,9 +319,9 @@ describe('Error Handling', () => {
|
||||
).rejects.toThrow('Invalid VIN format');
|
||||
});
|
||||
|
||||
it('should handle vPIC API failure', async () => {
|
||||
mockVpicClient.decode.mockRejectedValue(new Error('API down'));
|
||||
|
||||
it('should handle OCR service failure', async () => {
|
||||
mockOcrClient.decodeVin.mockRejectedValue(new Error('API down'));
|
||||
|
||||
const result = await vehicleService.create(validVehicle, 'user123');
|
||||
expect(result.make).toBeNull(); // Graceful degradation
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user