Skip to content

test(frontend): cover Onramper open analytics#13149

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/missing-test-coverage-6c83
Draft

test(frontend): cover Onramper open analytics#13149
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/missing-test-coverage-6c83

Conversation

@cursor

@cursor cursor Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Motivation

Recent OnRamper changes added trackOnramperOpen to report success and failure outcomes for opening signed widget URLs. That payload is business-relevant telemetry: regressions could hide signing failures, rate limits, or selected-token attribution from dashboards.

Risky behavior now covered:

  • Successful OnRamper open events include the selected token metadata and success status.
  • Error OnRamper open events include severity, error type, error message, and omit token_address when no token address is available.

Changes

  • Added focused trackOnramperOpen coverage in src/frontend/src/tests/lib/services/analytics.service.spec.ts.
  • Covered both success and error payload shapes without changing production behavior.

Test files added/updated:

  • src/frontend/src/tests/lib/services/analytics.service.spec.ts

Why these tests materially reduce regression risk:

  • They pin the analytics contract used by the new OnRamper open flow, including optional token-address behavior and failure classification that downstream dashboards rely on.

Tests

  • npm run test -- src/frontend/src/tests/lib/services/analytics.service.spec.ts
  • npm run format
  • npm run lint -- --max-warnings 0
  • npm run check
  • npm run test

Note: The first targeted test attempt failed before running because dependencies were not installed and .svelte-kit/tsconfig.json had not been generated. After installing locked dependencies with Node 24.11.0 and running npm run prepare, the targeted and full test runs passed.

Open in Web View Automation 

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