mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 17:46:45 +00:00
feat(Email Trigger (IMAP) Node): IMAP trigger node returns message UIDs (#13152)
This commit is contained in:
@@ -16,6 +16,7 @@ describe('Test IMap V2 utils', () => {
|
|||||||
const message = {
|
const message = {
|
||||||
attributes: {
|
attributes: {
|
||||||
uuid: 1,
|
uuid: 1,
|
||||||
|
uid: 873,
|
||||||
struct: {},
|
struct: {},
|
||||||
},
|
},
|
||||||
parts: [
|
parts: [
|
||||||
@@ -25,7 +26,6 @@ describe('Test IMap V2 utils', () => {
|
|||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
const staticData: IDataObject = {};
|
|
||||||
const imapConnection = mock<ImapSimple>({
|
const imapConnection = mock<ImapSimple>({
|
||||||
search: jest.fn().mockReturnValue(Promise.resolve([message])),
|
search: jest.fn().mockReturnValue(Promise.resolve([message])),
|
||||||
});
|
});
|
||||||
@@ -42,6 +42,9 @@ describe('Test IMap V2 utils', () => {
|
|||||||
headers: { '': 'Body content' },
|
headers: { '': 'Body content' },
|
||||||
headerLines: undefined,
|
headerLines: undefined,
|
||||||
html: false,
|
html: false,
|
||||||
|
attributes: {
|
||||||
|
uid: 873,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
binary: undefined,
|
binary: undefined,
|
||||||
},
|
},
|
||||||
@@ -55,6 +58,9 @@ describe('Test IMap V2 utils', () => {
|
|||||||
metadata: {
|
metadata: {
|
||||||
'0': 'h',
|
'0': 'h',
|
||||||
},
|
},
|
||||||
|
attributes: {
|
||||||
|
uid: 873,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -67,6 +73,9 @@ describe('Test IMap V2 utils', () => {
|
|||||||
];
|
];
|
||||||
|
|
||||||
expectedResults.forEach(async (expectedResult) => {
|
expectedResults.forEach(async (expectedResult) => {
|
||||||
|
// use new staticData for each iteration
|
||||||
|
const staticData: IDataObject = {};
|
||||||
|
|
||||||
triggerFunctions.getNodeParameter
|
triggerFunctions.getNodeParameter
|
||||||
.calledWith('format')
|
.calledWith('format')
|
||||||
.mockReturnValue(expectedResult.format);
|
.mockReturnValue(expectedResult.format);
|
||||||
|
|||||||
@@ -149,6 +149,9 @@ export async function getNewEmails(
|
|||||||
textHtml: await getText(parts, message, 'html'),
|
textHtml: await getText(parts, message, 'html'),
|
||||||
textPlain: await getText(parts, message, 'plain'),
|
textPlain: await getText(parts, message, 'plain'),
|
||||||
metadata: {} as IDataObject,
|
metadata: {} as IDataObject,
|
||||||
|
attributes: {
|
||||||
|
uid: message.attributes.uid,
|
||||||
|
} as IDataObject,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user