feat: Admin Area General Settings and Categories 1.06
This commit is contained in:
@@ -141,7 +141,7 @@ describe('GeneralSettingsSchema - validation rules', () => {
|
||||
expect(r.success).toBe(false);
|
||||
});
|
||||
|
||||
it('accepts empty strings (unconfigured event window) for both datetime fields', () => {
|
||||
it('rejects empty strings for event datetime fields with per-field messages (Job 888)', () => {
|
||||
const r = GeneralSettingsSchema.safeParse({
|
||||
pageTitle: 'T',
|
||||
logo: '',
|
||||
@@ -152,7 +152,12 @@ describe('GeneralSettingsSchema - validation rules', () => {
|
||||
defaultChallengeIp: '127.0.0.1',
|
||||
registrationsEnabled: false,
|
||||
});
|
||||
expect(r.success).toBe(true);
|
||||
expect(r.success).toBe(false);
|
||||
if (r.success) return;
|
||||
const startIssue = r.error.issues.find((i) => i.path.join('.') === 'eventStartUtc');
|
||||
const endIssue = r.error.issues.find((i) => i.path.join('.') === 'eventEndUtc');
|
||||
expect(startIssue?.message).toBe('eventStartUtc must be a valid ISO-8601 datetime');
|
||||
expect(endIssue?.message).toBe('eventEndUtc must be a valid ISO-8601 datetime');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user