Move left pane entirely to React

This commit is contained in:
Scott Nonnenberg 2019-01-14 13:49:58 -08:00
parent bf904ddd12
commit b3ac1373fa
142 changed files with 5016 additions and 3428 deletions

View file

@ -163,51 +163,3 @@ describe('Conversation', () => {
});
});
});
describe('Conversation search', () => {
let convo;
beforeEach(async () => {
convo = new Whisper.ConversationCollection().add({
id: '+14155555555',
type: 'private',
name: 'John Doe',
});
await window.Signal.Data.saveConversation(convo.attributes, {
Conversation: Whisper.Conversation,
});
});
afterEach(clearDatabase);
async function testSearch(queries) {
await Promise.all(
queries.map(async query => {
const collection = new Whisper.ConversationCollection();
await collection.search(query);
assert.isDefined(collection.get(convo.id), `no result for "${query}"`);
})
);
}
it('matches by partial phone number', () => {
return testSearch([
'1',
'4',
'+1',
'415',
'4155',
'4155555555',
'14155555555',
'+14155555555',
]);
});
it('matches by name', () => {
return testSearch(['John', 'Doe', 'john', 'doe', 'John Doe', 'john doe']);
});
it('does not match +', async () => {
const collection = new Whisper.ConversationCollection();
await collection.search('+');
assert.isUndefined(collection.get(convo.id), 'got result for "+"');
});
});