fix: preserve explicit assist ticket and reject ambiguous recipients

This commit is contained in:
gitea committed 2026-10-21 16:04:57 +08:00
1 parent 3597ec6694
commit 6ce83dd8a7
7 files changed
+339 -56

No files matched your search

+16 -4
View File
@@ -255,9 +255,21 @@ describe("CLI Commands - assist-platform (合思协助平台)", () => {
raw: ["assist-platform", "transfer", "ID01ofWoOC1wiX", "ID01Xenwiu9w0D", "--to", "陈龙", "--dry-run"],
};
const res = await handleAssistPlatformCommand(parsed, runtime);
expect(res.stdout).toContain("[DRY-RUN]");
expect(res.stdout).toContain("ID01Xenwiu9w0D");
expect(res.stdout).toContain("陈龙");
const originalFetch = globalThis.fetch;
globalThis.fetch = (async () => Response.json({
items: [{
id: "role-chenlong",
userId: { id: "chenlong3016", name: "陈龙", code: "3016" },
}],
})) as unknown as typeof globalThis.fetch;
try {
const res = await handleAssistPlatformCommand(parsed, runtime);
expect(res.stdout).toContain("[DRY-RUN]");
expect(res.stdout).toContain("ID01Xenwiu9w0D");
expect(res.stdout).toContain("陈龙");
expect(res.stdout).toContain("chenlong3016");
} finally {
globalThis.fetch = originalFetch;
}
});
});