Skip to content

Add unit tests for event tracking provider #562

Description

@phertyameen

Description

Write unit tests for backend/src/analytics/providers/track-event.provider.ts covering the happy path, an empty-data edge case, and a boundary date-range case, using mocked repositories.

Why this matters

The event tracking provider currently lacks dedicated test coverage, so a regression could ship undetected.

Files to touch

  • backend/src/analytics/providers/track-event.provider.spec.ts

Acceptance Criteria

  • At least 3 test cases: happy path, empty data, boundary dates
  • Repositories are mocked (no real DB connection in unit tests)
  • Tests run under npm test with no manual setup

Notes

This issue is part of the new analytics module effort (tracking, aggregation,
and reporting on player/game activity). Please keep new code inside
backend/src/analytics/ following the same module/controller/service/provider
layout used by existing modules (e.g. progress, streak, quests).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions