test: expand accountId routing coverage

Co-authored-by: adam91holt <adam91holt@users.noreply.github.com>
This commit is contained in:
Peter Steinberger
2026-01-17 04:33:15 +00:00
parent 19ee6699d2
commit 49ecbd8fea
3 changed files with 113 additions and 0 deletions

View File

@@ -42,6 +42,9 @@ describe("delivery context helpers", () => {
"whatsapp|+1555|",
);
expect(deliveryContextKey({ channel: "whatsapp" })).toBeUndefined();
expect(
deliveryContextKey({ channel: "whatsapp", to: "+1555", accountId: "acct-1" }),
).toBe("whatsapp|+1555|acct-1");
});
it("derives delivery context from a session entry", () => {
@@ -57,5 +60,16 @@ describe("delivery context helpers", () => {
to: "+1777",
accountId: "acct-9",
});
expect(
deliveryContextFromSession({
channel: "telegram",
lastTo: " 123 ",
}),
).toEqual({
channel: "telegram",
to: "123",
accountId: undefined,
});
});
});