title: How to test the following method inside a component with jest and enzyme?
body: <p>This is the method inside the component I am trying to test but I get this error: {TypeError: Cannot read property 'push' of undefined}</p>
  
  <pre><code>setQuery(newQueryElement) 
      //merge together the current query with the new query element
      var currentQuery = QueryString.parse(this.state.currentProjectQuery);
      Object.assign(currentQuery, newQueryElement);
  
      //now turn the query into a query string and navigate to it
      var queryString = QueryString.stringify(currentQuery);
      this.props.history.push({
          pathname: this.props.location.pathname,
          search: "?" + queryString
      });
  }
  </code></pre>