mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-30 15:10:22 +00:00
plugin-sdk: keep command status compatibility path light
This commit is contained in:
committed by
Peter Steinberger
parent
aa15de8fdc
commit
ba636d1206
@@ -1,6 +1,11 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import type { OpenClawConfig } from "../config/config.js";
|
||||
import { resolveSenderCommandAuthorization } from "./command-auth.js";
|
||||
import {
|
||||
buildCommandsMessage,
|
||||
buildCommandsMessagePaginated,
|
||||
buildHelpMessage,
|
||||
resolveSenderCommandAuthorization,
|
||||
} from "./command-auth.js";
|
||||
|
||||
const baseCfg = {
|
||||
commands: { useAccessGroups: true },
|
||||
@@ -28,6 +33,17 @@ async function resolveAuthorization(params: {
|
||||
}
|
||||
|
||||
describe("plugin-sdk/command-auth", () => {
|
||||
it("keeps deprecated command status builders available for compatibility", () => {
|
||||
const cfg = { commands: { config: false, debug: false } } as unknown as OpenClawConfig;
|
||||
|
||||
expect(buildHelpMessage(cfg)).toContain("/commands for full list");
|
||||
expect(buildCommandsMessage(cfg)).toContain("More: /tools for available capabilities");
|
||||
expect(buildCommandsMessagePaginated(cfg)).toMatchObject({
|
||||
currentPage: 1,
|
||||
totalPages: expect.any(Number),
|
||||
});
|
||||
});
|
||||
|
||||
it("resolves command authorization across allowlist sources", async () => {
|
||||
const cases = [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user