From 457ae5371951d3635f97cbdc3ad37a0d7894c751 Mon Sep 17 00:00:00 2001 From: wangxiaoxiang5599 Date: Sat, 12 Sep 2026 16:58:37 +1200 Subject: [PATCH] Fix flaky species filter test The sold animal's species came from the factory's random choice; when it happened to be cattle, the species=cattle filter returned two rows. Pin it to a species the assertions do not filter on. Co-Authored-By: Claude Opus 5 --- tests/Feature/AnimalTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Feature/AnimalTest.php b/tests/Feature/AnimalTest.php index ee73a9e..fbb59e1 100644 --- a/tests/Feature/AnimalTest.php +++ b/tests/Feature/AnimalTest.php @@ -54,7 +54,7 @@ public function test_index_can_be_filtered_by_search_species_status_and_paddock( $paddock = Paddock::factory()->create(); Animal::factory()->inPaddock($paddock)->species(Species::Sheep)->create(['tag_number' => 'SH-1', 'name' => 'Woolly']); Animal::factory()->species(Species::Cattle)->create(['tag_number' => 'CT-1']); - Animal::factory()->sold()->create(['tag_number' => 'SOLD-1']); + Animal::factory()->sold()->species(Species::Goat)->create(['tag_number' => 'SOLD-1']); $this->get(route('animals.index', ['search' => 'wool'])) ->assertInertia(fn (Assert $page) => $page->has('animals.data', 1)->where('animals.data.0.tag_number', 'SH-1'));