Skip to content

Commit da13ea6

Browse files
authored
test(dashboard): add test for refresh param bypass cache (JhaSourav07#782)
## Description Fixes JhaSourav07#707 ## Pillar - [] 🎨 Pillar 1 β€” New Theme Design - [] πŸ“ Pillar 2 β€” Geometric SVG Improvement - [] πŸ• Pillar 3 β€” Timezone Logic Optimization - [x] πŸ› οΈ Other (Bug fix, refactoring, docs) ## Visual Preview ## Checklist before requesting a review: - [x] I have read the `CONTRIBUTING.md` file. - [x] I have tested these changes locally (`localhost:3000/api/streak?user=YOUR_USERNAME`). - [x] I have run `npm run format` and `npm run lint` locally and resolved all errors (CI will fail otherwise). - [x] My commits follow the Conventional Commits format (e.g., `feat(themes): ...`, `fix(calculate): ...`). - [] I have updated `README.md` if I added a new theme or URL parameter. - [x] I have started the repo. - [x] I have made sure that i have only one commit to merge in this PR. - [] The SVG output matches the CommitPulse "premium quality" aesthetic standard (no raw elements, smooth animations, correct fonts). - [x] (Recommended) I joined the CommitPulse Discord community for contributor discussions, mentorship, and faster PR support.
2 parents e85071d + 26ba403 commit da13ea6

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

β€Žapp/(root)/dashboard/[username]/page.test.tsxβ€Ž

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,19 @@ describe('DashboardPage', () => {
140140
expect(screen.getByText('Peak Streak: 15')).toBeDefined();
141141
expect(screen.getByText('Contributions: 500')).toBeDefined();
142142
});
143+
144+
it('calls getFullDashboardData with bypassCache: true when refresh param is set', async () => {
145+
const PageContent = await DashboardPage({
146+
params: Promise.resolve({ username: 'octocat' }),
147+
searchParams: Promise.resolve({ refresh: 'true' }),
148+
});
149+
150+
render(PageContent);
151+
152+
expect(getFullDashboardData).toHaveBeenCalledWith('octocat', {
153+
bypassCache: true,
154+
});
155+
});
143156
});
144157
it('passes the correct activity data to Heatmap', async () => {
145158
const PageContent = await DashboardPage({

0 commit comments

Comments
Β (0)