





















@@ -60,6 +60,10 @@ function createOverviewProps(overrides: Partial<OverviewProps> = {}): OverviewPr
6060};
6161}
626263+function compactText(node: Element | null): string | undefined {
64+return node?.textContent?.trim().replace(/\s+/g, " ");
65+}
66+6367describe("overview view rendering", () => {
6468it("keeps the persisted overview locale selected before i18n hydration finishes", async () => {
6569const container = document.createElement("div");
@@ -102,11 +106,14 @@ describe("overview view rendering", () => {
102106render(renderOverview(props), container);
103107await Promise.resolve();
104108105-expect(container.textContent).toContain("Scope upgrade pending approval.");
106-expect(container.textContent).toContain(
107-"This device is already paired, but the requested wider scope is waiting for approval.",
109+const hint = container.querySelector(".mono")?.closest(".muted") ?? null;
110+expect(compactText(hint)).toBe(
111+"Scope upgrade pending approval. This device is already paired, but the requested wider scope is waiting for approval. openclaw devices approve req-123 openclaw devices list On mobile? Copy the full URL (including #token=...) from openclaw dashboard --no-open on your desktop. Docs: Device pairing",
108112);
109-expect(container.textContent).toContain("openclaw devices approve req-123");
113+expect([...container.querySelectorAll(".mono")].map((node) => node.textContent)).toEqual([
114+"openclaw devices approve req-123",
115+"openclaw devices list",
116+]);
110117});
111118112119it("does not suggest preview-only latest approval when the request id is absent", async () => {
@@ -119,8 +126,12 @@ describe("overview view rendering", () => {
119126render(renderOverview(props), container);
120127await Promise.resolve();
121128122-expect(container.textContent).toContain("Scope upgrade pending approval.");
123-expect(container.textContent).toContain("openclaw devices list");
124-expect(container.textContent).not.toContain("openclaw devices approve --latest");
129+const hint = container.querySelector(".mono")?.closest(".muted") ?? null;
130+expect(compactText(hint)).toBe(
131+"Scope upgrade pending approval. This device is already paired, but the requested wider scope is waiting for approval. openclaw devices list On mobile? Copy the full URL (including #token=...) from openclaw dashboard --no-open on your desktop. Docs: Device pairing",
132+);
133+expect([...container.querySelectorAll(".mono")].map((node) => node.textContent)).toEqual([
134+"openclaw devices list",
135+]);
125136});
126137});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。