Reactjs : TypeError: Cannot read property 'propTypes' of undefined
<p>Please i am asked to write a unitTest for the following reactjs page. </p>

<pre><code>export default class Collapsible extends React.Component {
    static propTypes = {
        title: React.PropTypes.string,
        children: React.PropTypes.any,
    };

    render() {
        const { title } = this.props;
        return (
            &lt;details&gt;
                &lt;summary&gt;{title}&lt;/summary&gt;
                {this.props.children}
            &lt;/details&gt;
        );
    }
}
</code></pre>

<p>Following the tut <a href="https://blog.algolia.com/how-we-unit-test-react-components-using-expect-jsx/" rel="noreferrer">Here</a> I wrote my test below like</p>

<pre><code>describe('Collapsible', ()=&gt;{
    it('works', ()=&gt;{
        let renderer = createRenderer();
        renderer.render(&lt;Collapsible title="MyTitle"&gt;&lt;span&gt;HEllo&lt;/span&gt;&lt;/Collapsible&gt;);
        let actualElement = renderer.getRenderOutput();
        let expectedElement = (&lt;details&gt;&lt;summary&gt;title&lt;/summary&gt;Details&lt;/details&gt;);
        expect(actualElement).toEqual(expectedElement);                     
    });
});
</code></pre>

<p>However, my test is throwing the error in the title above, i am suspecting my props on the Collapsible (i.e title and children) are not assigning from the test . Please how do i address this? Any help or guidance would highly be appreciated.</p>