You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test('works on pressable with pointer event to box-only',()=>{constmockOnPress=jest.fn();constscreen=render(<PressableonPress={mockOnPress}pointerEvents="box-only"testID="pressable"/>);fireEvent.press(screen.getByTestId('pressable'));expect(mockOnPress).toHaveBeenCalled();});
What happens is that the pointer-events condition checks that there is not box-only on the parent but here the parent is the composite element and it has box-only so the element is considered to be disabled.
Expected behavior
The test should pass
Steps to Reproduce
Versions
I've written the test in the up to date repo of RNTL
I think this can be fixed if we look at the host parent instead of the direct parent using the method getHostParent. I'll try to submit a PR soon for this. I have made a version of the function that checks pointer-events in #1386 which could be used by fireEvent I think
The text was updated successfully, but these errors were encountered:
Describe the bug
The following test will fail
What happens is that the pointer-events condition checks that there is not box-only on the parent but here the parent is the composite element and it has box-only so the element is considered to be disabled.
Expected behavior
The test should pass
Steps to Reproduce
Versions
I've written the test in the up to date repo of RNTL
I think this can be fixed if we look at the host parent instead of the direct parent using the method getHostParent. I'll try to submit a PR soon for this. I have made a version of the function that checks pointer-events in #1386 which could be used by fireEvent I think
The text was updated successfully, but these errors were encountered: