I have an Angular 8 app (core 8.1.2) using NgRx and the @ngrx/router-store (8.4.0) but am having trouble mocking a selector generated by fromRouter.getSelectors(selectRouter).
The selector I have written and am trying to test looks like this:
export const selectFilteredPagedFeaturedPlaylists = createSelector(
selectFilteredFeaturedPlaylists,
selectRoutePageIndex,
selectPageSize,
(featuredPlaylists, pageIndex, pageSize) => ({
...featuredPlaylists,
content: featuredPlaylists.content.slice(+pageIndex * pageSize, (+pageIndex + 1) * pageSize)
})
);
and the selectRoutePageIndex selector, calling a method generated by the store, looks like this:
export const selectRoutePageIndex = selectRouteParam('pageIndex');
In reality, I am not necessarily concerned with mocking the selectRouteParam selector, but I need to mock my selectRoutePageIndex selector. Unfortunately, the technique described in the docs doesn't appear to work for selectors generated by @ngrx/router-store.
Any ideas how I can do this?