fix: recover invalid editor block joins
This commit is contained in:
@@ -61,6 +61,9 @@ describe('isRecoverableEditorTransformError', () => {
|
||||
expect(isRecoverableEditorTransformError(new RangeError(
|
||||
'Invalid content for node blockContainer: <paragraph("Procedures are long-running"), blockGroup(blockContainer(bulletListItem("Step")))>',
|
||||
))).toBe(true)
|
||||
expect(isRecoverableEditorTransformError(transformError(
|
||||
'Cannot join blockGroup onto blockContainer',
|
||||
))).toBe(true)
|
||||
expect(isRecoverableEditorTransformError(new RangeError(
|
||||
'Inserted content deeper than insertion position',
|
||||
))).toBe(true)
|
||||
@@ -111,6 +114,13 @@ describe('installRichEditorTransformErrorRecovery', () => {
|
||||
)
|
||||
})
|
||||
|
||||
it('repairs invalid block joins after pull refreshes editor state', () => {
|
||||
expectDocumentRepairRecovery(
|
||||
transformError('Cannot join blockGroup onto blockContainer'),
|
||||
'invalid_block_join',
|
||||
)
|
||||
})
|
||||
|
||||
it('recovers table selection transactions whose target row changed underneath BlockNote', () => {
|
||||
expectDocumentRepairRecovery(
|
||||
new RangeError('Index 1 out of range for <tableRow(tableCell(tableParagraph("A")))>'),
|
||||
|
||||
Reference in New Issue
Block a user