test: require agents preview controls · openclaw/openclaw@7b377d2
shakkernerd
·
2026-05-08
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -488,14 +488,17 @@ describe("renderAgentFiles", () => {
|
488 | 488 | const panel = container.querySelector<HTMLElement>(".md-preview-dialog__panel"); |
489 | 489 | const expandButton = container.querySelector<HTMLButtonElement>(".md-preview-expand-btn"); |
490 | 490 | |
491 | | -expandButton?.click(); |
| 491 | +expect(dialog).toBeInstanceOf(HTMLDialogElement); |
| 492 | +expect(panel).toBeInstanceOf(HTMLElement); |
| 493 | +expect(expandButton).toBeInstanceOf(HTMLButtonElement); |
| 494 | +expandButton!.click(); |
492 | 495 | |
493 | 496 | expect(panel?.classList.contains("fullscreen")).toBe(true); |
494 | 497 | expect(expandButton?.classList.contains("is-fullscreen")).toBe(true); |
495 | 498 | expect(expandButton?.getAttribute("aria-pressed")).toBe("true"); |
496 | 499 | expect(expandButton?.getAttribute("aria-label")).toBe("Collapse preview"); |
497 | 500 | |
498 | | -dialog?.dispatchEvent(new Event("close")); |
| 501 | +dialog!.dispatchEvent(new Event("close")); |
499 | 502 | |
500 | 503 | expect(panel?.classList.contains("fullscreen")).toBe(false); |
501 | 504 | expect(expandButton?.classList.contains("is-fullscreen")).toBe(false); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。