Skip to content

Commit bf00d65

Browse files
test(streak): verify unknown mode falls back to commits mode
1 parent a4dcf09 commit bf00d65

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
@@ -1324,6 +1324,14 @@ describe('GET /api/streak', () => {
13241324
});
13251325
});
13261326

1327+
it('falls back to commits mode when ?mode=unknown is given', async () => {
1328+
const response = await GET(makeRequest({ user: 'octocat', mode: 'invalid' }));
1329+
1330+
expect(response.status).toBe(200);
1331+
const body = await response.text();
1332+
expect(body).toContain('<svg');
1333+
});
1334+
13271335
describe('org parameter validation', () => {
13281336
it('returns 400 when org parameter is a User instead of an Organization', async () => {
13291337
vi.mocked(getOrgDashboardData).mockRejectedValueOnce(

0 commit comments

Comments
 (0)