Skip to content

Commit

Permalink
R Austin Review: more logic in selector
Browse files Browse the repository at this point in the history
  • Loading branch information
Brent Kimmel committed Jun 24, 2020
1 parent 6e0b932 commit 5c6a453
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ describe('resolver graph with too much lineage', () => {
});

describe('should select from state properly', () => {
it('has the correct ancestor cursor', () => {
it('should indicate there are too many ancestors', () => {
const action: DataAction = {
type: 'serverReturnedResolverData',
payload: {
Expand All @@ -232,9 +232,9 @@ describe('resolver graph with too much lineage', () => {
};
store.dispatch(action);
const { ancestors } = limitsReached(store.getState());
expect(ancestors).toEqual(ancestorCursor);
expect(ancestors).toEqual(true);
});
it('has the correct children cursor', () => {
it('should indicate there are too many children', () => {
const action: DataAction = {
type: 'serverReturnedResolverData',
payload: {
Expand All @@ -245,7 +245,7 @@ describe('resolver graph with too much lineage', () => {
};
store.dispatch(action);
const { children } = limitsReached(store.getState());
expect(children).toEqual(childrenCursor);
expect(children).toEqual(true);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,9 @@ export const processNodePositionsAndEdgeLineSegments = createSelector(
*
* @param state {DataState} the DataState from the reducer
*/
export const limitsReached = (state: DataState) => {
return state.lineageLimits;
export const limitsReached = (state: DataState): { children: boolean; ancestors: boolean } => {
return {
children: state.lineageLimits.children !== null,
ancestors: state.lineageLimits.ancestors !== null,
};
};

0 comments on commit 5c6a453

Please sign in to comment.