Skip to content

Commit 11cd372

Browse files
committed
test(api validation): check layout query validation boundaries
1 parent ed909d9 commit 11cd372

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
@@ -163,6 +163,14 @@ describe('GET /api/streak', () => {
163163
expect(fetchGitHubContributions).not.toHaveBeenCalled();
164164
});
165165

166+
it('returns 200 for unsupported ?layout query parameter values (route ignores it)', async () => {
167+
const response = await GET(
168+
new Request('http://localhost:3000/api/streak?user=octocat&layout=unsupported_layout')
169+
);
170+
171+
expect(response.status).toBe(200);
172+
});
173+
166174
it('should return 200 OK and valid SVG when the optional repo query parameter is provided', async () => {
167175
// 1. Make request with both parameters present
168176
const response = await GET(makeRequest({ user: 'octocat', repo: 'commitpulse' }));

0 commit comments

Comments
 (0)