Skip to content

Commit 5549f70

Browse files
committed
test(validation): check query validation boundaries for user max length
1 parent 6c0074e commit 5549f70

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

lib/validations.test.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,17 @@ describe('streakParamsSchema', () => {
252252
}
253253
});
254254

255+
it('should reject user values longer than 39 characters', () => {
256+
const result = streakParamsSchema.safeParse({
257+
user: 'a'.repeat(40),
258+
});
259+
260+
expect(result.success).toBe(false);
261+
if (!result.success) {
262+
expect(result.error.issues[0]?.message).toContain('cannot exceed 39 characters');
263+
}
264+
});
265+
255266
it('should fail when user is whitespace-only input', () => {
256267
const result = streakParamsSchema.safeParse({
257268
user: ' ',

0 commit comments

Comments
 (0)