MCPcopy Index your code
hub / github.com/adobe/react-spectrum / pointerEvent

Function pointerEvent

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

Source from the content-addressed store, hash-verified

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

Callers 1

dnd.test.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected