From 1318e3ac3bc11570f835aafe7afae318a2deddbb Mon Sep 17 00:00:00 2001 From: Ovidiu U Date: Sun, 5 Apr 2026 20:27:17 +0100 Subject: [PATCH] test: fix quality issues in StationSearchTest --- tests/Feature/Livewire/StationSearchTest.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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'; }); });