title: Angular Ngrx Test: Store.overrideSelector does not override
body: <p>I do have the following <code>beforeEach</code>:</p>
  
  <pre><code>beforeEach(() =&gt; {
      fixture = TestBed.createComponent(ApplyComponent);
      component = fixture.componentInstance;
      fixture.detectChanges();
      store = TestBed.get&lt;Store&lt;fromAnnouncement.AnnouncementState&gt;&gt;(Store);
      store.refreshState();
      mockApplicationSelector = store.overrideSelector(selectDraftApplication, testDraftApplication); &lt;-- Try to mock  a selector here.
    });
  </code></pre>
  
  <p>The selector selectDraftApplication depends on the feature selector for the <code>AnnouncementState</code>, which has two entities in it, one of which im subselecting with a feature selector in order to build my <code>selectDraftApplication</code> selector.</p>
  
  <p>When using this code in test, all my tests crash, because NgRx somehow still seems to look for all the state further up, when I would expect a mock to be something that prevents precisely this. There is no point in mocking out a whole ngrx entity store, so I would just like the selector to return exactly that object and be done with it. I googled wide and far, but did not get any answer. Any help? I run Angular 8 and ngrx 8.5.1 (the <code>refreshState()</code> function did not work either...)</p>
  
  <p>Thanks!</p>
  
  <p><strong>EDIT</strong>:</p>
  
  <pre><code>export const getAnnouncementState = createFeatureSelector&lt;AnnouncementState&gt;('announcement');
  
  export const getApplicationsState = createSelector(
    getAnnouncementState,
    (state: AnnouncementState) =&gt; state.applications 
  );
  
  export const selectDraftApplication = createSelector(
    getApplicationsState,
    (state: ApplicationState) =&gt; state.draftApplication
  );
  </code></pre>