title: How to test a function is returning jsx in react-testing-library?
body: <p>How can I test using jest/react-testing-library that a component is returning specific JSX? </p>
  
  <p>I have toBeInstanceOf, etc, but it is hard to find information about "react-testing-library"</p>
  
  <p>these are a few examples</p>
  
  <pre><code>  const className = props.className;
  
    if (!props.action) {
      return props.children;
    }
  
    const { id, type, target } = props.action;
    if (type === "EXTERNAL") {
      return (
        &lt;a className={className} href={target}&gt;
          {props.children}
        &lt;/a&gt;
      );
    }
  
    if (["page"].includes(type.toLowerCase())) {
      return (
        &lt;Link className={className} key={id} to={"/" + target}&gt;
          {props.children}
        &lt;/Link&gt;
      );
    }
  
    if (type.toLowerCase() === "play") {
      return props.children;
    } ...
  </code></pre>
  
  <p>as you can see every return is different jsx.</p>