Files
buzz/desktop/src/features/agents/lib/otherSetupAgent.test.mjs
Wes aea0ef8df9 fix(desktop): simplify duplicate agent provenance (#6401)
## Summary

- leave the local same-name agent row unlabelled because locality is
implied
- mark only the remote identity with a compact cloud badge reading
`Other setup` in mention autocomplete and Channel members
- suppress the redundant `managed by you` text for duplicate owned
agents while retaining distinct short npubs and exact-pubkey routing

## Testing

- Desktop E2E build/typecheck: `pnpm build:e2e`
- focused Playwright smoke test: `duplicate owned agents preserve
provenance and exact pubkey selection` (1 passed)
  - visible provenance in autocomplete and Channel members
  - local identity remains unmarked
  - keyboard selection routes each exact pubkey
  - narrow 760×640 viewport containment
- focused Biome check on the changed marker and E2E files
- `pnpm check:px-text`
- `pnpm check:pubkey-truncation`
- `just file-size-check`
- `git diff --check`

---------

Signed-off-by: Wes <wesbillman@users.noreply.github.com>
Co-authored-by: Carl <32a2e2c9d428ee08902cab75d956da2c1d235a22d4766b0dd4138bf6e2e5db1d@buzz.block.builderlab.xyz>
2026-08-21 10:05:45 -06:00

36 lines
810 B
JavaScript

import assert from "node:assert/strict";
import test from "node:test";
import { isOtherSetupAgent } from "./otherSetupAgent.ts";
const OWNER = "a".repeat(64);
const AGENT = "b".repeat(64);
test("fails closed while the local managed directory is unresolved", () => {
assert.equal(
isOtherSetupAgent({
agentDirectoriesReady: false,
currentPubkey: OWNER,
managedAgents: [],
profileOwnerPubkey: OWNER,
pubkey: AGENT,
relayAgents: [],
}),
false,
);
});
test("labels a viewer-owned non-local identity as another setup", () => {
assert.equal(
isOtherSetupAgent({
agentDirectoriesReady: true,
currentPubkey: OWNER,
managedAgents: [],
profileOwnerPubkey: OWNER,
pubkey: AGENT,
relayAgents: [],
}),
true,
);
});