fix(GRO-982): address 5 test failures in inbound webhook
- Fix signature route tests: use /messaging not full mount path - Fix handleMessageReceived mock order: business lookup first - Fix stale mock state: add full mockReset in handleMessageFinalized beforeEach - Fix delivery logic: set delivered for all message.finalized events - Deduplicate test that was accidentally added twice Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -175,10 +175,7 @@ export async function handleMessageFinalized(payload: TelnyxMessageReceivedPaylo
|
||||
|
||||
let newStatus = existing.status;
|
||||
if (payload.data.event_type === "message.finalized") {
|
||||
const deliveryReceipt = message as { direction?: string; to?: Array<{ phone: string }> };
|
||||
if (deliveryReceipt.direction === "inbound") {
|
||||
newStatus = "delivered";
|
||||
}
|
||||
newStatus = "delivered";
|
||||
}
|
||||
|
||||
if (newStatus !== existing.status) {
|
||||
|
||||
Reference in New Issue
Block a user