title: reactJs test mocked component input and reponse, where to start?
body: <p>I am trying to test a postcode search component in my react app. Below is my component and click handler which gets data from an api using superagent. I have karma, jasmine and webpack setup and running basic component tests, but how can I mock the data and user input? I have all the json in a data file. Can I get a simple example setup using stubbing and mocking?</p>
  
  <pre><code>render: function () {
      return (
          &lt;div className="mainContent add-school-page"&gt;
                &lt;Loader loaded={this.state.loaded}&gt;
              &lt;div className="content has-header"&gt;
                  &lt;div className="list"&gt;
                      &lt;label className="item item-input item-stacked-label"&gt;
                          &lt;span className="input-label"&gt;Postcode&lt;/span&gt;
                          &lt;input ref="postcode" type="text" placeholder="A12 3BC"/&gt;
                      &lt;/label&gt;
                  &lt;/div&gt;
                  &lt;div className="padding"&gt;
                      &lt;button className="button button-block button-positive clickable"
                          onClick={this.searchByPostcode}&gt;
                          Find School
                      &lt;/button&gt;
                  &lt;/div&gt;
                  &lt;SearchResults results={this.state.results} /&gt;
                  &lt;br /&gt;
                  &lt;br /&gt;
              &lt;/div&gt;
              &lt;/Loader&gt;
          &lt;/div&gt;
      );
  },
  
  searchByPostcode: function() {
      var postcode = React.findDOMNode(this.refs.postcode).value;
      var url = OsaApiService.buildRequestUrl('find_schools_postcode', [postcode]);
      fetch(url)
          .then(function (response) {
              return response.json();
          }).then(function (json) {
              this.setState({
                  results: json.data,
              });
          }.bind(this)).catch(function (ex) {
              console.log(ex);
          });
  }
  </code></pre>
  
  <p>Can anyone please tell me how I can get started? </p>
  
  <p>I have tried Jest but the tests were taking forever to complete and as a watch task it took forever.</p>