Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/JAVA/Openclaw/extensions/bluebubbles/src/   (Openclaw AI Version 22©)  Datei vom 26.3.2026 mit Größe 2 kB image not shown  

Quelle  channel.status.test.ts

  Sprache: JAVA
 

import { beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import type { OpenClawConfig } from "./runtime-api.js";

const probeBlueBubblesMock = vi.hoisted(() => vi.fn());
const cfg: OpenClawConfig = {};

vi.mock("./channel.runtime.js", () => ({
  blueBubblesChannelRuntime: {
    probeBlueBubbles: probeBlueBubblesMock,
  },
}));

vi.mock("../../../src/channels/plugins/bundled.js", () => ({
  bundledChannelPlugins: [],
  bundledChannelSetupPlugins: [],
}));

let bluebubblesPlugin: typeof import("./channel.js").bluebubblesPlugin;

describe("bluebubblesPlugin.status.probeAccount", () => {
  beforeAll(async () => {
    ({ bluebubblesPlugin } = await import("./channel.js"));
  });

  beforeEach(() => {
    probeBlueBubblesMock.mockReset();
    probeBlueBubblesMock.mockResolvedValue({ ok: true, status: 200 });
  });

  it("auto-enables private-network probes for loopback server URLs", async () => {
    await bluebubblesPlugin.status?.probeAccount?.({
      cfg,
      account: {
        accountId: "default",
        enabled: true,
        configured: true,
        config: {
          serverUrl: "http://localhost:1234",
          password: "test-password",
        },
        baseUrl: "http://localhost:1234",
      },
      timeoutMs: 5000,
    });

    expect(probeBlueBubblesMock).toHaveBeenCalledWith({
      baseUrl: "http://localhost:1234",
      password: "test-password",
      timeoutMs: 5000,
      allowPrivateNetwork: true,
    });
  });

  it("respects an explicit private-network opt-out for loopback server URLs", async () => {
    await bluebubblesPlugin.status?.probeAccount?.({
      cfg,
      account: {
        accountId: "default",
        enabled: true,
        configured: true,
        config: {
          serverUrl: "http://localhost:1234",
          password: "test-password",
          network: {
            dangerouslyAllowPrivateNetwork: false,
          },
        },
        baseUrl: "http://localhost:1234",
      },
      timeoutMs: 5000,
    });

    expect(probeBlueBubblesMock).toHaveBeenCalledWith({
      baseUrl: "http://localhost:1234",
      password: "test-password",
      timeoutMs: 5000,
      allowPrivateNetwork: false,
    });
  });
});

Messung V0.5 in Prozent
C=98 H=98 G=97

¤ Dauer der Verarbeitung: 0.1 Sekunden  (vorverarbeitet am  2026-06-10) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.