title: Testing if onBlur is called
body: <p>I've been searching how to do this for 2 hours, but couldn't make it work. I have a class called base text, which renders an input field. I'm trying to test if onBlur function is called. But I can't make the test pass. I'm getting a </p>
  
  <blockquote>
    <p>TypeError: Cannot read property '_isMockFunction' of undefined</p>
  </blockquote>
  
  <p>Is there any way to test if onBlur function is called with mock?</p>
  
  <p><strong>BaseText.js</strong></p>
  
  <pre><code>looseFocus = event =&gt; {
      const { value } = event.target;
      const { mustEnter, mustFill, limit } = this.props;
      if (mustEnter) {
        if (value.length &lt; 1) {
          alert('Missing info.');
        }
      }
      if (mustFill &amp;&amp; limit &gt; 0) {
        if (value.length &lt; limit) {
          alert('Missing info.');
        }
      }
    };
  
    render() {
      const {
        /...constants
      } = this.props;
      const { value } = this.state;
      return visible ? (
        &lt;Input
          disabled={disabled}
          placeholder={text}
          name={name}
          value={value}
          onChange={this.handleChange}
          onBlur={this.looseFocus}
          style={Styles}
          minLength={minLength}
          exception={exception}
          mustEnter={mustEnter}
          // prefix={this.props.prefix}
          type={type}
          maxLength={limit &lt; 0 ? null : limit}
          //    menuRef={this.props.menuRef}
          //    zeroPad={this.props.zeroPad}
        /&gt;
      ) : null;
    }
  }
  </code></pre>
  
  <p><strong>BaseText.test.js</strong></p>
  
  <pre><code>const defaultBaseText = shallow(&lt;BaseText /&gt;);
  
      describe('BaseText should make a function call on blur.', () =&gt; {
        it('blur it', () =&gt; {
          const instance = defaultBaseText.instance();
          const spy = jest.spyOn(instance, 'onBlur');
  
          instance.forceUpdate();
  
          const p = defaultBaseText.find('Input');
          p.simulate('blur');
          expect(spy).toHaveBeenCalled();
        });
      });
  </code></pre>