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.');