test: isolate agent skills tab count · openclaw/openclaw@6f46d12
shakkernerd
·
2026-05-12
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -34,6 +34,14 @@ function createSkill() {
|
34 | 34 | }; |
35 | 35 | } |
36 | 36 | |
| 37 | +function directText(element: Element | null | undefined): string | undefined { |
| 38 | +return Array.from(element?.childNodes ?? []) |
| 39 | +.filter((node) => node.nodeType === Node.TEXT_NODE) |
| 40 | +.map((node) => node.textContent ?? "") |
| 41 | +.join("") |
| 42 | +.trim(); |
| 43 | +} |
| 44 | + |
37 | 45 | function createProps(overrides: Partial<AgentsProps> = {}): AgentsProps { |
38 | 46 | return { |
39 | 47 | basePath: "", |
@@ -306,7 +314,8 @@ describe("renderAgents", () => {
|
306 | 314 | (button) => button.textContent?.includes("Skills"), |
307 | 315 | ); |
308 | 316 | |
309 | | -expect(skillsTab?.textContent?.trim()).toContain("1"); |
| 317 | +expect(directText(skillsTab)).toBe("Skills"); |
| 318 | +expect(skillsTab?.querySelector(".agent-tab-count")?.textContent).toBe("1"); |
310 | 319 | }); |
311 | 320 | |
312 | 321 | it("keeps the Cron Jobs tab label while localizing channel refresh never state", async () => { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。