I have a component that renders a React Native Pressable and uses the pressed state to alter the display:
<Pressable testID="t">
{({ pressed }) => <Text style={pressed ? pressedStyle : unPressedStyle }>{title}</Text>
<Pressable>
This works fine, but when I run a test coverage report, the pressed state is skipped. This happens even if I fire a press event on the pressable, for example:
const { getByTestID } = render(<PressableComponent />);
const pressable = getByTestID('t');
fireEvent.press(pressable);
Is there any way to trigger the pressed state during testing so that I can test that branch?