From ca189a565b094eb8d709bf89b3d8a1f1220b1099 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Falc=C3=B3n?= Date: Wed, 1 Apr 2026 10:30:49 +0100 Subject: [PATCH] test(budgets): stabilize budget rename browser test (#255) ## Summary - replace the budget rename test's fixed post-submit wait with stable UI signals tied to the save lifecycle - wait for the edit dialog to close, the budget show page to settle, and the updated budget name to appear in the page content and title - verify the change with `php artisan test --compact tests/Browser/BudgetCrudTest.php` --- tests/Browser/BudgetCrudTest.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/Browser/BudgetCrudTest.php b/tests/Browser/BudgetCrudTest.php index fa946964..5538441f 100644 --- a/tests/Browser/BudgetCrudTest.php +++ b/tests/Browser/BudgetCrudTest.php @@ -80,9 +80,13 @@ test('user can update budget name', function () { ->fill('#allocated-amount', '500') ->wait(2) ->click('button:has-text("Save Changes")') - ->wait(4) // Wait for form submission - ->waitForText('New Budget Name', 15) - ->assertDontSee('Old Name') + ->waitForText('Saving...', 5) + ->waitForEvent('networkidle') + ->assertScript("document.querySelector('[role=\"dialog\"]') === null") + ->assertPathIs("/budgets/{$budget->id}") + ->assertSee('Budget Spending') + ->assertSee('New Budget Name') + ->assertTitleContains('New Budget Name') ->assertNoJavascriptErrors(); $this->assertDatabaseHas('budgets', [