Skip to content

Commit e2a3c87

Browse files
committed
test: cover auto theme in streak route
1 parent e15a46a commit e2a3c87

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

app/api/streak/route.test.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,15 @@ describe('GET /api/streak', () => {
297297
expect(response.status).toBe(200);
298298
});
299299

300+
it('returns auto-theme SVG markup with dark-mode CSS variables when theme=auto', async () => {
301+
const response = await GET(makeRequest({ user: 'octocat', theme: 'auto' }));
302+
const body = await response.text();
303+
304+
expect(response.status).toBe(200);
305+
expect(body).toContain('prefers-color-scheme: dark');
306+
expect(body).toContain('--cp-bg');
307+
});
308+
300309
it('falls back to the dark theme without crashing when an unknown theme is given', async () => {
301310
const response = await GET(makeRequest({ user: 'octocat', theme: 'does-not-exist' }));
302311
const body = await response.text();

0 commit comments

Comments
 (0)