Skip to content

Commit

Permalink
Merge branch 'master' into codepoints
Browse files Browse the repository at this point in the history
  • Loading branch information
sz-hankus authored Apr 12, 2022
2 parents 2902ee0 + c7b66bf commit 748b5fd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,7 @@ module.exports = function search (query, skinTone, pasteByDefault = false) {

return alfredItems(matches(terms))
}

module.exports.internals = {
alfredItem
}
6 changes: 6 additions & 0 deletions test/search.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,12 @@ test('finds 👨‍👩‍👦', (t) => {
t.equal(found.items.filter(i => i.title === 'family man, woman, boy').length, 1)
})

test('handles emoji the system does not recognize', (t) => {
t.plan(1)
const item = search.internals.alfredItem(undefined, '🤷🏼')
t.equal(item, undefined)
})

test('enables ctrl-modifier', (t) => {
t.plan(1)
const found = search('hear_no_evil')
Expand Down

0 comments on commit 748b5fd

Please sign in to comment.