Free, Open Source, Self-Hosted WhatsApp API Gateway
TypeScript apibotgatewayself-hostedwhatsappwhatsapp-apiwhatsapp-automationwhatsapp-botwhatsapp-gatewaywhatsapp-gateway-apiwhatsapp-webwhatsapp-web-api
import { BaileysSessionStore } from './baileys-session-store';
describe('findContact across identity kinds', () => {
it('does not answer a phone lookup with a lid contact whose digits are the same', () => {
const store = new BaileysSessionStore();
store.upsertContacts([
{ id: '628111@lid', name: 'Other' },
{ id: '777@lid', phoneNumber: '[email protected]', name: 'Right' },
]);
expect(store.findContact('[email protected]')?.name).toBe('Right');
});
it('does not answer a lid lookup with a phone contact whose digits are the same', () => {
const store = new BaileysSessionStore();
store.upsertContacts([
{ id: '[email protected]', name: 'Other' },
{ id: '[email protected]', name: 'Other twin' },
{ id: '[email protected]', lid: '777@lid', name: 'Right' },
]);
expect(store.findContact('777@lid')?.name).toBe('Right');
});
});