"All new business logic should have corresponding unit tests."
Description
This PR introduces unit tests for the PropertyList component and the Property model to ensure that the new business logic works as expected. The tests cover the property listing and search functionality in the PropertyList component and the scopeSearch method in the Property model.
Summary of Changes
Created a new test file tests/Feature/PropertyListTest.php for testing the PropertyList Livewire component. The tests cover the mount, updatedSearch, and render methods.
Created a new test file tests/Unit/PropertyModelTest.php for testing the Property model. The test covers the scopeSearch method.
Utilized Laravel's built-in testing utilities and assertions to simulate conditions and verify outcomes.
These tests will help ensure that the property listing and search functionality work as expected and will make it easier to identify and fix any issues that may arise in the future.
PR Feedback (click)
I created this PR to address this rule:
"All new business logic should have corresponding unit tests."
Description
This PR introduces unit tests for the
PropertyList
component and theProperty
model to ensure that the new business logic works as expected. The tests cover the property listing and search functionality in thePropertyList
component and thescopeSearch
method in theProperty
model.Summary of Changes
tests/Feature/PropertyListTest.php
for testing thePropertyList
Livewire component. The tests cover themount
,updatedSearch
, andrender
methods.tests/Unit/PropertyModelTest.php
for testing theProperty
model. The test covers thescopeSearch
method.These tests will help ensure that the property listing and search functionality work as expected and will make it easier to identify and fix any issues that may arise in the future.