Category: Testing - Enhancement
Priority: High
Estimated Time: 3 hours
Description:
The critical merchant payment path (enter amount → create charge → show QR code → poll for payment → show confirmed screen) has no automated test coverage. A regression anywhere in this chain — keypad input, api.createPaymentRequest, the polling loop, or the paid/expired state rendering — would only be caught by manual testing.
Tasks:
- Add unit tests for
app/(app)/charge/page.tsx: keypad input, decimal guard, backspace, form submission
- Add unit tests for
app/request/[id]/page.tsx: loading state, pending→paid transition, expired state, error state
- Mock
api.createPaymentRequest and api.getPaymentRequest in both test files
- Test the polling loop: verify polling stops when status becomes
'paid' and when AbortController.abort() is called
- Add to coverage collection in
jest.config.js
Category: Testing - Enhancement
Priority: High
Estimated Time: 3 hours
Description:
The critical merchant payment path (enter amount → create charge → show QR code → poll for payment → show confirmed screen) has no automated test coverage. A regression anywhere in this chain — keypad input,
api.createPaymentRequest, the polling loop, or the paid/expired state rendering — would only be caught by manual testing.Tasks:
app/(app)/charge/page.tsx: keypad input, decimal guard, backspace, form submissionapp/request/[id]/page.tsx: loading state, pending→paid transition, expired state, error stateapi.createPaymentRequestandapi.getPaymentRequestin both test files'paid'and whenAbortController.abort()is calledjest.config.js