Skip to content

Enhancement: add end-to-end test covering charge → QR code → polling → paid flow #600

Description

@henrypeters

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programe2eEnd-to-end testspaymentsPayment gateway integrationtestingTests and test coverage

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions