title: ShallowWrapper can only wrap valid elements - Enzyme Reactjs
body: <p>I'm writing a test for a component to test one of its functions, but I am getting an error:
  <code>ShallowWrapper can only wrap valid elements</code></p>
  
  <p>The component file is as follows - <code>Panel.jsx</code> (simplified):    </p>
  
  <pre><code>class Panel extends Component {
    static propTypes = {
      ...
    };
  
    static defaultProps = {
      ...
    };
  
    constructor(props) {
      super(props);
      ...
      this.makeConfigArray = this.makeConfigArray.bind(this);
      this.filterSelected = this.filterSelected.bind(this);
    }
  
    makeConfigArray() {
      ...
    }
  
    filterSelected(filters) {
      ...
    }
  
    render() {
      return (
        &lt;div&gt;
          &lt;ReactFilterSentence
            filters={this.makeConfigArray()}
            label="Filter Page"
            isPersistent
            onChange={(...args) =&gt; this.filterSelected(args)}
          /&gt;
  
          &lt;span className="page-filter__config-form-separator" /&gt;
        &lt;/div&gt;
      );
    }
  }
  
  export default Panel;
  </code></pre>
  
  <p>The test file is as follows -
  <code>panel-test.jsx</code>:</p>
  
  <pre><code>import React from 'react';
  import { expect } from 'chai';
  import { shallow } from 'enzyme';
  import Panel from '../../src/components/Panel.jsx';
  
  const Enzyme = require('enzyme');
  const Adapter = require('enzyme-adapter-react-15');
  
  Enzyme.configure({ adapter: new Adapter() });
  
  describe('&lt;Panel /&gt; component', () =&gt; {
    let props;
    const getPanelWrapper = () =&gt; shallow(&lt;Panel {...props}/&gt;);
  
    it('should make regions filter query string', () =&gt; {
      const regions =
        {
          "key":"region",
          "value":
            [
              "Nordic &gt; Nordic &gt; Denmark",
              "Nordic &gt; Finland",
              "Nordic &gt; Norway",
              "Nordic &gt; Sweden"
            ]
        };
  
      const expected = "regions=DK+FI+NO+SE";
      expect(getPanelWrapper().instance().makeRegionsQueryString(regions)).to.equal(expected);
    });
  });
  </code></pre>
  
  <p>Any ideas why this is happening would be much appreciated!</p>