Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

test(baileys): check the stored copy after a cross-chat delete

Yudhi Armyndharis7937deb1fb63
diff --git a/src/engine/adapters/baileys-quote-on-receipt.spec.ts b/src/engine/adapters/baileys-quote-on-receipt.spec.ts
index da06d8e95..6725c32df 100644
--- a/src/engine/adapters/baileys-quote-on-receipt.spec.ts
+++ b/src/engine/adapters/baileys-quote-on-receipt.spec.ts
@@ -322,6 +322,9 @@ describe('quoting a Baileys message the moment it is announced', () => {
await expect(reply).resolves.toMatchObject({ id: 'R1' });
expect(writtenContents('TARGET')).toEqual([photo('TARGET').message]);
+ // The declined delete is written through update(), after the reply, so read the row it left.
+ await ticks();
+ expect((await store.getMessage('s1', 'TARGET'))?.message).toEqual(photo('TARGET').message);
});
});