Skip to content

Commit 26ba403

Browse files
committed
test(dashboard): add test for refresh param bypass cache
1 parent af1274e commit 26ba403

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
@@ -134,5 +134,18 @@ describe('DashboardPage', () => {
134134
expect(screen.getByText('Peak Streak: 15')).toBeDefined();
135135
expect(screen.getByText('Contributions: 500')).toBeDefined();
136136
});
137+
138+
it('calls getFullDashboardData with bypassCache: true when refresh param is set', async () => {
139+
const PageContent = await DashboardPage({
140+
params: Promise.resolve({ username: 'octocat' }),
141+
searchParams: Promise.resolve({ refresh: 'true' }),
142+
});
143+
144+
render(PageContent);
145+
146+
expect(getFullDashboardData).toHaveBeenCalledWith('octocat', {
147+
bypassCache: true,
148+
});
149+
});
137150
});
138151
});

0 commit comments

Comments
 (0)