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:
Matthew Raymer
2025-08-12 10:03:09 +00:00
parent e51f884e00
commit a92c408790
3 changed files with 53 additions and 6 deletions
+2 -3
View File
@@ -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() },
};
};