filterAndSortContacts should tokenize

This commit is contained in:
Fedor Indutny 2021-03-29 15:19:59 -07:00 committed by GitHub
parent 05ea4a4ff8
commit 6f7ecb141f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -551,7 +551,8 @@ describe('both/state/selectors/conversations', () => {
const result = getComposeContacts(state);
const ids = result.map(contact => contact.id);
assert.deepEqual(ids, ['convo-1', 'convo-5']);
// NOTE: convo-6 matches because you can't write "Sharing" without "in"
assert.deepEqual(ids, ['convo-1', 'convo-5', 'convo-6']);
});
});

View file

@ -9,6 +9,7 @@ const FUSE_OPTIONS: FuseOptions<ConversationType> = {
// A small-but-nonzero threshold lets us match parts of E164s better, and makes the
// search a little more forgiving.
threshold: 0.05,
tokenize: true,
keys: [
{
name: 'title',