Provide more data to `emojisToShowFilter` in search [Fix #141]
parent
d4c86bc6e1
commit
810c472917
|
@ -156,7 +156,7 @@ function search(
|
|||
if (results) {
|
||||
if (emojisToShowFilter) {
|
||||
results = results.filter(result =>
|
||||
emojisToShowFilter(data.emojis[result.id].unified)
|
||||
emojisToShowFilter(data.emojis[result.id])
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ describe('#emojiIndex', () => {
|
|||
})
|
||||
|
||||
it('should filter only emojis we care about, exclude pineapple', () => {
|
||||
let emojisToShowFilter = unified => unified !== '1F34D'
|
||||
let emojisToShowFilter = (data) => { data.unified !== '1F34D' }
|
||||
expect(
|
||||
emojiIndex.search('apple', { emojisToShowFilter }).map(obj => obj.id)
|
||||
).not.toContain('pineapple')
|
||||
|
|
Loading…
Reference in New Issue