diff --git a/packages/super-editor/src/extensions/field-annotation/cleanup-commands/cleanUpParagraphWithAnnotation.test.js b/packages/super-editor/src/extensions/field-annotation/cleanup-commands/cleanUpParagraphWithAnnotation.test.js index 1c475245f8..d215a004f2 100644 --- a/packages/super-editor/src/extensions/field-annotation/cleanup-commands/cleanUpParagraphWithAnnotation.test.js +++ b/packages/super-editor/src/extensions/field-annotation/cleanup-commands/cleanUpParagraphWithAnnotation.test.js @@ -27,6 +27,10 @@ const textContent = (docNode) => docNode.textContent; const mockHelperPath = '../fieldAnnotationHelpers/index.js'; describe('cleanUpParagraphWithAnnotations - test range error crash', () => { + beforeEach(() => { + vi.resetModules(); + }); + /** Test to fix error in position out of range in original */ it('throws RangeError "Position … out of range" on single-paragraph doc', async () => { const doc = schema.node('doc', null, [p.createAndFill(null, [text('A')])]); @@ -49,15 +53,6 @@ describe('cleanUpParagraphWithAnnotations - test range error crash', () => { }); }); -if (!Object.getOwnPropertyDescriptor(PMNode.prototype, 'children')) { - Object.defineProperty(PMNode.prototype, 'children', { - get() { - return { length: this.childCount }; - }, - configurable: true, - }); -} - describe('cleanUpParagraphWithAnnotations – original behavior', () => { beforeEach(() => { vi.resetModules();