Handle PNI+PNI+E164 triple

This commit is contained in:
Fedor Indutny 2023-03-23 17:52:46 -07:00 committed by GitHub
parent 9fe7bb41ec
commit dd16be13b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 167 additions and 113 deletions

View file

@ -571,6 +571,28 @@ describe('ConversationController', () => {
assert.strictEqual(result?.id, initial?.id, 'result and initial match');
});
it('adds PNI to conversation with e164+ACI', () => {
const initial = create('initial', {
aci: ACI_1,
e164: E164_1,
});
const { conversation: result } =
window.ConversationController.maybeMergeContacts({
mergeOldAndNew,
aci: PNI_1,
pni: PNI_1,
e164: E164_1,
reason,
});
expectPropsAndLookups(result, 'result', {
uuid: ACI_1,
e164: E164_1,
pni: PNI_1,
});
assert.strictEqual(result?.id, initial?.id, 'result and initial match');
});
it('replaces PNI in conversation with all data', () => {
const initial = create('initial', {
aci: ACI_1,