From 54263f818505087cb3037339f88efc56eaada7ed Mon Sep 17 00:00:00 2001 From: Iosif Chatzimichail Date: Tue, 5 Nov 2024 11:34:39 +0200 Subject: [PATCH] Not needed properties --- src/Http/Livewire/LfDualRangeFilter.php | 6 +++--- tests/Feature/LfDualRangeFilterTest.php | 10 ++-------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/Http/Livewire/LfDualRangeFilter.php b/src/Http/Livewire/LfDualRangeFilter.php index 1c01107..ba56609 100644 --- a/src/Http/Livewire/LfDualRangeFilter.php +++ b/src/Http/Livewire/LfDualRangeFilter.php @@ -35,11 +35,11 @@ class LfDualRangeFilter extends Component #[Locked] public $format = 'number'; - public function mount($defaultMin = null, $defaultMax = null) + public function mount() { $this->condition = 'dual_range'; - $this->selectedMin = $defaultMin ?? $this->min; - $this->selectedMax = $defaultMax ?? $this->max; + $this->selectedMin = $this->min; + $this->selectedMax = $this->max; } public function dispatchEvent() diff --git a/tests/Feature/LfDualRangeFilterTest.php b/tests/Feature/LfDualRangeFilterTest.php index d72e2d2..8f109d7 100644 --- a/tests/Feature/LfDualRangeFilterTest.php +++ b/tests/Feature/LfDualRangeFilterTest.php @@ -71,12 +71,10 @@ public function it_renders_the_component_with_correct_min_and_max_values() 'condition' => 'gte|lte', 'min' => 2, 'max' => 10, - 'defaultMin' => 4, - 'defaultMax' => 8, 'minRange' => 2, ]) - ->assertSet('selectedMin', 4) - ->assertSet('selectedMax', 8) + ->assertSet('selectedMin', 2) + ->assertSet('selectedMax', 10) ->assertSet('minRange', 2) ->assertSee('10'); } @@ -92,8 +90,6 @@ public function it_throws_a_field_not_found_exception_if_the_field_doesnt_exist( 'condition' => 'between', 'min' => 2, 'max' => 10, - 'defaultMin' => 4, - 'defaultMax' => 8, ]); } @@ -108,8 +104,6 @@ public function it_throws_a_blueprint_not_found_exception_if_the_blueprint_doesn 'condition' => 'between', 'min' => 2, 'max' => 10, - 'defaultMin' => 4, - 'defaultMax' => 8, ]); }