From 12d03eafedd79166597e5547ee3ebabf2b96bf57 Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Fri, 11 Sep 2026 18:27:33 -0700 Subject: [PATCH] test(whatsapp): trim salvaged bridge tests to the quoted-media invariants (drop cache unit test) --- .../whatsapp-bridge/bridge.native.test.mjs | 22 ------------------- 1 file changed, 22 deletions(-) diff --git a/scripts/whatsapp-bridge/bridge.native.test.mjs b/scripts/whatsapp-bridge/bridge.native.test.mjs index f59a1e3ae3..87bfd48bd8 100644 --- a/scripts/whatsapp-bridge/bridge.native.test.mjs +++ b/scripts/whatsapp-bridge/bridge.native.test.mjs @@ -16,7 +16,6 @@ import { buildPollPayload, buildTextSendPayload, createBoundedMessageStore, - createQuotedMediaCache, appendMediaFailureNote, extractBridgeEvent, inboundReadReceiptKeys, @@ -633,25 +632,4 @@ import { console.log(' āœ“ nested envelopes: quote text resolves through both layers'); } -// -- createQuotedMediaCache ------------------------------------------------ -{ - const cache = createQuotedMediaCache(2); - cache.remember('chat-a', 'msg-1', { hasMedia: true, mediaType: 'image', mediaUrls: ['/cache/img1.jpg'] }); - - assert.deepEqual(cache.get('chat-a', 'msg-1'), { hasMedia: true, mediaType: 'image', mediaUrls: ['/cache/img1.jpg'] }); - // Different chatId, same messageId — must not collide; message ids are - // only unique within their own chat/JID. - assert.equal(cache.get('chat-b', 'msg-1'), null); - assert.equal(cache.get('chat-a', 'unknown-msg'), null); - - cache.remember('chat-a', 'msg-2', { hasMedia: false }); - cache.remember('chat-a', 'msg-3', { hasMedia: false }); - // Capacity is 2: the oldest entry (msg-1) must have been evicted. - assert.equal(cache.get('chat-a', 'msg-1'), null); - assert.notEqual(cache.get('chat-a', 'msg-2'), null); - assert.notEqual(cache.get('chat-a', 'msg-3'), null); - - console.log(' āœ“ createQuotedMediaCache resolves by chatId+messageId and evicts oldest past capacity'); -} - console.log('\nāœ… All WhatsApp native bridge helper tests passed.');