Having difficulty with unit testing MobX observer components with multiple stores injected
<p>My understanding with MobX inject decorator is that, with Enzyme, I should be able to simply initialize a store in my unit test and then pass as a prop to the component I'm mounting. [src: <a href="https://semaphoreci.com/community/tutorials/how-to-test-react-and-mobx-with-jest" rel="nofollow noreferrer">https://semaphoreci.com/community/tutorials/how-to-test-react-and-mobx-with-jest</a> and scroll to the Integration Tests section.] But I keep getting the Store not Available! error. This tends to be an issue particularly if I am injecting multiple stores. </p>

<p>So in my component: </p>

<pre><code>export default inject('errorStore', 'someOtherStore', 'andTheThirdStore')(observer(MyComponent));
</code></pre>

<p>My test should look like this. </p>

<pre><code>import errorStore from './stores/errorStore';
import someOtherStore from './stores/someOtherStore';
import andTheThirdStore from './stores/andTheThirdStore';
import Component from './components/Component';

describe('My Component', () =&gt; {
  someOtherStore.initializeWithData('./examples','TEST-123-45678-90', 'USERID');
  andTheThirdStore.initialize();
  const storeProp = { errorStore, someOtherStore, andTheThirdStore };

  beforeEach(() =&gt; {
      const wrapper = mount(&lt;Component {...storeProp} /&gt;
  }

  it ('does all the things', () =&gt; {...});
</code></pre>

<p>Do I need some other sort of provider here or am I just missing something obvious?</p>