mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 10:20:42 +00:00
test: share onboarding discovery beacon fixture
This commit is contained in:
@@ -44,6 +44,16 @@ function createSelectPrompter(
|
||||
});
|
||||
}
|
||||
|
||||
function createGatewayDiscoveryBeacon(): GatewayBonjourBeacon {
|
||||
return {
|
||||
instanceName: "gateway",
|
||||
displayName: "Gateway",
|
||||
host: "gateway.tailnet.ts.net",
|
||||
port: 18789,
|
||||
gatewayTlsFingerprintSha256: "sha256:abc123",
|
||||
};
|
||||
}
|
||||
|
||||
describe("promptRemoteGatewayConfig", () => {
|
||||
const envSnapshot = captureEnv(["OPENCLAW_ALLOW_INSECURE_PRIVATE_WS"]);
|
||||
|
||||
@@ -78,15 +88,7 @@ describe("promptRemoteGatewayConfig", () => {
|
||||
|
||||
it("defaults discovered direct remote URLs to wss://", async () => {
|
||||
detectBinary.mockResolvedValue(true);
|
||||
discoverGatewayBeacons.mockResolvedValue([
|
||||
{
|
||||
instanceName: "gateway",
|
||||
displayName: "Gateway",
|
||||
host: "gateway.tailnet.ts.net",
|
||||
port: 18789,
|
||||
gatewayTlsFingerprintSha256: "sha256:abc123",
|
||||
},
|
||||
]);
|
||||
discoverGatewayBeacons.mockResolvedValue([createGatewayDiscoveryBeacon()]);
|
||||
|
||||
const text: WizardPrompter["text"] = vi.fn(async (params) => {
|
||||
if (params.message === "Gateway WebSocket URL") {
|
||||
@@ -201,15 +203,7 @@ describe("promptRemoteGatewayConfig", () => {
|
||||
|
||||
it("drops discovery tlsFingerprint when the URL is edited after trust confirmation", async () => {
|
||||
detectBinary.mockResolvedValue(true);
|
||||
discoverGatewayBeacons.mockResolvedValue([
|
||||
{
|
||||
instanceName: "gateway",
|
||||
displayName: "Gateway",
|
||||
host: "gateway.tailnet.ts.net",
|
||||
port: 18789,
|
||||
gatewayTlsFingerprintSha256: "sha256:abc123",
|
||||
},
|
||||
]);
|
||||
discoverGatewayBeacons.mockResolvedValue([createGatewayDiscoveryBeacon()]);
|
||||
|
||||
const text: WizardPrompter["text"] = vi.fn(async (params) => {
|
||||
if (params.message === "Gateway WebSocket URL") {
|
||||
|
||||
Reference in New Issue
Block a user