Skip to content

[Frontend] frontend/src/components/Stats.tsx has no test asserting it renders a graceful fallback when the backend stats endpoint returns no data #1125

Description

@grantfox-oss

Join our community: https://t.me/+DOylgFv1jyJlNzM0

Why this matters

Separately, Stats.tsx is flagged for shipping hardcoded fake TVL/stream-count numbers. Once that's fixed to pull real data, there needs to be test coverage for the case where the stats endpoint returns zero, null, or a network error, so the component doesn't render NaN, undefined, or a broken layout to visitors on the marketing homepage.

Acceptance criteria

  • Add tests for zero-value, null, and error-response scenarios once real data wiring lands
  • Assert a sensible fallback (e.g. "--" or a loading skeleton) rather than NaN/undefined text

Files to touch

  • frontend/src/components/Stats.tsx

Out of scope

  • Replacing the hardcoded numbers with real data (tracked separately)
  • Redesigning the stats section layout

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programfrontendFrontend related tasksgood first issueGood for newcomerstestingTesting related tasks

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions