New Group administration: Add users

This commit is contained in:
Evan Hahn 2021-03-11 15:29:31 -06:00 committed by Josh Perez
parent e81c18e84c
commit b81a52bbdd
43 changed files with 1789 additions and 277 deletions

View file

@ -0,0 +1,41 @@
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { assert } from 'chai';
import { getDefaultConversation } from '../helpers/getDefaultConversation';
import { filterAndSortContacts } from '../../util/filterAndSortContacts';
describe('filterAndSortContacts', () => {
const conversations = [
getDefaultConversation({
title: '+16505551234',
firstName: undefined,
profileName: undefined,
}),
getDefaultConversation({ title: 'Carlos Santana' }),
getDefaultConversation({ title: 'Aaron Aardvark' }),
getDefaultConversation({ title: 'Belinda Beetle' }),
getDefaultConversation({ title: 'Belinda Zephyr' }),
];
it('without a search term, sorts conversations by title', () => {
const titles = filterAndSortContacts(conversations, '').map(
contact => contact.title
);
assert.deepEqual(titles, [
'+16505551234',
'Aaron Aardvark',
'Belinda Beetle',
'Belinda Zephyr',
'Carlos Santana',
]);
});
it('filters conversations a search terms', () => {
const titles = filterAndSortContacts(conversations, 'belind').map(
contact => contact.title
);
assert.deepEqual(titles, ['Belinda Beetle', 'Belinda Zephyr']);
});
});