Skip to content

Commit be31c47

Browse files
Deepthii PDeepthii P
authored andcommitted
test: add invalid bg hex validation coverage
1 parent e3369ea commit be31c47

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

app/api/streak/route.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -943,7 +943,11 @@ describe('GET /api/streak', () => {
943943
expect(body.details).not.toBeNull();
944944
});
945945
});
946+
it('returns 400 when an invalid hex color is passed as bg', async () => {
947+
const response = await GET(makeRequest({ user: 'octocat', bg: '#ZZZZZZ' }));
946948

949+
expect(response.status).toBe(400);
950+
});
947951
describe('hide parameters', () => {
948952
it('removes the username title when hide_title=true', async () => {
949953
const response = await GET(makeRequest({ user: 'octocat', hide_title: 'true' }));

0 commit comments

Comments
 (0)