diff --git a/packages/react-is/src/__tests__/ReactIs-test.js b/packages/react-is/src/__tests__/ReactIs-test.js index a56c9f756a1d3..cddd479c4344e 100644 --- a/packages/react-is/src/__tests__/ReactIs-test.js +++ b/packages/react-is/src/__tests__/ReactIs-test.js @@ -29,6 +29,8 @@ describe('ReactIs', () => { expect(ReactIs.typeOf({})).toBe(undefined); expect(ReactIs.typeOf(null)).toBe(undefined); expect(ReactIs.typeOf(undefined)).toBe(undefined); + expect(ReactIs.typeOf(NaN)).toBe(undefined); + expect(ReactIs.typeOf(Symbol('def'))).toBe(undefined); }); it('identifies valid element types', () => { @@ -37,6 +39,11 @@ describe('ReactIs', () => { return React.createElement('div'); } } + class PureComponent extends React.PureComponent { + render() { + return React.createElement('div'); + } + } const FunctionComponent = () => React.createElement('div'); const ForwardRefComponent = React.forwardRef((props, ref) => @@ -48,6 +55,7 @@ describe('ReactIs', () => { expect(ReactIs.isValidElementType('div')).toEqual(true); expect(ReactIs.isValidElementType(Component)).toEqual(true); + expect(ReactIs.isValidElementType(PureComponent)).toEqual(true); expect(ReactIs.isValidElementType(FunctionComponent)).toEqual(true); expect(ReactIs.isValidElementType(ForwardRefComponent)).toEqual(true); expect(ReactIs.isValidElementType(LazyComponent)).toEqual(true);