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:
parent
f3b5929ecc
commit
ca189a565b
|
|
@ -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', [
|
||||
|
|
|
|||
Loading…
Reference in New Issue