Skip to content

Commit 6be4353

Browse files
committed
test(utils): check date range formatter boundary robustness (JhaSourav07#1564)
1 parent 4538996 commit 6be4353

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
@@ -437,6 +437,16 @@ describe('GET /api/streak', () => {
437437
});
438438
});
439439

440+
it('passes correct from/to range when ?year=2008 is provided', async () => {
441+
await GET(makeRequest({ user: 'octocat', year: '2008' }));
442+
443+
expect(fetchGitHubContributions).toHaveBeenCalledWith('octocat', {
444+
bypassCache: false,
445+
from: '2008-01-01T00:00:00Z',
446+
to: '2008-12-31T23:59:59Z',
447+
});
448+
});
449+
440450
it('functions normally when the year parameter is missing', async () => {
441451
const response = await GET(makeRequest({ user: 'octocat' }));
442452

0 commit comments

Comments
 (0)