test: target lazy view states · openclaw/openclaw@ffbeb53
shakkernerd
·
2026-05-12
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -29,7 +29,9 @@ describe("lazy view rendering", () => {
|
29 | 29 | container, |
30 | 30 | ); |
31 | 31 | |
32 | | -expect(container.textContent).toContain("Loading panel"); |
| 32 | +expect( |
| 33 | +container.querySelector(".lazy-view-state--loading .card-title")?.textContent?.trim(), |
| 34 | +).toBe("Loading panel"); |
33 | 35 | |
34 | 36 | await flushPromises(); |
35 | 37 | render( |
@@ -60,8 +62,12 @@ describe("lazy view rendering", () => {
|
60 | 62 | container, |
61 | 63 | ); |
62 | 64 | |
63 | | -expect(container.textContent).toContain("Panel failed to load"); |
64 | | -expect(container.textContent).toContain("chunk 404"); |
| 65 | +expect( |
| 66 | +container.querySelector(".lazy-view-state--error .card-title")?.textContent?.trim(), |
| 67 | +).toBe("Panel failed to load"); |
| 68 | +expect(container.querySelector(".lazy-view-state--error .callout")?.textContent?.trim()).toBe( |
| 69 | +"chunk 404", |
| 70 | +); |
65 | 71 | |
66 | 72 | const retry = expectButtonWithText(container, "Retry"); |
67 | 73 | retry.dispatchEvent(new MouseEvent("click", { bubbles: true, cancelable: true })); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。