Skip to content

test: e2e coverage for community feed, leaderboard, and profile pages - #24

Merged
Jhong098 merged 1 commit into
mainfrom
feat/e2e-coverage-tests
May 4, 2026
Merged

test: e2e coverage for community feed, leaderboard, and profile pages#24
Jhong098 merged 1 commit into
mainfrom
feat/e2e-coverage-tests

Conversation

@Jhong098

@Jhong098 Jhong098 commented May 4, 2026

Copy link
Copy Markdown
Owner

Summary

  • tests/e2e/community-feed.spec.ts (9 tests) — page heading, Hot/New/Top tab switching + URL param updates, Create button href, empty-state vs populated feed, challenge card structure
  • tests/e2e/leaderboard.spec.ts (5 tests) — header title with challenge name, back link to campaign, empty state + Play Now CTA with correct href, table column headers, 404 for unknown challenge ID
  • tests/e2e/profile.spec.ts (6 tests) — unauthenticated redirect to /sign-in; authenticated: XP section, stats grid, history section, empty-history Campaign link, level display (auth-gated tests self-skip without a Clerk session)

Supporting changes

  • Added minimal data-testid attributes to community, leaderboard, and profile page components for stable selectors
  • getCommunityFeed and getLeaderboard now return [] instead of throwing when Supabase env vars are absent (prevents 500s in CI without secrets)

Test plan

  • pnpm test:e2e — 53 tests pass, 17 skipped (auth-gated)
  • Community feed tab switching verified in browser
  • Leaderboard empty state and 404 verified
  • Profile unauthenticated redirect verified

https://claude.ai/code/session_017P7S4SuivspHeeXfok7WzX


Generated by Claude Code

Three new spec files cover the highest-priority untested routes:
- community-feed.spec.ts: page structure, Hot/New/Top tab switching, empty
  state, Create button, challenge card layout
- leaderboard.spec.ts: header title, back link, empty state + Play Now CTA,
  table column headers, 404 for unknown challenge ID
- profile.spec.ts: unauthenticated redirect, XP section, stats grid,
  history section (auth-gated tests skip gracefully without a Clerk session)

Also adds minimal data-testid hooks to the three page components, and makes
getCommunityFeed and getLeaderboard return empty arrays rather than crash
when Supabase env vars are absent (e.g. in CI with no secrets).

https://claude.ai/code/session_017P7S4SuivspHeeXfok7WzX
@vercel

vercel Bot commented May 4, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
poly-sd Ready Ready Preview, Comment May 4, 2026 0:51am

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.31%. Comparing base (1a561db) to head (934a374).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #24   +/-   ##
=======================================
  Coverage   79.31%   79.31%           
=======================================
  Files          11       11           
  Lines         440      440           
  Branches      134      134           
=======================================
  Hits          349      349           
  Misses         47       47           
  Partials       44       44           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Jhong098
Jhong098 merged commit 73131a3 into main May 4, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants