title: How do I stub Ant Design's Form getFieldDecorator()?
body: <p>I'm trying to do a simple Jest snapshot test of a form but when running the test I get the error: </p>
  
  <pre><code>Uncaught [TypeError: getFieldDecorator(...) is not a function]
  </code></pre>
  
  <p>I thought I could just create a stub for <code>getFieldDecorator</code> and pass this in the props but it doesn't work.</p>
  
  <p>This is the test:</p>
  
  <pre><code>  it('renders correctly initially', () =&gt; {
  
  const testForm = {
    getFieldDecorator: jest.fn()
  };
  
  const wrapper = mount(
    &lt;Router&gt;
      &lt;LoginForm form={testForm} /&gt;
    &lt;/Router&gt;
  );
  
  expect(wrapper).toMatchSnapshot();
  </code></pre>
  
  <p>});</p>
  
  <p>This is the render() method in my component:</p>
  
  <pre><code>  render() {
  const { form } = this.props;
  const { getFieldDecorator } = form;
  
  return (
    &lt;Form onSubmit={this.handleSubmit} className="login-form"&gt;
      &lt;FormItem&gt;
        {getFieldDecorator('username', {
          rules: [{ required: true, message: 'Please enter your username!' }]
        })(
          &lt;Input
            prefix={&lt;Icon type="user" style={{ color: 'rgba(0,0,0,.25)' }} /&gt;}
            placeholder="Username"
          /&gt;
        )}
      &lt;/FormItem&gt;
  </code></pre>
  
  <p>I'm exporting my component as:</p>
  
  <pre><code>export default withRouter(Form.create()(LoginForm));
  </code></pre>