Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions app/api/streak/route.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,35 @@ describe('GET /api/streak', () => {
expect(body).toContain('<title>');
expect(body).toContain('Stats for');
});

it('returns a small SVG when size=small', async () => {
const response = await GET(makeRequest({ user: 'octocat', size: 'small' }));

expect(response.status).toBe(200);

const body = await response.text();
expect(body).toContain('width="400"');
expect(body).toContain('height="280"');
});

it('returns the default medium SVG when size is omitted', async () => {
const response = await GET(makeRequest({ user: 'octocat' }));

expect(response.status).toBe(200);

const body = await response.text();
expect(body).toContain('width="600"');
});

it('returns a large SVG when size=large', async () => {
const response = await GET(makeRequest({ user: 'octocat', size: 'large' }));

expect(response.status).toBe(200);

const body = await response.text();
expect(body).toContain('width="800"');
expect(body).toContain('height="560"');
});
});

describe('edge cases for empty/private profiles', () => {
Expand Down
Loading
Loading