title: React Number Format unit test with isAllowed
body: <p>I am using the react number format for inputting the number input fields.</p>
  <pre><code>         &lt;TargetRow&gt;
                     &lt;NumberFormat
                          type=&quot;text&quot;
                          isNumericString={true}
                          decimalScale={2}
                          name=&quot;otbTarget&quot;
                          value={otbTarget === null ? '' : otbTarget}
                          className=&quot;TargetRow__input TargetRow__otbTarget&quot;
                          onBlur={this.updateTarget}
                          onChange={this.handleChangeOTBTarget}
                          isAllowed={this.limitInputValue}
                      /&gt;
  
           /&gt;
  </code></pre>
  <p>function for the <strong>isAllowed</strong>, is to limit the length of values entered in the field.</p>
  <pre><code>limitInputValue = ({ value }: NumberFormatValues ) =&gt;  value.length &lt;= ALLOWED_INPUT_LENGTH;
  </code></pre>
  <p>I need to write a unit test for this functionality, to check if the values entered in the field with <strong>NumberFormat</strong> gets restricted by using the isAllowed method.</p>
  <p>I tried using the enzyme simulate for change, but as it turns out it calls the <code>handleChangeOTBTarget</code> method, which is as expected.</p>
  <p>I am not able to understand how the <code>isAllowed</code> will be triggered.</p>
  <p>Unit test which I am writing is :</p>
  <pre><code>it('should restrict values with ALLOWED_INPUT_LENGTH', async () =&gt; {
      // ALLOWED_INPUT_LENGTH = 3
      const mockTarget = 1234512345;
      component = shallow(&lt;TargetRow {...defaultProps} otbTarget={mockTarget} /&gt;); 
  
      const targetInput = component.find('.TargetRow__otbTarget');
      targetInput.simulate('change', { target: { value: mockTarget } });
      targetInput.simulate('blur');
      expect(targetInput.props().value).toBe( 123 );
  });
  </code></pre>
  <p>As you can see there is way to simulate onchange, which is working as stated above. But I am not able to trigger the method which is on <code>isAllowed</code></p>