Repository navigation
feat(spotify): api-user-top — fetch user top artists and tracks - #686
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 34 minutes and 42 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…AndTracks Add two new test cases to boost coverage: - Happy-path test for successful API responses with valid artist/track data - Edge case test for tracks without artist metadata (uses 'Unknown' default) Coverage for spotifyApi.ts: 79.1% (lines 434-464 partially covered) Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Adds 2 tests exercising the artist + track build pipeline (genres null/missing, filter by id+name, artists[].name fallback to 'Unknown'). Coverage on spotifyApi.ts new code: 19.51% → 90.08% lines / 88.04% branches. Note: fetch mock requires explicit `globalThis.fetch = fetchMock` re-assign inside each new test — the beforeEach assignment doesn't survive Jest's test-isolation in some cases. Existing tests get away with it because they all expect null and match real-fetch's 401 behavior; new positive-path tests must use the inline pattern.
|
* feat(spotify): api-user-top — fetch user top artists and tracks * test(spotify): add happy-path and edge coverage for getUserTopArtistsAndTracks Add two new test cases to boost coverage: - Happy-path test for successful API responses with valid artist/track data - Edge case test for tracks without artist metadata (uses 'Unknown' default) Coverage for spotifyApi.ts: 79.1% (lines 434-464 partially covered) * chore: trigger sonar re-scan * test(spotify): cover getUserTopArtistsAndTracks success path branches Adds 2 tests exercising the artist + track build pipeline (genres null/missing, filter by id+name, artists[].name fallback to 'Unknown'). Coverage on spotifyApi.ts new code: 19.51% → 90.08% lines / 88.04% branches. Note: fetch mock requires explicit `globalThis.fetch = fetchMock` re-assign inside each new test — the beforeEach assignment doesn't survive Jest's test-isolation in some cases. Existing tests get away with it because they all expect null and match real-fetch's 401 behavior; new positive-path tests must use the inline pattern. --------- Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>



Summary
Adds Spotify API integration to fetch user's top artists and tracks.
Changes
Test Coverage
Details
Related
Part 1 of 3-part Spotify OAuth integration (#680 split for focused review).