Skip to content

Commit

Permalink
fix(InfiniteHits): better classname to loadmore btn (#1789)
Browse files Browse the repository at this point in the history
  • Loading branch information
adlenafane authored and bobylito committed Jan 2, 2017
1 parent ae465ca commit ad2ded3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions packages/react-instantsearch/src/components/InfiniteHits.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ class InfiniteHits extends Component {
<ItemComponent key={hit.objectID} hit={hit} />
);
const loadMoreButton = hasMore ?
<button {...cx('reset')} onClick={() => refine()}>Load more</button> :
<button {...cx('reset')} disabled>Load more</button>;
<button {...cx('loadMore')} onClick={() => refine()}>Load more</button> :
<button {...cx('loadMore')} disabled>Load more</button>;

return (
<div {...cx('root')}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('Hits', () => {
/>
);
expect(mockedRefine.mock.calls.length).toBe(0);
wrapped.find('.ais-InfiniteHits__reset').simulate('click');
wrapped.find('.ais-InfiniteHits__loadMore').simulate('click');
expect(mockedRefine.mock.calls.length).toBe(1);
});

Expand All @@ -50,6 +50,6 @@ describe('Hits', () => {
hasMore={false}
/>
);
expect(wrapped.find('.ais-InfiniteHits__reset').props().disabled).toBe(true);
expect(wrapped.find('.ais-InfiniteHits__loadMore').props().disabled).toBe(true);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ exports[`Hits accepts a hitComponent prop 1`] = `
}
} />
<button
className="ais-InfiniteHits__reset"
className="ais-InfiniteHits__loadMore"
disabled={true}>
Load more
</button>
Expand Down

0 comments on commit ad2ded3

Please sign in to comment.