test: tighten tool card button assertions · openclaw/openclaw@b46c26b
shakkernerd
·
2026-05-08
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -83,7 +83,6 @@ describe("tool-cards", () => {
|
83 | 83 | expect(container.textContent).toContain("Tool call"); |
84 | 84 | expect(container.textContent).not.toContain("Tool input"); |
85 | 85 | const summaryButton = container.querySelector("button.chat-tool-msg-summary"); |
86 | | -expect(summaryButton).not.toBeNull(); |
87 | 86 | expect(summaryButton?.getAttribute("aria-expanded")).toBe("false"); |
88 | 87 | }); |
89 | 88 | |
@@ -174,9 +173,9 @@ describe("tool-cards", () => {
|
174 | 173 | ); |
175 | 174 | |
176 | 175 | const sidebarButton = container.querySelector<HTMLButtonElement>(".chat-tool-card__action-btn"); |
177 | | -sidebarButton?.dispatchEvent(new MouseEvent("click", { bubbles: true })); |
| 176 | +expect(sidebarButton?.classList.contains("chat-tool-card__action-btn")).toBe(true); |
| 177 | +sidebarButton?.click(); |
178 | 178 | |
179 | | -expect(sidebarButton).not.toBeNull(); |
180 | 179 | expect(onOpenSidebar).toHaveBeenCalledWith( |
181 | 180 | expect.objectContaining({ |
182 | 181 | kind: "canvas", |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。