From 25c7ba0926644065cb6271c491d1c5ce7e9c8689 Mon Sep 17 00:00:00 2001 From: lucaronin Date: Sat, 6 Jun 2026 04:24:52 +0200 Subject: [PATCH] test: cover stack-based null append recovery --- .../richEditorTransformErrorRecoveryExtension.test.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/richEditorTransformErrorRecoveryExtension.test.ts b/src/components/richEditorTransformErrorRecoveryExtension.test.ts index 601307cd..11daaa23 100644 --- a/src/components/richEditorTransformErrorRecoveryExtension.test.ts +++ b/src/components/richEditorTransformErrorRecoveryExtension.test.ts @@ -99,6 +99,10 @@ describe('isRecoverableEditorTransformError', () => { 'Block with ID 6c1c3bb4-e218-4f00-aaf5-40606852d286 not found', ))).toBe(true) expect(isRecoverableEditorTransformError(nullFragmentAppendError())).toBe(true) + const stackOnlyAppendError = nullFragmentAppendError("Cannot read properties of null (reading 'append')") + stackOnlyAppendError.stack = + "TypeError: Cannot read properties of null (reading 'append')\n at o.fillBefore(e).append (App-CrXlNLOq.js:1:1)" + expect(isRecoverableEditorTransformError(stackOnlyAppendError)).toBe(true) expect(isRecoverableEditorTransformError(new TypeError( "Cannot read properties of null (reading 'append')", ))).toBe(false)