Isolate block drag handles from selection and editing
This commit is contained in:
1 parent
640dadaa75
commit
01c1aa567e
3 files changed
+15
-1
No files matched your search
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user