Skip to content

Commit b0eb569

Browse files
nperez0111claude
andcommitted
test(core): use editor.unmount() instead of _tiptapEditor.destroy()
unmount() is the public API for tearing down a BlockNoteEditor and handles portalElement cleanup in addition to the underlying prosemirror teardown. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 25c2604 commit b0eb569

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

packages/core/src/blocks/ListItem/NumberedListItem/IndexingPlugin.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ import { BlockNoteEditor } from "../../../editor/BlockNoteEditor.js";
99

1010
const PLUGIN_KEY = "numbered-list-indexing-decorations$";
1111

12-
// Track editors created in each test so we can destroy them in afterEach —
12+
// Track editors created in each test so we can unmount them in afterEach —
1313
// otherwise prosemirror-view's DOMObserver leaves a setTimeout alive that
1414
// fires after vitest tears down jsdom, throwing
1515
// `ReferenceError: document is not defined` and failing the run.
1616
const activeEditors: BlockNoteEditor<any, any, any>[] = [];
1717

1818
afterEach(() => {
1919
while (activeEditors.length) {
20-
activeEditors.pop()!._tiptapEditor.destroy();
20+
activeEditors.pop()!.unmount();
2121
}
2222
});
2323

0 commit comments

Comments
 (0)