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:
2026-05-04 04:00:58 +00:00
committed by Flea Flicker [agent]
parent 6f98c4aacc
commit efdf3e6ed4
2 changed files with 37 additions and 36 deletions
+1 -4
View File
@@ -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) {