-
Notifications
You must be signed in to change notification settings - Fork 8.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(Notion Node): Block with text results in a body validation error (#…
- Loading branch information
1 parent
122c914
commit 8e49f65
Showing
2 changed files
with
34 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
packages/nodes-base/nodes/Notion/test/GenericFunctions.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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', | ||
}, | ||
}, | ||
], | ||
}, | ||
}, | ||
]); | ||
}); | ||
}); |