feat: Admin Area General Settings and Categories 1.01

This commit is contained in:
OpenVelo Agent
2026-07-22 12:31:57 +00:00
parent 5470623197
commit 86ab3e7f1b
7 changed files with 161 additions and 86 deletions
@@ -56,6 +56,37 @@ describe('GeneralSettingsSchema - validation rules', () => {
});
expect(r.success).toBe(true);
});
it('rejects a whitespace-only pageTitle', () => {
const r = GeneralSettingsSchema.safeParse({
pageTitle: ' ',
logo: '',
welcomeMarkdown: '',
themeKey: 'classic',
eventStartUtc: '2026-01-01T00:00:00Z',
eventEndUtc: '2026-02-01T00:00:00Z',
defaultChallengeIp: '127.0.0.1',
registrationsEnabled: false,
});
expect(r.success).toBe(false);
});
it('trims surrounding whitespace from a valid pageTitle', () => {
const r = GeneralSettingsSchema.safeParse({
pageTitle: ' OpenVelo ',
logo: '',
welcomeMarkdown: '',
themeKey: 'classic',
eventStartUtc: '2026-01-01T00:00:00Z',
eventEndUtc: '2026-02-01T00:00:00Z',
defaultChallengeIp: '127.0.0.1',
registrationsEnabled: false,
});
expect(r.success).toBe(true);
if (r.success) {
expect(r.data.pageTitle).toBe('OpenVelo');
}
});
});
describe('AdminGeneralService.updateSettings - happy path', () => {