test: tighten outbound identity normalization

This commit is contained in:
Peter Steinberger 2026-03-14 00:59:03 +00:00
parent 8dab4a48c4
commit cbd264f33d
1 changed files with 16 additions and 0 deletions

View File

@ -66,4 +66,20 @@ describe("resolveAgentOutboundIdentity", () => {
expect(resolveAgentOutboundIdentity({} as never, "main")).toBeUndefined();
});
it("drops blank remote avatar urls while keeping other identity fields", () => {
resolveAgentIdentityMock.mockReturnValueOnce({
name: " Agent Smith ",
emoji: " 🕶️ ",
});
resolveAgentAvatarMock.mockReturnValueOnce({
kind: "remote",
url: " ",
});
expect(resolveAgentOutboundIdentity({} as never, "main")).toEqual({
name: "Agent Smith",
emoji: "🕶️",
});
});
});