Merge pull request #154 from mwadden/master
Bug Fix: Ensure category ids are not dropped after emojisToShowFilter callrelease
commit
9675658e92
|
@ -33,5 +33,11 @@ describe('Picker', () => {
|
||||||
subject = render({ emojisToShowFilter: unified => false })
|
subject = render({ emojisToShowFilter: unified => false })
|
||||||
expect(subject.categories.length).toEqual(2)
|
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);
|
||||||
|
});
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -108,6 +108,7 @@ export default class Picker extends React.PureComponent {
|
||||||
let newCategory = {
|
let newCategory = {
|
||||||
emojis: newEmojis,
|
emojis: newEmojis,
|
||||||
name: category.name,
|
name: category.name,
|
||||||
|
id: category.id
|
||||||
}
|
}
|
||||||
|
|
||||||
this.categories.push(newCategory)
|
this.categories.push(newCategory)
|
||||||
|
|
Loading…
Reference in New Issue