title: Way to test the order of elements in React
body: <p>Just want to implement the unit test for my react component with using the  <code>Jest</code> and <code>Enzyme</code>. </p>
  
  <p>Is there a way to test the order? Let's say I have component <strong>Button</strong>, and I want to render icon and text at the same time. </p>
  
  <p>And of course it's good to provide the alignment option to the user(Icon first or Children first).</p>
  
  <p><strong>Button.js</strong></p>
  
  <pre><code>class Button extends React.Component {
      constructor() {
          super();
      }
      render() {
          let content;
          const icon = (&lt;Icon type='search' /&gt;);
          if (this.props.iconAlign === 'right') {
              content = (&lt;span&gt;{this.props.children} {icon}&lt;/span&gt;
          } else {
              content = (&lt;span&gt;{icon} {this.props.children}&lt;/span&gt;
          }
          return (
              &lt;button&gt;{content}&lt;/button&gt;
          );
      }
  }
  </code></pre>
  
  <p>How to test the <code>iconAlign</code> props with <strong>Jest</strong> and <strong>Enzyme</strong>?</p>