mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-27 09:21:35 +07:00
33 lines
919 B
TypeScript
33 lines
919 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import type { OpenClawConfig } from "../api.js";
|
|
import { tlonPlugin } from "./channel.js";
|
|
|
|
describe("tlonPlugin config", () => {
|
|
it("formats dm allowlist entries through the shared hybrid adapter", () => {
|
|
expect(
|
|
tlonPlugin.config.formatAllowFrom?.({
|
|
cfg: {} as OpenClawConfig,
|
|
allowFrom: ["zod", " ~nec "],
|
|
}),
|
|
).toEqual(["~zod", "~nec"]);
|
|
});
|
|
|
|
it("resolves dm allowlist from the default account", () => {
|
|
expect(
|
|
tlonPlugin.config.resolveAllowFrom?.({
|
|
cfg: {
|
|
channels: {
|
|
tlon: {
|
|
ship: "~sampel-palnet",
|
|
url: "https://urbit.example.com",
|
|
code: "lidlut-tabwed-pillex-ridrup",
|
|
dmAllowlist: ["~zod"],
|
|
},
|
|
},
|
|
} as OpenClawConfig,
|
|
accountId: "default",
|
|
}),
|
|
).toEqual(["~zod"]);
|
|
});
|
|
});
|