Skip to content

Commit 5ad4bd2

Browse files
authored
Test(streak)/year-2007-boundary-validation (JhaSourav07#779)
* test(streak): add text colour parameter route tests * chore: restore package-lock.json to upstream version * test(streak): add boundary test for year 2007 before GitHub founding
1 parent f4da6cd commit 5ad4bd2

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

app/api/streak/route.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,14 @@ describe('GET /api/streak', () => {
323323
expect(body.details.fieldErrors.year[0]).toContain('GitHub was founded in 2008');
324324
});
325325

326+
it('returns 400 for the year=2007(before GitHub was founded)', async () => {
327+
const response = await GET(makeRequest({ user: 'octocat', year: '2007' }));
328+
const body = await response.json();
329+
330+
expect(response.status).toBe(400);
331+
expect(body.details.fieldErrors.year[0]).toContain('GitHub was founded in 2008');
332+
});
333+
326334
it('returns 400 for future years', async () => {
327335
const futureYear = (new Date().getFullYear() + 1).toString();
328336

0 commit comments

Comments
 (0)