feat: Implement comprehensive validation system for DailyNotification
- Add URL requirement validation - Add time format validation (24-hour format) - Add timezone validation using Intl.DateTimeFormat - Add retry count and interval range validation - Add content handler validation with timeout support - Add basic schedule conflict detection - Update validation to run before plugin calls - Make validation methods async for content handler testing - All validation now happens in DailyNotification class before calling native plugin
This commit is contained in:
@@ -174,7 +174,7 @@ describe('DailyNotification Edge Cases', () => {
|
||||
}
|
||||
},
|
||||
})
|
||||
).rejects.toThrow('Invalid response format');
|
||||
).rejects.toThrow('Content handler validation failed');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -200,9 +200,8 @@ describe('DailyNotification Edge Cases', () => {
|
||||
it('should handle invalid content handler responses', async () => {
|
||||
const invalidHandler = async () => {
|
||||
return {
|
||||
title: 'Invalid Content',
|
||||
title: '', // Empty title should fail validation
|
||||
body: 'Missing required data',
|
||||
// Missing required fields
|
||||
data: { timestamp: new Date().toISOString() },
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user