Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions frontend/src/__tests__/purchase-execution-toast.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1040,6 +1040,7 @@ describe('handleExecutePurchase - missing payment option (#431)', () => {
test.each([
['undefined', undefined],
['empty string', ''],
['whitespace only', ' '],
])('refuses with an error toast and no POST when payment is %s', async (_label, payment) => {
const rec: Record<string, unknown> = { ...buildMinimalRec() };
if (payment === undefined) delete rec.payment;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ export async function handleExecutePurchase(): Promise<void> {
// option. Defaulting here would silently pick the most cash-intensive
// schedule on a money path (issue #431).
const recsWithPayment = localRecs.filter(
(r): r is typeof r & { payment: string } => !!r.payment,
(r): r is typeof r & { payment: string } => !!r.payment?.trim(),
);
const missingCount = localRecs.length - recsWithPayment.length;
if (missingCount > 0) {
Expand Down
Loading