Skip to content
Open
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 @@ -8,3 +8,4 @@ export const RawButton = ({ enabled, children, ...rest }: any) => (
export const BaseButton = RawButton;
export const RectButton = RawButton;
export const BorderlessButton = TouchableNativeFeedback;
export const Clickable = RawButton;
Comment on lines 9 to +11
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clickable is a v3 export (src/v3/components/index.ts -> src/v3/components/Clickable/Clickable), but this mock file is used to mock ./src/components/GestureButtons (legacy) in jestSetup.js. Exporting Clickable here likely won’t affect import { Clickable } from 'react-native-gesture-handler' in tests, so the PR may not actually provide a Jest mock for the public Clickable API. Consider adding a dedicated v3 Clickable mock and wiring it up in jestSetup.js (e.g., mock ./src/v3/components/Clickable/Clickable or ./src/v3/components).

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clickable’s onPress callback in the real implementation receives a pointerInside: boolean (same as BaseButtonProps), but this mock delegates directly to TouchableNativeFeedback, which calls onPress with a press event object. This API mismatch can cause consumer tests to pass in Jest but break in production (or vice versa) when callbacks rely on the boolean argument. Consider wrapping the handler in the mock to call onPress?.(true) (and similarly map onLongPress, onPressIn, onPressOut if you want closer parity).

Suggested change
export const Clickable = RawButton;
export const Clickable = ({
onPress,
onLongPress,
onPressIn,
onPressOut,
...rest
}: any) => (
<RawButton
{...rest}
onPress={() => onPress?.(true)}
onLongPress={() => onLongPress?.(true)}
onPressIn={() => onPressIn?.(true)}
onPressOut={() => onPressOut?.(true)}
/>
);

Copilot uses AI. Check for mistakes.
Loading