diff --git a/tests/Feature/Livewire/StationSearchTest.php b/tests/Feature/Livewire/StationSearchTest.php index 66d3450..112e7a4 100644 --- a/tests/Feature/Livewire/StationSearchTest.php +++ b/tests/Feature/Livewire/StationSearchTest.php @@ -1,9 +1,12 @@ assertStatus(200) @@ -79,6 +82,7 @@ it('sets apiError from 422 postcode validation response', function () { ->set('fuelType', 'petrol') ->call('findStations') ->assertSet('results', []) + ->assertSet('meta', []) ->assertSet('apiError', 'Postcode not found.'); }); @@ -92,6 +96,7 @@ it('sets generic apiError on server error', function () { ->set('fuelType', 'petrol') ->call('findStations') ->assertSet('results', []) + ->assertSet('meta', []) ->assertSet('apiError', 'Unable to fetch stations. Please try again.'); }); @@ -108,7 +113,9 @@ it('converts radius from miles to km in the outgoing API request', function () { Http::assertSent(function ($request) { $data = $request->data(); - return isset($data['radius']) && abs((float) $data['radius'] - 8.05) < 0.01; + + return isset($data['radius']) && abs((float) $data['radius'] - 8.05) < 0.01 + && isset($data['fuel_type']) && $data['fuel_type'] === 'petrol'; }); });