Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

test(engine): make the group history override test actually exercise the override

Yudhi Armyndharis4f7acd35e25d
diff --git a/src/engine/adapters/whatsapp-web-js.adapter.spec.ts b/src/engine/adapters/whatsapp-web-js.adapter.spec.ts
index f8ada794a..f6f093475 100644
--- a/src/engine/adapters/whatsapp-web-js.adapter.spec.ts
+++ b/src/engine/adapters/whatsapp-web-js.adapter.spec.ts
@@ -358,12 +358,12 @@ describe('WhatsAppWebJsAdapter.getChatHistory enrichment (parity with the live p
it('derives chatId-derived fields for a group chat from the requested chatId', async () => {
const groupMsg = {
id: { _serialized: 'M4' },
- from: 'me',
body: 'hi all',
type: 'chat',
timestamp: 400,
- fromMe: true,
+ fromMe: false,
hasMedia: false,
hasQuotedMsg: false,
};
@@ -372,6 +372,7 @@ describe('WhatsAppWebJsAdapter.getChatHistory enrichment (parity with the live p
const out = await readyAdapter(client).getChatHistory('[email protected]', 50, false);
+ expect(out[0].chatId).toBe('[email protected]');
expect(out[0].kind).toBe('group');
expect(out[0].isGroup).toBe(true);
});