File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ const getWithLocalizeWithContext = () => {
23
23
}
24
24
}
25
25
} ) ;
26
-
26
+
27
27
return require ( 'withLocalize' ) . withLocalize ;
28
28
} ;
29
29
@@ -50,4 +50,20 @@ describe('withLocalize', () => {
50
50
const wrapper = result . dive ( ) ;
51
51
expect ( wrapper . props ( ) . name ) . toEqual ( 'Testy McTest' ) ;
52
52
} ) ;
53
- } ) ;
53
+
54
+ it ( 'should hoist any existing static functions on WrappedComponent' , ( ) => {
55
+ const withLocalize = getWithLocalizeWithContext ( ) ;
56
+ class WrapperComponent extends React . Component {
57
+ static sayHello ( ) {
58
+ return 'hello' ;
59
+ }
60
+ render ( ) {
61
+ return (
62
+ < h1 > Hello You!</ h1 >
63
+ ) ;
64
+ }
65
+ } ;
66
+ const Wrapped = withLocalize ( WrapperComponent ) ;
67
+ expect ( Wrapped . sayHello ( ) ) . toEqual ( 'hello' )
68
+ } ) ;
69
+ } ) ;
You can’t perform that action at this time.
0 commit comments