Testing Request
What tests are missing?
The streak calculation logic (current streak, longest streak, streak at risk) is a core feature of DevTrack but appears to lack comprehensive unit tests. These functions are business-critical — a bug here directly impacts user trust.
Proposed Tests
describe('streak calculations', () => {
it('returns 0 for empty commit history')
it('counts consecutive days correctly')
it('resets streak on missed day')
it('handles streak freeze correctly (frozen day should not break streak)')
it('calculates longest streak from history')
it('detects streak at risk (no commit today)')
it('handles timezone boundaries correctly')
it('counts today correctly if commit made after midnight')
it('handles leap year Feb 29 correctly')
it('handles months with 28, 29, 30, 31 days')
})
Implementation Details
- Find streak utility functions in
src/lib/ or similar
- Create
__tests__/streak.test.ts
- Pure unit tests — no DB or API mocking needed
- Test edge cases: year boundaries, timezone changes, DST
Acceptance Criteria
Testing Request
What tests are missing?
The streak calculation logic (current streak, longest streak, streak at risk) is a core feature of DevTrack but appears to lack comprehensive unit tests. These functions are business-critical — a bug here directly impacts user trust.
Proposed Tests
Implementation Details
src/lib/or similar__tests__/streak.test.tsAcceptance Criteria