Skip to content

Commit

Permalink
fix(hits): rename __position to hitIndex
Browse files Browse the repository at this point in the history
  • Loading branch information
vvo committed Jun 13, 2016
1 parent 95227d8 commit d051a54
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/Hits.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Hits extends React.Component {
let renderedHits = map(this.props.results.hits, (hit, position) => {
let data = {
...hit,
__position: position
__hitIndex: position
};
return (
<Template
Expand Down
6 changes: 3 additions & 3 deletions src/components/__tests__/Hits-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ describe('Hits', () => {
expect(actual.at(1).props().data.foo).toEqual('baz');
});

it('should add the __position in the list to each item', () => {
it('should add the __hitIndex in the list to each item', () => {
// Given
let props = {
results: {
Expand All @@ -251,8 +251,8 @@ describe('Hits', () => {
let actual = shallowRender(props).find({templateKey: 'item'});

// Then
expect(actual.at(0).props().data.__position).toEqual(0);
expect(actual.at(1).props().data.__position).toEqual(1);
expect(actual.at(0).props().data.__hitIndex).toEqual(0);
expect(actual.at(1).props().data.__hitIndex).toEqual(1);
});

it('should use the objectID as the DOM key', () => {
Expand Down

0 comments on commit d051a54

Please sign in to comment.