feat: include search lat/lng in station API meta response

This commit is contained in:
Ovidiu U
2026-04-06 09:37:39 +01:00
parent 0955873221
commit cef21a4f0f
2 changed files with 29 additions and 5 deletions

View File

@@ -157,3 +157,17 @@ it('returns 422 when postcode cannot be resolved', function () {
->assertUnprocessable()
->assertJsonValidationErrors(['postcode']);
});
it('includes resolved lat and lng in meta', function () {
$station = Station::factory()->create(['lat' => 52.555064, 'lng' => -0.256119]);
StationPriceCurrent::factory()->create([
'station_id' => $station->node_id,
'fuel_type' => FuelType::B7Standard,
'price_pence' => 14500,
]);
$this->getJson('/api/stations?lat=52.555064&lng=-0.256119&fuel_type=diesel&radius=10')
->assertOk()
->assertJsonPath('meta.lat', 52.555064)
->assertJsonPath('meta.lng', -0.256119);
});