title: How can you test functions and variables within your react component's render function?
body: <p>I'm trying to improve my test coverage for my react components, but I am having trouble testing variables and functions declared within the render method of my components. Below are a couple of examples that I'm unable to get covered:</p>
  
  <p>1)</p>
  
  <pre><code>cityStateZip = `${cityStateZip} - ${location.zipExtension}`;
  </code></pre>
  
  <p>2)</p>
  
  <pre><code>directionsUrl = `maps://maps.apple.com/?saddr=My+Location&amp;daddr=${gpsCoords.lat}+${gpsCoords.lng}`;
  </code></pre>
  
  <p>3) </p>
  
  <pre><code>const onClick = (pricingTileId) =&gt; {
    if (store.selectedPharmacy !== pricingTileId) {
      store.setPharmacy(pricingTileId);
    }
  };
  </code></pre>
  
  <p>Here's the code:</p>
  
  <pre><code>class Tile extends Component {
    const { location, store } = this.props;
    render() {
      let directionsUrl = `https://maps.google.com/?saddr=My+Location&amp;daddr=${gpsCoords.lat}+${gpsCoords.lng}`;
      if (navigator.platform.indexOf('iPhone') !== -1
        || navigator.platform.indexOf('iPod') !== -1
        || navigator.platform.indexOf('iPad') !== -1) {
        directionsUrl = `maps://maps.apple.com/?saddr=My+Location&amp;daddr=${gpsCoords.lat}+${gpsCoords.lng}`;
      }
  
      let cityStateZip = `${location.city}, ${location.state} ${location.zip}`;
      if (location.zipExtension) {
        cityStateZip = `${cityStateZip} - ${location.zipExtension}`;
      }
  
      const onClick = (pricingTileId) =&gt; {
        if (store.selectedLocation !== pricingTileId) {
          store.setLocation(pricingTileId);
        }
      };
  
      let selectedClass;
      if (store.selectedLocation === id) {
        selectedClass = 'selected';
      }
  
      return (
  
      )
  </code></pre>
  
  <p>Is there an effective way to test the variables and functions declared in the render function that I'm overlooking? (I'm using Jest and Enzyme for my testing). Thank you!</p>