mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 00:58:28 +00:00
fix: local updates for PR #4873
Co-authored-by: Hisleren <Hisleren@users.noreply.github.com>
This commit is contained in:
committed by
Gustavo Madeira Santana
parent
201d7fa956
commit
e5a95b5b66
@@ -1,6 +1,11 @@
|
||||
import { afterEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
import { openUrl, resolveBrowserOpenCommand, resolveControlUiLinks } from "./onboard-helpers.js";
|
||||
import {
|
||||
normalizeGatewayTokenInput,
|
||||
openUrl,
|
||||
resolveBrowserOpenCommand,
|
||||
resolveControlUiLinks,
|
||||
} from "./onboard-helpers.js";
|
||||
|
||||
const mocks = vi.hoisted(() => ({
|
||||
runCommandWithTimeout: vi.fn(async () => ({
|
||||
@@ -103,3 +108,18 @@ describe("resolveControlUiLinks", () => {
|
||||
expect(links.wsUrl).toBe("ws://127.0.0.1:18789");
|
||||
});
|
||||
});
|
||||
|
||||
describe("normalizeGatewayTokenInput", () => {
|
||||
it("returns empty string for undefined or null", () => {
|
||||
expect(normalizeGatewayTokenInput(undefined)).toBe("");
|
||||
expect(normalizeGatewayTokenInput(null)).toBe("");
|
||||
});
|
||||
|
||||
it("trims string input", () => {
|
||||
expect(normalizeGatewayTokenInput(" token ")).toBe("token");
|
||||
});
|
||||
|
||||
it("coerces non-string input to string", () => {
|
||||
expect(normalizeGatewayTokenInput(123)).toBe("123");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user