Skip to content

Commit ed909d9

Browse files
committed
test(api validation): check date query validation boundaries
1 parent 6ede310 commit ed909d9

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

app/api/streak/route.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,11 @@ describe('GET /api/streak', () => {
461461
expect(body.details.fieldErrors.year[0]).toContain('GitHub was founded in 2008');
462462
});
463463

464+
it('returns 200 for unknown ?date= parameter (not part of schema)', async () => {
465+
const response = await GET(makeRequest({ user: 'octocat', date: '2026-15-40' }));
466+
expect(response.status).toBe(200);
467+
});
468+
464469
it('returns 400 for malformed numeric year', async () => {
465470
const response = await GET(makeRequest({ user: 'octocat', year: '100000' }));
466471
const body = await response.json();

0 commit comments

Comments
 (0)