Skip to content

Commit ba9ce48

Browse files
committed
test(validation): check query validation boundaries for theme param
1 parent ea059a6 commit ba9ce48

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

lib/validations.test.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -663,6 +663,15 @@ describe('ogParamsSchema', () => {
663663
const result = ogParamsSchema.parse({});
664664
expect(result.user).toBe('unknown');
665665
});
666+
667+
it('should fallback to "dark" when an invalid theme is provided', () => {
668+
const result = ogParamsSchema.safeParse({ theme: 'nonexistent_theme_name' });
669+
670+
expect(result.success).toBe(true);
671+
if (result.success) {
672+
expect(result.data.theme).toBe('dark');
673+
}
674+
});
666675
});
667676

668677
describe('streakParamsSchema — view fallback behavior', () => {

0 commit comments

Comments
 (0)