Search for username in compose mode

This commit is contained in:
Scott Nonnenberg 2021-11-11 17:17:29 -08:00 committed by GitHub
parent 6731cc6629
commit cbae7f8ee9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
36 changed files with 997 additions and 72 deletions

View file

@ -7,6 +7,7 @@ import { OneTimeModalState } from '../../groups/toggleSelectedContactForGroupAdd
export const defaultStartDirectConversationComposerState = {
step: ComposerStep.StartDirectConversation as const,
searchTerm: '',
isFetchingUsername: false,
};
export const defaultChooseGroupMembersComposerState = {

View file

@ -21,6 +21,7 @@ describe('filterAndSortConversationsByTitle', () => {
name: 'Carlos Santana',
title: 'Carlos Santana',
e164: '+16505559876',
username: 'thisismyusername',
}),
getDefaultConversation({
name: 'Aaron Aardvark',
@ -64,6 +65,14 @@ describe('filterAndSortConversationsByTitle', () => {
).map(contact => contact.title);
assert.sameMembers(titles, ['Carlos Santana', '+16505551234']);
});
it('can search for contacts by username', () => {
const titles = filterAndSortConversationsByTitle(
conversations,
'thisis'
).map(contact => contact.title);
assert.sameMembers(titles, ['Carlos Santana']);
});
});
describe('filterAndSortConversationsByRecent', () => {