Skip to content

test(payments): add unit tests for the zebedee, opennode, nodeless and lnurl processors - #917

Merged
cameri merged 7 commits into
cameri:mainfrom
Priyanshubhartistm:test/payment-processors
Oct 31, 2026
Merged

cameri merged 7 commits into
cameri:mainfrom
Priyanshubhartistm:test/payment-processors

Conversation

@Priyanshubhartistm

Copy link
Copy Markdown
Collaborator

Description

Adds unit specs for the four payment processors that had none, next to the existing lnbits and nwc ones (test/unit/payments-processors/). No production code changes.

For each processor:

  • createInvoice: the request sent to the provider (url, body, amount unit, callback url / metadata, ttl) and the mapping of the response to an Invoice; msats are converted to whole sats where the provider takes sats; provider outages and responses without data are not swallowed.
  • getInvoice: the request, every provider status mapped to InvoiceStatus (a status the provider adds later is never read as paid), confirmation dates, and error propagation.
  • processor specifics: OpenNode's lightning_invoice / lightning fallback and amount / price fallback; Nodeless's 15 minute fallback expiry; LNURL's generated invoice id and verify-url polling.

Related Issue

Closes #903

Motivation and Context

These are the money-moving code paths for four providers. A misread status or a wrong amount unit is a funds bug, and nothing covered them.

How Has This Been Tested?

  • The new specs pass (58 tests). Reverting a status mapping in transform.ts or changing OpenNode's ttl makes the matching spec fail.
  • pnpm lint, pnpm check:deps, pnpm run build:check, pnpm run test:unit.

Screenshots (if appropriate):

Types of changes

  • Non-functional change (docs, style, minor refactor)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my code changes.
  • I added a changeset, or this is docs-only and I added an empty changeset.
  • All new and existing tests passed.

…d lnurl processors

Signed-off-by: Priyanshubhartistm <bhartipriyanshustm@gmail.com>
@changeset-bot

changeset-bot Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 2176a32

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@greptile-apps

greptile-apps Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge; no actionable issues remain.

Summary

Adds unit tests for four payment processors without changing production code.

  • LNURL invoice creation now has unit specs for its callback and returned invoice.
  • LNURL invoice lookups now have unit specs for verify-URL polling and payment status.
  • Nodeless invoice creation now has unit specs for sats amounts and returned invoice data.
  • Nodeless invoice lookups now have unit specs for provider statuses and confirmation dates.
  • OpenNode invoice creation now has unit specs for its sats request and returned charge.
  • OpenNode invoice lookups now have unit specs for status and response fallbacks.
  • Zebedee invoice creation now has unit specs for precise msat amounts and charge mapping.
  • Zebedee invoice lookups now have unit specs for charge status and confirmation time.

Reviews (7) · Last reviewed commit: "Merge branch 'main' into test/payment-pr..." · Reviewed by Greptile

@coveralls

coveralls commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 41229356259

Warning

Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes.
Quick fix: rebase this PR. Learn more →

Coverage increased (+0.5%) to 77.211%

Details

  • Coverage increased (+0.5%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 11759
Covered Lines: 9496
Line Coverage: 80.76%
Relevant Branches: 6162
Covered Branches: 4341
Branch Coverage: 70.45%
Branches in Coverage %: Yes
Coverage Strength: 778.34 hits per line

💛 - Coveralls

Signed-off-by: Priyanshubhartistm <bhartipriyanshustm@gmail.com>
@cameri
cameri enabled auto-merge October 31, 2026 18:25
@cameri
cameri merged commit b1efa6e into cameri:main Oct 31, 2026
12 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

Development

Successfully merging this pull request may close these issues.

No unit tests for four of six payment processors (nodeless, lnurl, opennode, zebedee)

3 participants