Bug fix to ensure that the category ids are not dropped aftering being filtered.
parent
bb2aff1c3f
commit
3c924a1619
|
@ -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