diff --git a/frontend/src/__tests__/purchase-execution-toast.test.ts b/frontend/src/__tests__/purchase-execution-toast.test.ts index c37ebbe80..6125d7a31 100644 --- a/frontend/src/__tests__/purchase-execution-toast.test.ts +++ b/frontend/src/__tests__/purchase-execution-toast.test.ts @@ -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 = { ...buildMinimalRec() }; if (payment === undefined) delete rec.payment; diff --git a/frontend/src/app.ts b/frontend/src/app.ts index 764a0f339..b187ae818 100644 --- a/frontend/src/app.ts +++ b/frontend/src/app.ts @@ -368,7 +368,7 @@ export async function handleExecutePurchase(): Promise { // 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) {