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`
This commit is contained in:
Víctor Falcón 2026-04-01 10:30:49 +01:00 committed by GitHub
parent f3b5929ecc
commit ca189a565b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 3 deletions

View File

@ -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', [