From d10f37c12c9d1e4cfca1e6d1036c6cb1c611ae4e Mon Sep 17 00:00:00 2001 From: snipe Date: Sun, 2 Aug 2026 12:58:08 +0100 Subject: [PATCH] Fixed flappy test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hard-coded the values, as it was failing with name of “Gene”, because it was finding that on “Generate Password”. --- tests/Feature/Modals/Ui/ShowModalsTest.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/Feature/Modals/Ui/ShowModalsTest.php b/tests/Feature/Modals/Ui/ShowModalsTest.php index 2dc77ccd34..9951459eeb 100644 --- a/tests/Feature/Modals/Ui/ShowModalsTest.php +++ b/tests/Feature/Modals/Ui/ShowModalsTest.php @@ -9,7 +9,18 @@ class ShowModalsTest extends TestCase { public function test_user_modal_renders() { - $admin = User::factory()->createUsers()->create(); + // Force distinctive attribute values here rather than accepting the + // Faker defaults. assertDontSee does a substring check on the entire + // response body, so a Faker-generated first name of "Gene" collides + // with legitimate modal text like "Generate Password" and produces a + // false-positive failure. The strings below cannot appear inside any + // translated label, class name, or DOM attribute in the modal. + $admin = User::factory()->createUsers()->create([ + 'first_name' => 'ZzModalTestFirst', + 'last_name' => 'ZzModalTestLast', + 'email' => 'zz-modal-test@example.invalid', + ]); + $response = $this->actingAs($admin) ->get('modals/user') ->assertOk();