What
Three smaller server actions have no tests. Good starting point if you're new to testing in this codebase - the files are small and focused.
Files to test
src/app/actions/help.ts → help.test.ts
sendHelpRequest
- accepts plain text message
- accepts a valid GitHub PR URL
- rejects if user is not authenticated
- enforces cooldown (returns rate_limited if same key used within window)
- rejects if rec does not belong to user
src/app/actions/streak.ts → streak.test.ts
getStreak
- returns current streak count for authenticated user
- returns 0 when user has no activity
- returns not_authenticated when no session
src/app/actions/usage.ts → usage.test.ts
getUsageStats
- returns activity log entries for authenticated user
- respects limit parameter
- returns empty array when no activity exists
Notes
- All three files follow the same pattern: get user from Supabase auth, query with service client, return Result
- Mock
getServerSupabase and getServiceSupabase consistently across all three
- The existing
src/app/actions/github-sync.test.ts is a good reference for how to set up the mocks
What
Three smaller server actions have no tests. Good starting point if you're new to testing in this codebase - the files are small and focused.
Files to test
src/app/actions/help.ts→help.test.tssrc/app/actions/streak.ts→streak.test.tssrc/app/actions/usage.ts→usage.test.tsNotes
getServerSupabaseandgetServiceSupabaseconsistently across all threesrc/app/actions/github-sync.test.tsis a good reference for how to set up the mocks