Skip to content

Commit d58db07

Browse files
committed
test(github route): verify ?repo= parameter is accepted by the schema
1 parent 581a63d commit d58db07

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

app/api/streak/route.test.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,17 @@ describe('GET /api/streak', () => {
127127

128128
expect(fetchGitHubContributions).not.toHaveBeenCalled();
129129
});
130+
131+
it('should return 200 OK and valid SVG when the optional repo query parameter is provided', async () => {
132+
// 1. Make request with both parameters present
133+
const response = await GET(makeRequest({ user: 'octocat', repo: 'commitpulse' }));
134+
135+
// 2. Assert definitions of done
136+
expect(response.status).toBe(200);
137+
138+
const textOutput = await response.text();
139+
expect(textOutput).toContain('<svg');
140+
});
130141
});
131142

132143
describe('successful response', () => {

0 commit comments

Comments
 (0)