File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
packages/react-is/src/__tests__ Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,8 @@ describe('ReactIs', () => {
2929 expect ( ReactIs . typeOf ( { } ) ) . toBe ( undefined ) ;
3030 expect ( ReactIs . typeOf ( null ) ) . toBe ( undefined ) ;
3131 expect ( ReactIs . typeOf ( undefined ) ) . toBe ( undefined ) ;
32+ expect ( ReactIs . typeOf ( NaN ) ) . toBe ( undefined ) ;
33+ expect ( ReactIs . typeOf ( Symbol ( 'def' ) ) ) . toBe ( undefined ) ;
3234 } ) ;
3335
3436 it ( 'identifies valid element types' , ( ) => {
@@ -37,6 +39,11 @@ describe('ReactIs', () => {
3739 return React . createElement ( 'div' ) ;
3840 }
3941 }
42+ class PureComponent extends React . PureComponent {
43+ render ( ) {
44+ return React . createElement ( 'div' ) ;
45+ }
46+ }
4047
4148 const FunctionComponent = ( ) => React . createElement ( 'div' ) ;
4249 const ForwardRefComponent = React . forwardRef ( ( props , ref ) =>
@@ -48,6 +55,7 @@ describe('ReactIs', () => {
4855
4956 expect ( ReactIs . isValidElementType ( 'div' ) ) . toEqual ( true ) ;
5057 expect ( ReactIs . isValidElementType ( Component ) ) . toEqual ( true ) ;
58+ expect ( ReactIs . isValidElementType ( PureComponent ) ) . toEqual ( true ) ;
5159 expect ( ReactIs . isValidElementType ( FunctionComponent ) ) . toEqual ( true ) ;
5260 expect ( ReactIs . isValidElementType ( ForwardRefComponent ) ) . toEqual ( true ) ;
5361 expect ( ReactIs . isValidElementType ( LazyComponent ) ) . toEqual ( true ) ;
You can’t perform that action at this time.
0 commit comments