File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -16,11 +16,13 @@ jest.mock('isEventSupported');
16
16
describe ( 'EventPluginHub' , ( ) => {
17
17
var React ;
18
18
var ReactTestUtils ;
19
+ var ReactDOMFeatureFlags ;
19
20
20
21
beforeEach ( ( ) => {
21
22
jest . resetModules ( ) ;
22
23
React = require ( 'react' ) ;
23
24
ReactTestUtils = require ( 'react-dom/test-utils' ) ;
25
+ ReactDOMFeatureFlags = require ( 'ReactDOMFeatureFlags' ) ;
24
26
} ) ;
25
27
26
28
it ( 'should prevent non-function listeners, at dispatch' , ( ) => {
@@ -34,6 +36,14 @@ describe('EventPluginHub', () => {
34
36
} ) . toThrowError (
35
37
'Expected onClick listener to be a function, instead got type string' ,
36
38
) ;
39
+ if ( ReactDOMFeatureFlags . useFiber ) {
40
+ expectDev ( console . error . calls . count ( ) ) . toBe ( 1 ) ;
41
+ expectDev ( console . error . calls . argsFor ( 0 ) [ 0 ] ) . toContain (
42
+ 'Expected onClick listener to be a function, instead got type string' ,
43
+ ) ;
44
+ } else {
45
+ expectDev ( console . error . calls . count ( ) ) . toBe ( 0 ) ;
46
+ }
37
47
} ) ;
38
48
39
49
it ( 'should not prevent null listeners, at dispatch' , ( ) => {
You can’t perform that action at this time.
0 commit comments