MCPcopy
hub / github.com/callstack/react-native-testing-library / buildTouchEvent

Function buildTouchEvent

src/event-builder/common.ts:8–24  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6 * - Android: `{"changedTouches": [[Circular]], "identifier": 0, "locationX": 160, "locationY": 40.3636360168457, "pageX": 180, "pageY": 140.36363220214844, "target": 53, "targetSurface": -1, "timestamp": 10290805, "touches": [[Circular]]}`
7 */
8export function buildTouchEvent() {
9 return {
10 ...baseSyntheticEvent(),
11 nativeEvent: {
12 changedTouches: [] as unknown[],
13 identifier: 0,
14 locationX: 0,
15 locationY: 0,
16 pageX: 0,
17 pageY: 0,
18 target: 0,
19 timestamp: Date.now(),
20 touches: [] as unknown[],
21 },
22 currentTarget: { measure: () => {} },
23 };
24}
25
26export type TouchEvent = ReturnType<typeof buildTouchEvent>;
27

Callers 7

fire-event.tsFile · 0.90
emitDirectPressEventsFunction · 0.90
typeFunction · 0.90
common.test.tsFile · 0.90
buildResponderGrantEventFunction · 0.85

Calls 1

baseSyntheticEventFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…