Skip to content

test(frontend): cover Onramper signing errors#13153

Draft
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/missing-test-coverage-ec7a
Draft

test(frontend): cover Onramper signing errors#13153
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/missing-test-coverage-ec7a

Conversation

@cursor

@cursor cursor Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Motivation

Recent OnRamper signing changes made the frontend depend on distinct canister error classes for unavailable-signing UX and telemetry. A regression in this mapper or canister boundary could collapse secret misconfiguration and rate limiting into generic errors, hiding the actual business failure mode.

Risky behavior now covered:

  • SecretNotConfigured maps to OnramperSecretNotConfiguredError with the expected user-flow message.
  • RateLimited maps to OnramperRateLimitedError with the backend rate-limit window details.
  • BackendCanister.signOnramperWidgetUrl serializes wallet, network-wallet, and wallet-address-tag params to the Candid request shape and propagates the signed response.

Changes

  • Added focused OnRamper signing error mapper coverage in src/frontend/src/tests/lib/canisters/backend.errors.spec.ts.
  • Added BackendCanister.signOnramperWidgetUrl boundary coverage in src/frontend/src/tests/lib/canisters/backend.canister.spec.ts.

Test files added/updated:

  • src/frontend/src/tests/lib/canisters/backend.errors.spec.ts
  • src/frontend/src/tests/lib/canisters/backend.canister.spec.ts

Why these tests materially reduce regression risk:

  • They pin the exact error classes and request serialization that the signed OnRamper widget flow relies on, preventing silent loss of UX/telemetry classification for backend misconfiguration or rate limiting.

Tests

  • npm run test -- src/frontend/src/tests/lib/canisters/backend.errors.spec.ts src/frontend/src/tests/lib/canisters/backend.canister.spec.ts
  • npx prettier --check src/frontend/src/tests/lib/canisters/backend.errors.spec.ts src/frontend/src/tests/lib/canisters/backend.canister.spec.ts
  • npx eslint --max-warnings 0 src/frontend/src/tests/lib/canisters/backend.errors.spec.ts src/frontend/src/tests/lib/canisters/backend.canister.spec.ts
  • npm run check:tests

Note: the first validation attempt failed before tests ran because dependencies were not installed and the runner shim resolved node to v22. After installing Node 24.17.0 with nvm, prepending its bin directory to PATH, and running npm ci, the targeted tests and checks above passed.

Open in Web View Automation 

cursoragent and others added 2 commits June 20, 2026 10:04
Co-authored-by: Antonio Ventilii <AntonioVentilii@users.noreply.github.com>
Co-authored-by: Antonio Ventilii <AntonioVentilii@users.noreply.github.com>
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.

1 participant