title: Jest test case failing for React conditional
body: <p>I am testing for the third conditional state error of the amount to equal a specific string, but when I run it I get an empty string. </p>
  
  <p>Conditional:</p>
  
  <pre><code>if (!this.state.amount) {
      this.setState(() =&gt; ({ error: 'Please provide amount.' }));
  }
  </code></pre>
  
  <p>Jest Test Case:</p>
  
  <pre><code>test('should render error for lack of amount', () =&gt; {
      const onSubmitSpy = jest.fn();
      const wrapper = shallow(&lt;ExpenseForm expense={errors[1]} onSubmit={onSubmitSpy} /&gt;);
      expect(wrapper).toMatchSnapshot();
      wrapper.find('form').simulate('submit', {
          preventDefault: () =&gt; { },
      });
      expect(wrapper).toMatchSnapshot();
      console.log(wrapper.state('error'));
      expect(wrapper.state('error')).toBe('Please provide amount.');
  }); 
  </code></pre>
  
  <p>Error array index: </p>
  
  <pre><code>id: '5',
  description: 'Gas',
  note: '',
  amount: '',
  createdAt: moment(0).add(4, 'days').valueOf()
  </code></pre>
  
  <p>Ideally, this condition should test for the amount state to equal '' and give the error message of 'Please provide amount.'</p>