Provide more data to `emojisToShowFilter` in search [Fix #141]

nolan/hinaloe-test
Etienne Lemay 2017-11-08 09:48:35 -08:00
parent d4c86bc6e1
commit 810c472917
2 changed files with 2 additions and 2 deletions

View File

@ -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])
)
}

View File

@ -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')