Files
motovaultpro/backend/src/features/stations/tests/fixtures/mock-google-response.ts
2025-11-04 18:46:46 -06:00

96 lines
2.2 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* @ai-summary Mock Google Places API responses for tests
*/
import { GooglePlacesResponse } from '../../external/google-maps/google-maps.types';
export const mockGoogleNearbySearchResponse: GooglePlacesResponse = {
results: [
{
geometry: {
location: {
lat: 37.7749,
lng: -122.4194
}
},
name: 'Shell Gas Station - Downtown',
place_id: 'ChIJN1blFMzZrIEElx_JXUzRLdc',
vicinity: '123 Main St, San Francisco, CA 94105',
rating: 4.2,
photos: [
{
photo_reference: 'photo_ref_1'
}
],
opening_hours: {
open_now: true
},
types: ['gas_station', 'point_of_interest', 'establishment']
},
{
geometry: {
location: {
lat: 37.7923,
lng: -122.3989
}
},
name: 'Chevron Station - Financial District',
place_id: 'ChIJN1blFMzZrIEElx_JXUzRLde',
vicinity: '456 Market St, San Francisco, CA 94102',
rating: 4.5,
photos: [
{
photo_reference: 'photo_ref_2'
}
],
opening_hours: {
open_now: true
},
types: ['gas_station', 'point_of_interest', 'establishment']
}
],
status: 'OK'
};
export const mockGooglePlaceDetailsResponse = {
result: {
geometry: {
location: {
lat: 37.7749,
lng: -122.4194
}
},
name: 'Shell Gas Station - Downtown',
place_id: 'ChIJN1blFMzZrIEElx_JXUzRLdc',
formatted_address: '123 Main St, San Francisco, CA 94105',
rating: 4.2,
user_ratings_total: 150,
formatted_phone_number: '+1 (415) 555-0100',
website: 'https://www.shell.com',
opening_hours: {
weekday_text: [
'Monday: 12:00 AM 11:59 PM',
'Tuesday: 12:00 AM 11:59 PM'
]
},
photos: [
{
photo_reference: 'photo_ref_1'
}
],
types: ['gas_station', 'point_of_interest', 'establishment']
},
status: 'OK'
};
export const mockGoogleErrorResponse = {
results: [],
status: 'ZERO_RESULTS'
};
export const mockGoogleApiErrorResponse = {
results: [],
status: 'REQUEST_DENIED',
error_message: 'Invalid API key'
};