Skip to content

refactor(dashboard): add tests for CommitClock peak detection #338

@JhaSourav07

Description

@JhaSourav07

🧩 Background

components/dashboard/CommitClock.tsx computes a peakIndex (the day with the most commits) to render the dominant spoke. This logic is currently untested.

🎯 Objective

Extract findPeakIndex(data: CommitClockData[]): number and add unit tests.

📁 Files to touch

  • components/dashboard/CommitClock.tsx
  • components/dashboard/CommitClock.test.ts (new)

🛠️ Implementation steps

  • Extract the helper.
  • Test: single item, all equal (first wins), clear winner, all zeros.

✅ Definition of done

  • Helper is tested with 4+ cases.
  • Component renders identically.

Metadata

Metadata

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions