Skip to content

Commit 58c4338

Browse files
committed
test(validations): verify view parameter behavior
1 parent 99c77fd commit 58c4338

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

lib/validations.test.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,3 +432,21 @@ describe('ogParamsSchema', () => {
432432
expect(result.user).toBe('unknown');
433433
});
434434
});
435+
436+
describe('streakParamsSchema — view fallback behavior', () => {
437+
it('accepts "default" as a valid view value', () => {
438+
expect(parse({ view: 'default' }).view).toBe('default');
439+
});
440+
441+
it('accepts "monthly" as a valid view value', () => {
442+
expect(parse({ view: 'monthly' }).view).toBe('monthly');
443+
});
444+
445+
it('falls back to "default" for unknown view value', () => {
446+
expect(parse({ view: 'radar' }).view).toBe('default');
447+
});
448+
449+
it('defaults to "default" when view is omitted', () => {
450+
expect(parse({}).view).toBe('default');
451+
});
452+
});

0 commit comments

Comments
 (0)