Skip to content

Commit

Permalink
Merge pull request #154 from mwadden/master
Browse files Browse the repository at this point in the history
Bug Fix: Ensure category ids are not dropped after emojisToShowFilter call
  • Loading branch information
EtienneLem authored Dec 28, 2017
2 parents 048838c + 3c924a1 commit 9675658
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions spec/picker-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,11 @@ describe('Picker', () => {
subject = render({ emojisToShowFilter: unified => false })
expect(subject.categories.length).toEqual(2)
})

it('maintains category ids after it is filtered', () => {
subject = render({emojisToShowFilter: emoji => true});
const categoriesWithIds = subject.categories.filter(category => category.id);
expect(categoriesWithIds.length).toEqual(10);
});
})
})
1 change: 1 addition & 0 deletions src/components/picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ export default class Picker extends React.PureComponent {
let newCategory = {
emojis: newEmojis,
name: category.name,
id: category.id
}

this.categories.push(newCategory)
Expand Down

0 comments on commit 9675658

Please sign in to comment.