title: Enzyme switch case with react
body: <p>I've got a function that depends on parameters return components or null. I created an array of objects with parameters and component that should be returned. How to check what I return with switch/case statement.</p>
  
  <pre><code>export const getMiConfiguration = miConfigurationType =&gt; {
      switch (miConfigurationType) {
          case MiConfigurationTypes.WanderingDetection :
          case MiConfigurationTypes.MuteWanderingDetection:
              return &lt;WanderingDetection /&gt;
  
          case MiConfigurationTypes.OpenWanderingControl :
          case MiConfigurationTypes.LockedWanderingControl:
              return &lt;WanderingControl /&gt;
  
          default:
              return null
      }
  } 
  </code></pre>
  
  <p>Test</p>
  
  <pre><code>describe.only('getMiConfiguration', () =&gt; {
  
      ;[{id: MiConfigurationTypes.AccessPointOnly, component: null},
          {id: MiConfigurationTypes.WanderingDetection, component: &lt;WanderingDetection/&gt;},
          {id: MiConfigurationTypes.MuteWanderingDetection, component: &lt;WanderingDetection/&gt;},
          {id: MiConfigurationTypes.LockedWanderingControl, component: &lt;WanderingControl/&gt;},
          {id: MiConfigurationTypes.OpenWanderingControl, component: &lt;WanderingControl/&gt;},
      ].forEach(({id, component}) =&gt;
          it('should render correct component', () =&gt; {
              const result = getMiConfiguration(id)
          }))
       })
  </code></pre>