Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@
const panGesture = renderHook(() =>
usePanGesture({
disableReanimated: true,
onBegin: (e) => onBegin(e),

Check warning on line 58 in packages/react-native-gesture-handler/src/__tests__/api_v3.test.tsx

View workflow job for this annotation

GitHub Actions / check

Unsafe return of an `any` typed value
onActivate: (e) => onStart(e),

Check warning on line 59 in packages/react-native-gesture-handler/src/__tests__/api_v3.test.tsx

View workflow job for this annotation

GitHub Actions / check

Unsafe return of an `any` typed value
})
).result.current;

Expand Down Expand Up @@ -84,8 +84,8 @@
const panGesture = renderHook(() =>
usePanGesture({
disableReanimated: true,
onUpdate: (e) => onUpdate(e),

Check warning on line 87 in packages/react-native-gesture-handler/src/__tests__/api_v3.test.tsx

View workflow job for this annotation

GitHub Actions / check

Unsafe return of an `any` typed value
onTouchesUp: (e) => onTouchesUp(e),

Check warning on line 88 in packages/react-native-gesture-handler/src/__tests__/api_v3.test.tsx

View workflow job for this annotation

GitHub Actions / check

Unsafe return of an `any` typed value
})
).result.current;

Expand All @@ -102,7 +102,7 @@

expect(() => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
jsEventHandler?.(malformedTouchEvent as any);

Check warning on line 105 in packages/react-native-gesture-handler/src/__tests__/api_v3.test.tsx

View workflow job for this annotation

GitHub Actions / check

Unsafe argument of type `any` assigned to a parameter of type `GestureHandlerEventWithHandlerData<PanHandlerData, PanExtendedHandlerData>`
}).not.toThrow();

expect(onUpdate).not.toHaveBeenCalled();
Expand All @@ -115,7 +115,7 @@
const panGesture = renderHook(() =>
usePanGesture({
disableReanimated: true,
onUpdate: (e) => onUpdate(e),

Check warning on line 118 in packages/react-native-gesture-handler/src/__tests__/api_v3.test.tsx

View workflow job for this annotation

GitHub Actions / check

Unsafe return of an `any` typed value
})
).result.current;

Expand Down Expand Up @@ -256,14 +256,14 @@

await act(flushImmediate);

const nativeDetector = getNativeDetector(UNSAFE_getAllByType);
const scrollViewResponder = getScrollViewResponder(UNSAFE_getAllByType);
const button = screen.getByTestId('pressable');

expect(scrollViewResponder).toBeDefined();
expect(
scrollViewResponder?.props.onStartShouldSetResponderCapture()
).toBe(false);
expect(nativeDetector?.props.onStartShouldSetResponder()).toBe(false);
expect(button.props.onStartShouldSetResponderCapture()).toBe(false);
expect(scrollViewResponder?.props.onStartShouldSetResponder()).toBe(true);
expect(scrollViewResponder?.props.onStartShouldSetResponder()).toBe(
false
Expand All @@ -281,13 +281,13 @@

await act(flushImmediate);

const nativeDetector = getNativeDetector(UNSAFE_getAllByType);
const scrollViewResponder = getScrollViewResponder(UNSAFE_getAllByType);
const button = screen.getByTestId('pressable');

// Outside of 'handled' mode the logical responder view is not rendered
// at all — the responder event can never be claimed on behalf of RNGH.
expect(scrollViewResponder).toBeUndefined();
expect(nativeDetector?.props.onStartShouldSetResponder()).toBe(false);
expect(button.props.onStartShouldSetResponderCapture()).toBe(false);
});

test('handles responder event passed through NativeDetector for keyboardShouldPersistTaps handled', async () => {
Expand Down
Loading
Loading