From 4ba12bd134ce455af2d270485c82e5a27752381a Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Fri, 17 Apr 2026 18:55:35 +0100 Subject: [PATCH] test: trim duplicated navigation auth cases --- ui/src/ui/navigation.browser.test.ts | 33 ---------------------------- 1 file changed, 33 deletions(-) diff --git a/ui/src/ui/navigation.browser.test.ts b/ui/src/ui/navigation.browser.test.ts index a25bfa101f4..d79111a3f1e 100644 --- a/ui/src/ui/navigation.browser.test.ts +++ b/ui/src/ui/navigation.browser.test.ts @@ -413,25 +413,6 @@ describe("control UI routing", () => { expect(window.location.search).toBe(""); }); - it("hydrates token from URL hash when settings already set", async () => { - localStorage.setItem( - "openclaw.control.settings.v1", - JSON.stringify({ token: "existing-token", gatewayUrl: "wss://gateway.example/openclaw" }), - ); - const app = mountApp("/ui/overview#token=abc123"); - await app.updateComplete; - - expect(app.settings.token).toBe("abc123"); - expect(JSON.parse(localStorage.getItem("openclaw.control.settings.v1") ?? "{}")).toMatchObject({ - gatewayUrl: "wss://gateway.example/openclaw", - }); - expect(JSON.parse(localStorage.getItem("openclaw.control.settings.v1") ?? "{}").token).toBe( - undefined, - ); - expect(window.location.pathname).toBe("/ui/overview"); - expect(window.location.hash).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; @@ -469,20 +450,6 @@ describe("control UI routing", () => { expectConfirmedGatewayChange(app); }); - it("keeps a query token pending until the gateway URL change is confirmed", async () => { - const app = mountApp( - "/ui/overview?gatewayUrl=wss://other-gateway.example/openclaw&token=abc123", - ); - await app.updateComplete; - - expect(app.settings.gatewayUrl).not.toBe("wss://other-gateway.example/openclaw"); - expect(app.settings.token).toBe(""); - - await confirmPendingGatewayChange(app); - - expectConfirmedGatewayChange(app); - }); - it("restores the token after a same-tab refresh", async () => { const first = mountApp("/ui/overview#token=abc123"); await first.updateComplete;