MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / pointer

Function pointer

graph-ui/src/graph/useGraphBackgroundReset.test.tsx:22–26  ·  view source on GitHub ↗
(target: Element, type: string, x = 10, y = 10, changes: { button?: number; pointerId?: number; isPrimary?: boolean } = {})

Source from the content-addressed store, hash-verified

20 return { reset, canvas: host.querySelector('canvas')!, label: host.querySelector('button')! };
21}
22function pointer(target: Element, type: string, x = 10, y = 10, changes: { button?: number; pointerId?: number; isPrimary?: boolean } = {}) {
23 const event = new MouseEvent(type, { bubbles: true, clientX: x, clientY: y, button: changes.button ?? 0 });
24 Object.defineProperties(event, { pointerId: { value: changes.pointerId ?? 1 }, isPrimary: { value: changes.isPrimary ?? true } });
25 target.dispatchEvent(event);
26}
27it('reports an empty-canvas click only after a primary click on genuinely empty canvas (the caller decides what it clears, K9)', async () => {
28 const { reset, canvas } = await setup();
29 pointer(canvas, 'pointerdown'); pointer(canvas, 'pointerup'); pointer(canvas, 'click');

Calls

no outgoing calls

Tested by

no test coverage detected