title: How I can test the openDrawer with enzyme in React Native?
body: <p>I'm having some trouble with my tests in react native. I'm using enzyme and I'm trying to click in a button that open a drawer. I'm using react navigation as well, however when I try this problem happens:</p>
  
  <p>TypeError: navigation.openDrawer is not a funciton</p>
  
  <pre><code>  const props = {
      navigation: {
        openDrawer: jest.fn(),
      },
    };
  
    const wrapper = shallow(&lt;HeaderButton {...props} /&gt;);
  
    it('DrawerMenu is Called', () =&gt; {
      expect(
        wrapper
          .find('AnimatedComponent')
          .props()
          .onPress(),
      ).toHaveBeenCalled();
    });
  
  const HeaderButton = (navigation: NavigationParams) =&gt; (
    &lt;TouchableRipple
      onPress={() =&gt; navigation.openDrawer()}
    &gt;
      &lt;Icon
        name="menu"
        size={Platform.OS === 'ios' ? 20 : 24}
        color="white"
        style={{ marginHorizontal: 16 }}
      /&gt;
    &lt;/TouchableRipple&gt;
  );
  </code></pre>
  
  <p>[Link to code: <a href="https://gist.github.com/salomaoluiz/dd710b3506b95b3f0f13410a02ef41cf]" rel="nofollow noreferrer">https://gist.github.com/salomaoluiz/dd710b3506b95b3f0f13410a02ef41cf]</a></p>
  
  <p>Thanks.</p>