Skip to content

Commit

Permalink
Not needed properties
Browse files Browse the repository at this point in the history
  • Loading branch information
afonic committed Nov 5, 2024
1 parent bc91ad1 commit 54263f8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
6 changes: 3 additions & 3 deletions src/Http/Livewire/LfDualRangeFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
10 changes: 2 additions & 8 deletions tests/Feature/LfDualRangeFilterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand All @@ -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,
]);
}

Expand All @@ -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,
]);
}

Expand Down

0 comments on commit 54263f8

Please sign in to comment.