Skip to content

Commit 4003c2e

Browse files
committed
test(svg): add year parameter route test
1 parent e15a46a commit 4003c2e

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

app/api/streak/route.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,16 @@ describe('GET /api/streak', () => {
249249
expect(response.status).toBe(200);
250250
});
251251

252+
it('passes correct from/to range when ?year=2023 is provided', async () => {
253+
await GET(makeRequest({ user: 'octocat', year: '2023' }));
254+
255+
expect(fetchGitHubContributions).toHaveBeenCalledWith('octocat', {
256+
bypassCache: false,
257+
from: '2023-01-01T00:00:00Z',
258+
to: '2023-12-31T23:59:59Z',
259+
});
260+
});
261+
252262
it('functions normally when the year parameter is missing', async () => {
253263
const response = await GET(makeRequest({ user: 'octocat' }));
254264

0 commit comments

Comments
 (0)