Skip to content

Commit 55be6bd

Browse files
test: assert resolved position depth triggers the guard
Verify that the resolved position's depth is < 1 before calling getParentBlockInfo, ensuring we exercise the top-level branch. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 41bd668 commit 55be6bd

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

packages/core/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ describe("Test mergeBlocks", () => {
8282

8383
const beforePos = getPosBeforeSelectedBlock();
8484
const doc = getEditor()._tiptapEditor.state.doc;
85+
const $pos = doc.resolve(beforePos);
86+
87+
expect($pos.depth - 1).toBeLessThan(1);
88+
8589
const result = getParentBlockInfo(doc, beforePos);
8690

8791
expect(result).toBeUndefined();

0 commit comments

Comments
 (0)