fix(RSS Feed Trigger Node): Fix regression on missing timestamps (#10991)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2024-09-27 11:56:04 +02:00
committed by GitHub
parent fe7d060568
commit d2bc0760e2
2 changed files with 18 additions and 3 deletions

View File

@@ -46,6 +46,20 @@ describe('RssFeedReadTrigger', () => {
expect(pollData.lastItemDate).toEqual(newItemDate);
});
it('should gracefully handle missing timestamps', async () => {
const pollData = mock();
pollFunctions.getNodeParameter.mockReturnValue(feedUrl);
pollFunctions.getWorkflowStaticData.mockReturnValue(pollData);
(Parser.prototype.parseURL as jest.Mock).mockResolvedValue({ items: [{}, {}] });
const result = await node.poll.call(pollFunctions);
expect(result).toEqual(null);
expect(pollFunctions.getWorkflowStaticData).toHaveBeenCalledWith('node');
expect(pollFunctions.getNodeParameter).toHaveBeenCalledWith('feedUrl');
expect(Parser.prototype.parseURL).toHaveBeenCalledWith(feedUrl);
});
it('should return null if the feed is empty', async () => {
const pollData = mock({ lastItemDate });
pollFunctions.getNodeParameter.mockReturnValue(feedUrl);