Skip to content

Commit 8f64bf8

Browse files
committed
test(validation): check query validation boundaries for accent param
1 parent 0e9b7a6 commit 8f64bf8

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

lib/validations.test.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,20 @@ describe('streakParamsSchema — accent parameter HEX color validation', () => {
727727
expect(result.success).toBe(false);
728728
});
729729

730+
it('rejects the invalid boundary hex color "#ZZZZZZ" for accent', () => {
731+
const result = streakParamsSchema.safeParse({
732+
user: 'octocat',
733+
accent: '#ZZZZZZ',
734+
});
735+
736+
expect(result.success).toBe(false);
737+
if (!result.success) {
738+
expect(result.error.issues[0]?.message).toContain(
739+
'accent must be a valid 3 or 6 character hex color without #'
740+
);
741+
}
742+
});
743+
730744
it('accepts a valid 6-character hex color for accent', () => {
731745
const result = streakParamsSchema.safeParse({
732746
user: 'octocat',

0 commit comments

Comments
 (0)