AI Implementation feature(883): Admin Area General Settings and Categories 1.01 (#23)

This commit was merged in pull request #23.
This commit is contained in:
2026-07-22 12:32:00 +00:00
parent fac3179427
commit 0a2b2664b4
9 changed files with 171 additions and 89 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', () => {