Skip to content

Commit eabc1b3

Browse files
authored
test(streak): verify unknown mode falls back to commits mode (JhaSourav07#2051)
## Description Fixes JhaSourav07#1091 ## Pillar - [x] 🛠️ Other (Bug fix, refactoring, docs) ## Visual Preview No visual changes — this is a test-only PR. ## Checklist before requesting a review: - [x] I have read the `CONTRIBUTING.md` file. - [x] I have tested these changes locally. - [x] I have run `npm run format` and `npm run lint` locally and resolved all errors. - [x] My commits follow the Conventional Commits format. - [x] I have made sure that i have only one commit to merge in this PR. - [x] I have starred the repo.
2 parents e48f3e0 + ac2d73c commit eabc1b3

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
@@ -1361,6 +1361,14 @@ describe('GET /api/streak', () => {
13611361
});
13621362
});
13631363

1364+
it('falls back to commits mode when ?mode=unknown is given', async () => {
1365+
const response = await GET(makeRequest({ user: 'octocat', mode: 'invalid' }));
1366+
1367+
expect(response.status).toBe(200);
1368+
const body = await response.text();
1369+
expect(body).toContain('<svg');
1370+
});
1371+
13641372
describe('org parameter validation', () => {
13651373
it('returns 400 when org parameter is a User instead of an Organization', async () => {
13661374
vi.mocked(getOrgDashboardData).mockRejectedValueOnce(

0 commit comments

Comments
 (0)