Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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')])]);
Expand All @@ -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();
Expand Down
Loading