Skip to content

Commit ceabe3b

Browse files
test(streak route): verify SVG contains <title> element for accessibility
1 parent 9b64cab commit ceabe3b

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
@@ -140,6 +140,14 @@ describe('GET /api/streak', () => {
140140
// The generator puts params.user.toUpperCase() in the SVG as the badge title.
141141
expect(body).toContain('OCTOCAT');
142142
});
143+
144+
it('should contain a <title> element with accessible label in the SVG response', async () => {
145+
const response = await GET(makeRequest({ user: 'octocat' }));
146+
const body = await response.text();
147+
148+
expect(body).toContain('<title>');
149+
expect(body).toContain('Stats for');
150+
});
143151
});
144152

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

0 commit comments

Comments
 (0)