whisper-money/tests/Browser
Víctor Falcón 9a20335c6a
fix(transactions): only auto-select account on account pages (#549)
## What

When the add/edit transaction dialog resets in **create** mode, it no
longer auto-selects the first transactional account. The account field
starts empty so the user must pick one deliberately.

The only exception is the account detail page (`accounts/{uuid}`), which
passes `initialAccountId`; there the dialog still pre-selects that
account.

## Why

Auto-selecting the first account made it easy to accidentally book a
transaction to the wrong account. Forcing a deliberate pick (except
where the account is unambiguous from context) avoids that.

## How

- `edit-transaction-dialog.tsx`: dropped the `availableAccounts[0]`
fallback. The field now resolves to `initialAccount?.id ?? ''`.
- The existing submit guard (`Account is required`) already covers the
empty case.
- `Accounts/Show.tsx` already passes `initialAccountId={account.id}`, so
the account-page behavior is unchanged; the transactions list passes
nothing, so it now starts empty.

## Tests

Added two unit tests to `edit-transaction-dialog.test.tsx`:
- no `initialAccountId` → account value stays empty (no auto-select)
- matching `initialAccountId` → account is pre-selected
2026-06-17 11:28:31 +00:00
..
assets Improve automation rules and sync error handling 2025-12-01 10:30:22 +01:00
live feat(ai): suggest automation rules during onboarding (#523) 2026-06-13 22:51:15 +02:00
.gitignore Add category type field support (#2) 2025-12-01 20:19:47 +01:00
AccountsPageTest.php test: expand browser coverage for accounts and linked loans (#277) 2026-04-13 09:33:18 +01:00
AmountInputTest.php fix(transactions): only auto-select account on account pages (#549) 2026-06-17 11:28:31 +00:00
AuthenticationTest.php Support soft-deleted users with reusable emails (#316) 2026-04-22 11:41:41 +01:00
AutomationRuleBuilderTest.php feat: parent/child category tree (#474) 2026-06-03 19:30:12 +02:00
BankAccountsTest.php feat(loans): backfill historical balances on loan creation (#322) 2026-04-24 13:09:34 +01:00
BankConnectionFlowTest.php test(open-banking): e2e coverage for Enable Banking connection flows (#509) 2026-06-09 11:58:50 +02:00
BudgetCrudTest.php feat(budgets): track multiple categories and labels per budget (#466) 2026-06-01 12:32:23 +02:00
BudgetsFeatureNavigationTest.php feat(budgets): track multiple categories and labels per budget (#466) 2026-06-01 12:32:23 +02:00
CashflowCategoryNavigationTest.php feat(cashflow): make income/expense category rows clickable to transactions (#234) 2026-03-17 10:57:40 +00:00
CatchAllBudgetCrudTest.php feat: add catch-all budgets (#527) 2026-06-15 16:07:19 +00:00
CategoriesTest.php fix(categories): expose cashflow setting on create (#448) 2026-05-29 11:05:04 +02:00
ImportTransactionsTest.php Remove encryption from browser tests and demo user (#129) 2026-02-17 11:45:27 +01:00
OnboardingFlowTest.php feat(ai): suggest automation rules during onboarding (#523) 2026-06-13 22:51:15 +02:00
RealEstateAccountTest.php refactor(real-estate): remove Pennant gating (#308) 2026-04-20 13:31:49 +01:00
TransactionsTest.php Fix label creation dropdown refresh (#363) 2026-05-07 10:26:43 +01:00