fix: remove dead search property, simplify empty state message
This commit is contained in:
@@ -14,13 +14,12 @@ final class StationList extends Component
|
|||||||
|
|
||||||
public bool $hasSearched = false;
|
public bool $hasSearched = false;
|
||||||
|
|
||||||
public string $search = '';
|
|
||||||
|
|
||||||
public int $radius = 5;
|
public int $radius = 5;
|
||||||
|
|
||||||
#[On('stations-found')]
|
#[On('stations-found')]
|
||||||
public function handle(array $results, array $meta, int $radius = 5, ?array $prediction = null): void
|
public function handle(array $results, array $meta, int $radius = 5, ?array $prediction = null): void
|
||||||
{
|
{
|
||||||
|
// $prediction is handled by fuel.recommendation component
|
||||||
$this->results = $results;
|
$this->results = $results;
|
||||||
$this->meta = $meta;
|
$this->meta = $meta;
|
||||||
$this->radius = $radius;
|
$this->radius = $radius;
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
</div>
|
</div>
|
||||||
@empty
|
@empty
|
||||||
<p class="text-sm text-text-muted">
|
<p class="text-sm text-text-muted">
|
||||||
No stations found within {{ $radius }} {{ str('mile')->plural($radius) }} of "{{ $search }}".
|
No stations found within {{ $radius }} {{ str('mile')->plural($radius) }}.
|
||||||
</p>
|
</p>
|
||||||
@endforelse
|
@endforelse
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -40,7 +40,6 @@ it('shows station cards after stations-found event', function () {
|
|||||||
|
|
||||||
it('shows empty state message when stations-found has no results', function () {
|
it('shows empty state message when stations-found has no results', function () {
|
||||||
Livewire::test(StationList::class)
|
Livewire::test(StationList::class)
|
||||||
->set('search', 'ZZ99 9ZZ')
|
|
||||||
->dispatch('stations-found', results: [], meta: ['count' => 0], prediction: null, radius: 5)
|
->dispatch('stations-found', results: [], meta: ['count' => 0], prediction: null, radius: 5)
|
||||||
->assertSet('hasSearched', true)
|
->assertSet('hasSearched', true)
|
||||||
->assertSee('No stations found');
|
->assertSee('No stations found');
|
||||||
|
|||||||
Reference in New Issue
Block a user