diff --git a/ui/src/ui/app-settings.test.ts b/ui/src/ui/app-settings.test.ts index 51ffb7d3a2b..f3d8078a325 100644 --- a/ui/src/ui/app-settings.test.ts +++ b/ui/src/ui/app-settings.test.ts @@ -299,7 +299,7 @@ describe("applySettingsFromUrl", () => { }); it("hydrates query token params and strips them from the URL", () => { - setTestWindowUrl("https://control.example/ui/overview?token=abc123"); + setTestWindowUrl("https://control.example/ui/overview?token=abc123&password=sekret"); const host = createHost("overview"); host.settings.gatewayUrl = "wss://control.example/openclaw"; @@ -307,6 +307,9 @@ describe("applySettingsFromUrl", () => { expect(host.settings.token).toBe("abc123"); expect(window.location.search).toBe(""); + expect(JSON.parse(localStorage.getItem("openclaw.control.settings.v1") ?? "{}").token).toBe( + undefined, + ); }); it("prefers fragment tokens over legacy query tokens when both are present", () => { diff --git a/ui/src/ui/navigation.browser.test.ts b/ui/src/ui/navigation.browser.test.ts index d79111a3f1e..bd47711dea5 100644 --- a/ui/src/ui/navigation.browser.test.ts +++ b/ui/src/ui/navigation.browser.test.ts @@ -39,22 +39,6 @@ function expectConfirmedGatewayChange(app: ReturnType) { } describe("control UI routing", () => { - it("keeps chat navigation links visible and updates the URL when clicked", async () => { - const app = mountApp("/chat"); - await app.updateComplete; - - const dreamsLink = app.querySelector('a.nav-item[href="/dreaming"]'); - expect(dreamsLink).not.toBeNull(); - - const link = app.querySelector('a.nav-item[href="/channels"]'); - expect(link).not.toBeNull(); - link?.dispatchEvent(new MouseEvent("click", { bubbles: true, cancelable: true, button: 0 })); - - await app.updateComplete; - expect(app.tab).toBe("channels"); - expect(window.location.pathname).toBe("/channels"); - }); - it("renders the dreaming view on the /dreaming route", async () => { const app = mountApp("/dreaming"); app.dreamingStatus = { @@ -127,6 +111,9 @@ describe("control UI routing", () => { expect(window.matchMedia("(max-width: 768px)").matches).toBe(true); + const dreamsLink = app.querySelector('a.nav-item[href="/dreaming"]'); + expect(dreamsLink).not.toBeNull(); + expect(app.querySelector(".topnav-shell")).not.toBeNull(); expect(app.querySelector(".topnav-shell__content")).not.toBeNull(); expect(app.querySelector(".topnav-shell__actions")).not.toBeNull(); @@ -400,19 +387,6 @@ describe("control UI routing", () => { expect(container.scrollTop).toBe(targetScrollTop); }); - it("hydrates safe query params and strips unsafe credentials from the URL", async () => { - const app = mountApp("/ui/overview?token=abc123&password=sekret"); - await app.updateComplete; - - expect(app.settings.token).toBe("abc123"); - expect(app.password).toBe(""); - expect(JSON.parse(localStorage.getItem("openclaw.control.settings.v1") ?? "{}").token).toBe( - undefined, - ); - expect(window.location.pathname).toBe("/ui/overview"); - expect(window.location.search).toBe(""); - }); - it("hydrates token from URL hash, strips it, and clears it after gateway changes", async () => { const app = mountApp("/ui/overview#token=abc123"); await app.updateComplete;