test(sidebar): cover ownerless relay agents

Co-authored-by: Taylor Ho <taylorkmho@gmail.com>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
This commit is contained in:
npub1223z34hd7vtwc6qj4s7flsxkj644nlre2nthu7lrrmkumhu3xddsrx9r6w
2026-06-30 16:55:42 -07:00
committed by npub14vtk7pvazqrq9639qu7e560wnqtl0d53ca4gjuvq6jzf3k2el23qqlwa7f
parent 07e14d25ad
commit 4535a42323

View File

@@ -99,6 +99,28 @@ describe("getOwnedRelayWorkingAgents", () => {
[],
);
});
it("drops relay agents with missing profiles or null owners", () => {
assert.deepEqual(
getOwnedRelayWorkingAgents(
[
{ pubkey: OWNED_RELAY_AGENT_PUBKEY, name: "nadia" },
{ pubkey: "ownerless-agent", name: "ralph" },
],
{
"ownerless-agent": {
displayName: "ralph",
avatarUrl: null,
nip05Handle: null,
ownerPubkey: null,
isAgent: true,
},
},
VIEWER_PUBKEY,
),
[],
);
});
});
describe("mergeWorkingAgents", () => {