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:
@@ -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', () => {
|
||||
|
||||
Reference in New Issue
Block a user