Skip to content

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

Open
Priyanshubhartistm wants to merge 3 commits into
cameri:mainfrom
Priyanshubhartistm:test/payment-processors
Open

Priyanshubhartistm wants to merge 3 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: 921ff8d

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] This test-only PR appears safe to merge.

Summary

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

  • OpenNode invoice requests and payment checks now have unit tests.
  • Nodeless invoice requests and payment checks now have unit tests.
  • Zebedee invoice requests and payment checks now have unit tests.
  • LNURL invoice requests and payment checks now have unit tests.

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

Comment thread test/unit/payments-processors/zebedee-payments-processor.spec.ts Outdated
@coveralls

coveralls commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 39572489989

Coverage increased (+0.5%) to 74.682%

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: 11255
Covered Lines: 8830
Line Coverage: 78.45%
Relevant Branches: 5903
Covered Branches: 3984
Branch Coverage: 67.49%
Branches in Coverage %: Yes
Coverage Strength: 800.05 hits per line

💛 - Coveralls

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

This branch has not been deployed

No deployments
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)

2 participants