(target: Element, type: string, x = 10, y = 10, changes: { button?: number; pointerId?: number; isPrimary?: boolean } = {})
| 20 | return { reset, canvas: host.querySelector('canvas')!, label: host.querySelector('button')! }; |
| 21 | } |
| 22 | function 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 | } |
| 27 | it('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'); |
no outgoing calls
no test coverage detected