From 8d7df30ee050882d9ec4ee87092f47109e3588f5 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Thu, 19 Feb 2026 07:47:10 +0000 Subject: [PATCH] test: remove duplicate target-resolution cases from outbound suite --- src/infra/outbound/outbound.test.ts | 107 +--------------------------- 1 file changed, 1 insertion(+), 106 deletions(-) diff --git a/src/infra/outbound/outbound.test.ts b/src/infra/outbound/outbound.test.ts index 8095da3c6b..7b78836354 100644 --- a/src/infra/outbound/outbound.test.ts +++ b/src/infra/outbound/outbound.test.ts @@ -36,7 +36,7 @@ import { normalizeOutboundPayloads, normalizeOutboundPayloadsForJson, } from "./payloads.js"; -import { resolveOutboundTarget, resolveSessionDeliveryTarget } from "./targets.js"; +import { resolveOutboundTarget } from "./targets.js"; describe("delivery-queue", () => { let tmpDir: string; @@ -981,108 +981,3 @@ describe("resolveOutboundTarget", () => { } }); }); - -describe("resolveSessionDeliveryTarget", () => { - it("derives implicit delivery from the last route", () => { - const resolved = resolveSessionDeliveryTarget({ - entry: { - sessionId: "sess-1", - updatedAt: 1, - lastChannel: " whatsapp ", - lastTo: " +1555 ", - lastAccountId: " acct-1 ", - }, - requestedChannel: "last", - }); - - expect(resolved).toEqual({ - channel: "whatsapp", - to: "+1555", - accountId: "acct-1", - threadId: undefined, - threadIdExplicit: false, - mode: "implicit", - lastChannel: "whatsapp", - lastTo: "+1555", - lastAccountId: "acct-1", - lastThreadId: undefined, - }); - }); - - it("prefers explicit targets without reusing lastTo", () => { - const resolved = resolveSessionDeliveryTarget({ - entry: { - sessionId: "sess-2", - updatedAt: 1, - lastChannel: "whatsapp", - lastTo: "+1555", - }, - requestedChannel: "telegram", - }); - - expect(resolved).toEqual({ - channel: "telegram", - to: undefined, - accountId: undefined, - threadId: undefined, - threadIdExplicit: false, - mode: "implicit", - lastChannel: "whatsapp", - lastTo: "+1555", - lastAccountId: undefined, - lastThreadId: undefined, - }); - }); - - it("allows mismatched lastTo when configured", () => { - const resolved = resolveSessionDeliveryTarget({ - entry: { - sessionId: "sess-3", - updatedAt: 1, - lastChannel: "whatsapp", - lastTo: "+1555", - }, - requestedChannel: "telegram", - allowMismatchedLastTo: true, - }); - - expect(resolved).toEqual({ - channel: "telegram", - to: "+1555", - accountId: undefined, - threadId: undefined, - threadIdExplicit: false, - mode: "implicit", - lastChannel: "whatsapp", - lastTo: "+1555", - lastAccountId: undefined, - lastThreadId: undefined, - }); - }); - - it("falls back to a provided channel when requested is unsupported", () => { - const resolved = resolveSessionDeliveryTarget({ - entry: { - sessionId: "sess-4", - updatedAt: 1, - lastChannel: "whatsapp", - lastTo: "+1555", - }, - requestedChannel: "webchat", - fallbackChannel: "slack", - }); - - expect(resolved).toEqual({ - channel: "slack", - to: undefined, - accountId: undefined, - threadId: undefined, - threadIdExplicit: false, - mode: "implicit", - lastChannel: "whatsapp", - lastTo: "+1555", - lastAccountId: undefined, - lastThreadId: undefined, - }); - }); -});