mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-19 19:11:13 +00:00
fix(HubSpot Node): Require DueDate for task creation (#18799)
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import { parseToTimestamp } from '../../V2/utils/parseToTimestamp';
|
||||
|
||||
describe('parseToTimestamp', () => {
|
||||
it('should convert a valid date string to a UTC Unix timestamp', () => {
|
||||
const dateString = '2023-10-05T14:48:00Z';
|
||||
const expectedTimestamp = 1696517280000;
|
||||
expect(parseToTimestamp(dateString)).toBe(expectedTimestamp);
|
||||
});
|
||||
|
||||
it('should throw an error for an invalid date string', () => {
|
||||
const invalidDateString = 'invalid-date';
|
||||
expect(() => parseToTimestamp(invalidDateString)).toThrow('Invalid date string');
|
||||
});
|
||||
|
||||
it('should throw an error when input is not a string', () => {
|
||||
const invalidDateString = 1234567890;
|
||||
expect(() => parseToTimestamp(invalidDateString)).toThrow('Invalid date string');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user