diff --git a/e2e/client-wizard.spec.ts b/e2e/client-wizard.spec.ts index 5030c2cb..59ceef07 100644 --- a/e2e/client-wizard.spec.ts +++ b/e2e/client-wizard.spec.ts @@ -124,4 +124,28 @@ test.describe('Client wizard (acceptance)', () => { await openClientList(page); await expect(page.locator('#entity-table')).toContainText('Test Client RENAMED'); }); + + test('a bank-account edit persists through save and is shown on reopen', async ({ page }) => { + // edit the seeded account's nickname via the sub-editor, then save the whole client + await openEditTestClient(page); + await advance(page); await advance(page); await advance(page); // -> bank-accounts + await page.locator('#wizard-form [hx-get*="/bank-account/edit"]').first().click(); + await page.waitForTimeout(450); + await page.locator('#wizard-form input[name="bank-account/name"]').fill('Persisted Checking'); + await page.locator('#wizard-form button[data-primary]:has-text("Accept")').first().click(); + await page.waitForTimeout(450); + await expect(page.locator('#wizard-form')).toContainText('Persisted Checking'); + // bank-accounts -> integrations -> cash-flow -> other-settings, then Save + await advance(page); await advance(page); await advance(page); + await expect(page.locator('#wizard-form')).toContainText('Feature Flags'); + await page.locator('#wizard-form button[data-primary]').first().click(); + await page.waitForTimeout(1200); + // reopen the client and walk back to the bank-accounts step: the new nickname is there, + // and the seeded "Test Checking" name is gone (it was renamed, not duplicated) + await openEditTestClient(page); + await advance(page); await advance(page); await advance(page); // -> bank-accounts + const form = page.locator('#wizard-form'); + await expect(form).toContainText('Persisted Checking'); + await expect(form).not.toContainText('Test Checking'); + }); });