Skip to content

Commit 7ba303b

Browse files
authored
test(streak route): verify SVG contains <title> element for accessibility (JhaSourav07#1118)
## Description Fixes JhaSourav07#701 ## Pillar - [ ] 🎨 Pillar 1 — New Theme Design - [ ] 📐 Pillar 2 — Geometric SVG Improvement - [ ] 🕐 Pillar 3 — Timezone Logic Optimization - [x] 🛠️ Other (Bug fix, refactoring, docs) ## Visual Preview N/A — test-only change. ## Checklist before requesting a review: - [x] I have read the `CONTRIBUTING.md` file. - [x] I have tested these changes locally (`localhost:3000/api/streak?user=YOUR_USERNAME`). - [x] I have run `npm run format` and `npm run lint` locally and resolved all errors (CI will fail otherwise). - [x] My commits follow the Conventional Commits format (e.g., `feat(themes): ...`, `fix(calculate): ...`). - [x] I have updated `README.md` if I added a new theme or URL parameter. N/A. - [x] I have started the repo. - [x] I have made sure that i have only one commit to merge in this PR. - [x] The SVG output matches the CommitPulse "premium quality" aesthetic standard (no raw elements, smooth animations, correct fonts). N/A. - [x] (Recommended) I joined the CommitPulse Discord community for contributor discussions, mentorship, and faster PR support.
2 parents 6f654b6 + ceabe3b commit 7ba303b

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
@@ -151,6 +151,14 @@ describe('GET /api/streak', () => {
151151
// The generator puts params.user.toUpperCase() in the SVG as the badge title.
152152
expect(body).toContain('OCTOCAT');
153153
});
154+
155+
it('should contain a <title> element with accessible label in the SVG response', async () => {
156+
const response = await GET(makeRequest({ user: 'octocat' }));
157+
const body = await response.text();
158+
159+
expect(body).toContain('<title>');
160+
expect(body).toContain('Stats for');
161+
});
154162
});
155163

156164
describe('cache-control header', () => {

0 commit comments

Comments
 (0)