diff --git a/packages/nodes-base/nodes/Notion/GenericFunctions.ts b/packages/nodes-base/nodes/Notion/GenericFunctions.ts index 6dced42752b0a6..3305e4418d9ed9 100644 --- a/packages/nodes-base/nodes/Notion/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Notion/GenericFunctions.ts @@ -307,7 +307,7 @@ export function formatBlocks(blocks: IDataObject[]) { ...(block.type === 'to_do' ? { checked: block.checked } : {}), ...(block.type === 'image' ? { type: 'external', external: { url: block.url } } : {}), // prettier-ignore, - ...(!['to_do', 'image'].includes(block.type as string) ? getTextBlocks(block) : {}), + ...(!['image'].includes(block.type as string) ? getTextBlocks(block) : {}), }, }); } diff --git a/packages/nodes-base/nodes/Notion/test/GenericFunctions.test.ts b/packages/nodes-base/nodes/Notion/test/GenericFunctions.test.ts new file mode 100644 index 00000000000000..288aa4e11091cc --- /dev/null +++ b/packages/nodes-base/nodes/Notion/test/GenericFunctions.test.ts @@ -0,0 +1,33 @@ +import { formatBlocks } from '../GenericFunctions'; + +describe('Test NotionV2, formatBlocks', () => { + it('should format to_do block', () => { + const blocks = [ + { + type: 'to_do', + checked: false, + richText: false, + textContent: 'Testing', + }, + ]; + + const result = formatBlocks(blocks); + + expect(result).toEqual([ + { + object: 'block', + type: 'to_do', + to_do: { + checked: false, + text: [ + { + text: { + content: 'Testing', + }, + }, + ], + }, + }, + ]); + }); +});