Skip to content

Fix broken invoiceStatus module, add payment/invoice tests and e2e coverage - #966

Merged
Kingsman-99 merged 3 commits into
Stellar-split:mainfrom
lawrencesunday311-sketch:fix/issues-903-902-901-900
Oct 20, 2026
Merged

Kingsman-99 merged 3 commits into
Stellar-split:mainfrom
lawrencesunday311-sketch:fix/issues-903-902-901-900

Conversation

@lawrencesunday311-sketch

Copy link
Copy Markdown
Contributor

Summary

  • Add comprehensive unit test coverage for invoice logic #900: src/lib/invoiceStatus.ts imported functions (areMilestoneConditionsSatisfied, getInvoiceMilestones) that don't exist in invoiceMilestones.ts, and imported from a non-existent ./invoiceDisputes" module — the file was unresolvable. Rewired getReleaseCheckto the realinvoiceMilestones (getMilestones/canReleaseMilestone) and arbitrators (getDisputesByInvoice/isDisputeActive`) APIs, and added unit tests for the status transition state machine and release gating (milestones + disputes).
  • Add integration tests for payment processing flow #901: Added tests for usePaymentSubmission, the hook driving the core payment-processing path (rate-lock expiry gating, transaction simulation success/failure, state reset). It had zero prior coverage.
  • Add end-to-end tests for critical user flows #903: Playwright e2e already covers create-invoice, pay-invoice, dashboard, verify and landing flows. Added a test for the create-invoice wizard's back-navigation data retention, a real gap (the clickBack() page-object helper was unused by any spec).
  • Implement visual regression testing for UI components #902: Skipped — no visual-regression tooling (Storybook/Chromatic/snapshot testing) exists in this repo at all. Bootstrapping a whole new tool/pipeline is out of scope for a single issue; left an explanatory comment on the issue.

Test plan

  • npm test (vitest) — new specs: src/lib/invoiceStatus.test.ts, src/hooks/__tests__/usePaymentSubmission.test.ts
  • npm run test:e2e — new spec in e2e/create-invoice.spec.ts
  • Manually verify invoice release flow still blocks on active disputes and unmet milestone conditions

Closes #903
Closes #902
Closes #901
Closes #900

… unit tests

invoiceStatus.ts imported areMilestoneConditionsSatisfied/getInvoiceMilestones
from invoiceMilestones.ts (neither exists there) and getActiveDispute from a
non-existent invoiceDisputes.ts module, making the file unresolvable. Wired
getReleaseCheck to the real invoiceMilestones (getMilestones/canReleaseMilestone)
and arbitrators (getDisputesByInvoice/isDisputeActive) APIs, and added unit
tests covering status transitions and release gating for milestones and
disputes.
usePaymentSubmission drives the core payment-processing path (rate-lock
validation, transaction simulation, confirm/cancel, and post-payment side
effects) and had zero test coverage. Added tests covering rate lock
expiry gating, simulation success/failure, and state reset.
…k navigation

Playwright e2e already covers create/pay invoice, dashboard, verify and
landing flows. CreateInvoicePage exposed a clickBack() helper that no
spec exercised, leaving the wizard's back-navigation data-retention
behavior (a real part of the critical create-invoice flow) untested.
Added a test that fills step 1, advances, goes back, and asserts the
entered recipient/amount are preserved.
@vercel

vercel Bot commented Oct 20, 2026

Copy link
Copy Markdown

@lawrencesunday311-sketch is attempting to deploy a commit to the kingsman-99's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Oct 20, 2026

Copy link
Copy Markdown

@lawrencesunday311-sketch Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Kingsman-99
Kingsman-99 merged commit 8843b9a into Stellar-split:main Oct 20, 2026
1 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants