File tree Expand file tree Collapse file tree 2 files changed +1
-19
lines changed Expand file tree Collapse file tree 2 files changed +1
-19
lines changed Original file line number Diff line number Diff line change @@ -62,16 +62,6 @@ describe('fireEvent', () => {
62
62
expect ( onPressMock ) . toHaveBeenCalled ( ) ;
63
63
} ) ;
64
64
65
- test ( 'should throw an Error when event handler was not found' , ( ) => {
66
- const { getByText } = render (
67
- < WithoutEventComponent onPress = { ( ) => 'this is not passed to children' } />
68
- ) ;
69
-
70
- expect ( ( ) => fireEvent ( getByText ( 'Without event' ) , 'press' ) ) . toThrow (
71
- 'No handler function found for event: "press"'
72
- ) ;
73
- } ) ;
74
-
75
65
test ( 'should invoke event with custom name' , ( ) => {
76
66
const handlerMock = jest . fn ( ) ;
77
67
const EVENT_DATA = 'event data' ;
Original file line number Diff line number Diff line change 1
1
// @flow
2
2
import act from './act' ;
3
- import { ErrorWithStack } from './helpers/errors' ;
4
3
5
4
const isHostElement = ( element ? : ReactTestInstance ) => {
6
5
return typeof element ?. type === 'string' ;
@@ -66,14 +65,7 @@ const findEventHandler = (
66
65
// Do not bubble event to the root element
67
66
const hasHandler = handler != null || hasDescendandHandler ;
68
67
if ( element . parent === null || element . parent . parent === null ) {
69
- if ( hasHandler ) {
70
- return null ;
71
- } else {
72
- throw new ErrorWithStack (
73
- `No handler function found for event: "${ eventName } "` ,
74
- callsite || invokeEvent
75
- ) ;
76
- }
68
+ return null ;
77
69
}
78
70
79
71
return findEventHandler (
You can’t perform that action at this time.
0 commit comments