Increased fuse search distance from 100 (default) to 150
This commit is contained in:
parent
46428b5af6
commit
aa2bb68d4a
2 changed files with 16 additions and 0 deletions
|
@ -28,6 +28,9 @@ describe('filterAndSortConversationsByRecent', () => {
|
|||
e164: '+16505559876',
|
||||
activeAt: 2,
|
||||
}),
|
||||
getDefaultConversation({
|
||||
title: 'A long title ending with burrito',
|
||||
}),
|
||||
];
|
||||
|
||||
it('sorts by recency when no search term is provided', () => {
|
||||
|
@ -42,6 +45,16 @@ describe('filterAndSortConversationsByRecent', () => {
|
|||
'Boxing Club',
|
||||
'Abraham Lincoln',
|
||||
'Not recent',
|
||||
'A long title ending with burrito',
|
||||
]);
|
||||
});
|
||||
|
||||
it('finds a conversation when the search term is at the end of a long title', () => {
|
||||
const titles = filterAndSortConversationsByRecent(
|
||||
conversations,
|
||||
'burrito',
|
||||
'US'
|
||||
).map(convo => convo.title);
|
||||
assert.deepEqual(titles, ['A long title ending with burrito']);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -19,6 +19,9 @@ const FUSE_OPTIONS: Fuse.IFuseOptions<ConversationType> = {
|
|||
useExtendedSearch: true,
|
||||
// We sort manually anyway
|
||||
shouldSort: true,
|
||||
// the default of 100 is not enough to catch a word at the end of a convo/group title
|
||||
// 150 is about right
|
||||
distance: 150,
|
||||
keys: [
|
||||
{
|
||||
name: 'searchableTitle',
|
||||
|
|
Loading…
Add table
Reference in a new issue