Isolate block drag handles from selection and editing
Quality / quality (ubuntu-latest) (push) Failing after 10m0s
Quality / quality (windows-latest) (push) Canceled after 0s

This commit is contained in:
Clintchiz committed 2026-09-05 21:10:10 +05:30
1 parent 640dadaa75
commit 01c1aa567e
3 files changed
+15 -1

No files matched your search

+10
View File
@@ -20,6 +20,16 @@ test("canvas annotates exact node locations and cleans editor decorations withou
expect(column.getAttribute("data-block-slot")).toBe("content");
expect(column.getAttribute("draggable")).toBe("false");
expect(root.querySelectorAll("[data-block-handle]")).toHaveLength(1);
const handle = root.querySelector("[data-block-handle]")!;
let clicks = 0, pointers = 0;
column.addEventListener("click", () => clicks++);
column.addEventListener("dblclick", () => clicks++);
column.addEventListener("pointerdown", () => pointers++);
handle.dispatchEvent(new window.MouseEvent("click", { bubbles: true }));
handle.dispatchEvent(new window.MouseEvent("dblclick", { bubbles: true }));
handle.dispatchEvent(new window.PointerEvent("pointerdown", { bubbles: true }));
expect(clicks).toBe(0);
expect(pointers).toBe(1);
expect(root.querySelector("[data-block-slot-target]")?.getAttribute("data-block-parent")).toBe("column");
expect(JSON.stringify(tree)).toBe(before);
mounted.destroy(); mounted.destroy();