mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 15:50:46 +00:00
test: trim duplicated navigation auth cases
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user