test: e2e coverage for community feed, leaderboard, and profile pages - #24
Merged
Conversation
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
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 structuretests/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 IDtests/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
data-testidattributes to community, leaderboard, and profile page components for stable selectorsgetCommunityFeedandgetLeaderboardnow 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)https://claude.ai/code/session_017P7S4SuivspHeeXfok7WzX
Generated by Claude Code