

























@@ -10,32 +10,6 @@ import {
1010renderToolCardSidebar,
1111} from "./tool-cards.ts";
121213-vi.mock("../icons.ts", () => ({
14-icons: {
15-check: "✓",
16-chevronDown: "",
17-panelRightOpen: "",
18-x: "✕",
19-zap: "",
20-},
21-}));
22-23-vi.mock("../tool-display.ts", () => ({
24-formatToolDetail: () => undefined,
25-resolveToolDisplay: ({ name, args }: { name: string; args?: unknown }) => ({
26- name,
27-label: name
28-.split(/[._-]/g)
29-.map((part) => (part ? part[0].toUpperCase() + part.slice(1) : part))
30-.join(" "),
31-icon: "zap",
32-detail:
33-args && typeof args === "object" && "detail" in args
34- ? String((args as { detail: unknown }).detail)
35- : undefined,
36-}),
37-}));
38-3913function requireFirstMockArg(
4014mock: ReturnType<typeof vi.fn>,
4115label: string,
@@ -121,7 +95,7 @@ describe("tool-cards", () => {
1219512296const summaryButton = container.querySelector("button.chat-tool-msg-summary");
12397expect(summaryButton?.querySelector(".chat-tool-msg-summary__label")?.textContent).toBe(
124-"Sessions Spawn",
98+"Sub-agent",
12599);
126100expect(summaryButton?.getAttribute("aria-expanded")).toBe("false");
127101expect(container.querySelector(".chat-tool-msg-body")).toBeNull();
@@ -134,8 +108,8 @@ describe("tool-cards", () => {
134108{
135109id: "msg:5a:call-5a",
136110name: "skill_workshop",
137-args: { detail: "create" },
138-inputText: '{\n "detail": "create"\n}',
111+args: { action: "create" },
112+inputText: '{\n "action": "create"\n}',
139113outputText: "Proposal created",
140114},
141115{ expanded: false, onToggleExpanded: vi.fn() },
@@ -537,7 +511,6 @@ describe("tool-cards", () => {
537511expect(card?.classList.contains("chat-tool-card--error")).toBe(true);
538512expect(action?.classList.contains("chat-tool-card__action--error")).toBe(true);
539513expect(action?.textContent).toContain("View error");
540-expect(action?.textContent).toContain("✕");
541514expect(action?.textContent).not.toContain("✓");
542515});
543516@@ -558,7 +531,6 @@ describe("tool-cards", () => {
558531const action = container.querySelector(".chat-tool-card__action");
559532expect(container.querySelector(".chat-tool-card--error")).not.toBeNull();
560533expect(action?.textContent).toContain("View error");
561-expect(action?.textContent).toContain("✕");
562534expect(action?.textContent).not.toContain("✓");
563535});
564536@@ -579,7 +551,6 @@ describe("tool-cards", () => {
579551const action = container.querySelector(".chat-tool-card__action");
580552expect(container.querySelector(".chat-tool-card--error")).not.toBeNull();
581553expect(action?.textContent).toContain("View error");
582-expect(action?.textContent).toContain("✕");
583554expect(action?.textContent).not.toContain("✓");
584555});
585556此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。