Skip to content

Commit

Permalink
fix(numeric-refinement-list): reset page on refine
Browse files Browse the repository at this point in the history
  • Loading branch information
iam4x committed Jun 19, 2017
1 parent 9af2ed2 commit ee55ccb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,13 @@ describe('numericRefinementList()', () => {
expect(initialOptions).toEqual(initialOptionsClone);
});

it('should reset page on refine()', () => {
helper.state.page = 2;
expect(helper.state.page).toBe(2);
widget._toggleRefinement('more than 10');
expect(helper.state.page).toBe(0);
});

afterEach(() => {
numericRefinementList.__ResetDependency__('ReactDOM');
numericRefinementList.__ResetDependency__('autoHideContainerHOC');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@ function refine(state, attributeName, options, facetValue) {
}
}

resolvedState.page = 0;

return resolvedState;
}

Expand Down

0 comments on commit ee55ccb

Please sign in to comment.