Skip to content

Commit 9019264

Browse files
committed
test(validation): check query validation boundaries for org param
1 parent a4dcf09 commit 9019264

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

lib/validations.test.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -681,6 +681,18 @@ describe('streakParamsSchema — org parameter validation', () => {
681681
expect(fieldError).toBe('Invalid organization name format');
682682
}
683683
});
684+
685+
it('should reject org parameter with invalid alphanumeric format', () => {
686+
const result = streakParamsSchema.safeParse({
687+
user: 'octocat',
688+
org: 'invalid_org_name_with_spaces',
689+
});
690+
691+
expect(result.success).toBe(false);
692+
if (!result.success) {
693+
expect(result.error.flatten().fieldErrors.org?.[0]).toBe('Invalid organization name format');
694+
}
695+
});
684696
});
685697

686698
describe('ogParamsSchema', () => {

0 commit comments

Comments
 (0)