test: merge chat context notice checks · openclaw/openclaw@5c2f4af
steipete
·
2026-04-18
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -93,9 +93,11 @@ async function renderContextNoticeChat() {
|
93 | 93 | describe("chat context notice", () => { |
94 | 94 | afterEach(() => { |
95 | 95 | document.body.innerHTML = ""; |
| 96 | +document.documentElement.style.removeProperty("--warn"); |
| 97 | +document.documentElement.style.removeProperty("--danger"); |
96 | 98 | }); |
97 | 99 | |
98 | | -it("falls back to default notice colors when theme vars are not hex", async () => { |
| 100 | +it("renders robust notice colors and badge-sized warning icon", async () => { |
99 | 101 | document.documentElement.style.setProperty("--warn", "rgb(1, 2, 3)"); |
100 | 102 | document.documentElement.style.setProperty("--danger", "tomato"); |
101 | 103 | const container = await renderContextNoticeChat(); |
@@ -106,13 +108,6 @@ describe("chat context notice", () => {
|
106 | 108 | expect(notice?.style.getPropertyValue("--ctx-color")).not.toContain("NaN"); |
107 | 109 | expect(notice?.style.getPropertyValue("--ctx-bg")).not.toContain("NaN"); |
108 | 110 | |
109 | | -document.documentElement.style.removeProperty("--warn"); |
110 | | -document.documentElement.style.removeProperty("--danger"); |
111 | | -}); |
112 | | - |
113 | | -it("keeps the warning icon badge-sized", async () => { |
114 | | -const container = await renderContextNoticeChat(); |
115 | | - |
116 | 111 | const icon = container.querySelector<SVGElement>(".context-notice__icon"); |
117 | 112 | expect(icon).not.toBeNull(); |
118 | 113 | if (!icon) { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。