Skip to content

Add integration tests for analytics endpoints #97

@robertocarlous

Description

@robertocarlous

Summary

Cover the missing integration tests for /api/analytics endpoints: /apy-history, /user-yield, and /protocol-performance.

What to do

  • Create tests/integration/api/analytics.test.ts (or separate files) to test:
    • Auth behavior for protected endpoints (401 without token).
    • Successful responses with seeded DB data for a user.
    • Validation error responses for invalid period query values.
    • protocol-performance public endpoint returns grouped protocols structure.
  • Use test factories to seed yieldSnapshot, position, and protocolRate data.
  • Clean up DB after tests.

Acceptance criteria

  • Tests added and passing in CI.
  • Coverage includes success and failure cases for each endpoint.

Labels: tests, integration

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions