title: How to test child component method with Enzyme?
body: <p>I have a component like that:</p>
  
  <pre><code>&lt;Parent&gt;
    &lt;Child/&gt;
  &lt;/Parent&gt;
  </code></pre>
  
  <p>and <code>&lt;Child/&gt;</code> component have a method <code>foo</code>. I want test the <code>foo</code> method but I don't know how to access it. I tried:</p>
  
  <pre><code>mount(&lt;Parent&gt;&lt;Child/&gt;&lt;/Parent&gt;).props().children.foo
  </code></pre>
  
  <p>or</p>
  
  <pre><code>mount(&lt;Parent&gt;&lt;Child/&gt;&lt;/Parent&gt;).children().foo
  </code></pre>
  
  <p>but both them are <code>undefined</code>. I can't use <code>.instance()</code> because it's not root. I can't mount <code>&lt;Child/&gt;</code> only because the <code>&lt;Parent&gt;</code> add something (react-router's <code>context.router</code>) on <code>context</code> and I need them when init <code>&lt;Child/&gt;</code>. Any idea with this?</p>