n8n/packages/nodes-base/nodes/Notion/test/GenericFunctions.test.ts

34 lines
538 B
TypeScript

import { formatBlocks } from '../shared/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',
},
},
],
},
},
]);
});
});