Skip to content
Merged
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
5 changes: 3 additions & 2 deletions app/api/streak/route.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -722,9 +722,10 @@ describe('GET /api/streak', () => {

expect(response.status).toBe(400);
});

it('returns 400 when an invalid hex color is passed as accent', async () => {
// #ZZZZZZZ contains non-hex characters β€” schema must reject it with 400
const response = await GET(makeRequest({ user: 'octocat', accent: '#ZZZZZZZ' }));
// #ZZZZZZ contains non-hex characters β€” schema must reject it with 400
const response = await GET(makeRequest({ user: 'octocat', accent: '#ZZZZZZ' }));

expect(response.status).toBe(400);
});
Expand Down
6 changes: 3 additions & 3 deletions lib/validations.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -717,11 +717,11 @@ describe('streakParamsSchema β€” view fallback behavior', () => {
});

describe('streakParamsSchema β€” accent parameter HEX color validation', () => {
it('rejects an invalid hex color like "#ZZZZZZZ" for accent', () => {
// #ZZZZZZZ contains non-hex characters β€” must fail schema validation
it('rejects an invalid hex color like "#ZZZZZZ" for accent', () => {
// #ZZZZZZ contains non-hex characters β€” must fail schema validation
const result = streakParamsSchema.safeParse({
user: 'octocat',
accent: '#ZZZZZZZ',
accent: '#ZZZZZZ',
});

expect(result.success).toBe(false);
Expand Down
Loading