MCPcopy Create free account
hub / github.com/adobe/react-spectrum / pointerEvent

Function pointerEvent

packages/react-aria/test/dnd/dnd.test.js:32–48  ·  view source on GitHub ↗
(type, opts)

Source from the content-addressed store, hash-verified

30import userEvent from '@testing-library/user-event';
31
32function pointerEvent(type, opts) {
33 let evt = new Event(type, {bubbles: true, cancelable: true});
34 Object.assign(
35 evt,
36 {
37 ctrlKey: false,
38 metaKey: false,
39 shiftKey: false,
40 altKey: false,
41 button: opts.button || 0,
42 width: 1,
43 height: 1
44 },
45 opts
46 );
47 return evt;
48}
49
50describe('useDrag and useDrop', function () {
51 let user;

Callers 1

dnd.test.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected