Skip to content

Expand unit test coverage for untested pages #10

Description

@priscaenoch

Problem

There are only 8 test files under test/ for roughly 114 source modules in src/. Several core pages have no tests at all: ContractPage, EventPage, GraphPage, Sandbox, BatchMultiCall, RpcMetricsDashboard, RateLimitDashboard, and SubInvocationPage. Meaningfully closing this gap is a broad, multi-file effort spanning a new test file per page, shared mocking of the API client, and coverage wiring.

What needs to be done

  • Add Testing Library tests for each untested page listed above, mocking the API client: cover initial render, loading state, successful data render, and error state.
  • Add tests for critical utilities in src/utils (formatting, XDR helpers) that currently lack coverage.
  • Ensure the shared API client is exported/mockable to support these tests.
  • Wire coverage thresholds so the added coverage is enforced (coordinate with the coverage-provider issue).

Files

  • new test files under test/ (one per page listed above)
  • new tests for src/utils/*
  • src/services/apiClient.ts (export for mocking, if needed)
  • vitest.config.ts (coverage thresholds)

Acceptance deliverables

  • Each listed page has at least render, loading, and error tests.
  • Test count meaningfully increases and npm test passes.
  • All CI checks pass; the change cannot be merged until CI is green.

Tests to pass

  • The new page and utility tests pass in CI.
  • Coverage does not regress below the configured threshold.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ADVANCESubstantial, cross-cutting work spanning more than five files. Not a minor fix.GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardThird CampaignCampaign: Third CampaignenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions