fix: stabilize windows acl tests and command auth registry (#9335) (thanks @M00N7682)

This commit is contained in:
Peter Steinberger
2026-02-05 00:34:43 -08:00
parent f26cc60872
commit d6cde28c8e
3 changed files with 28 additions and 10 deletions

View File

@@ -2,19 +2,28 @@ import { afterEach, beforeEach, describe, expect, it } from "vitest";
import type { OpenClawConfig } from "../config/config.js";
import type { MsgContext } from "./templating.js";
import { setActivePluginRegistry } from "../plugins/runtime.js";
import { createTestRegistry } from "../test-utils/channel-plugins.js";
import { createOutboundTestPlugin, createTestRegistry } from "../test-utils/channel-plugins.js";
import { resolveCommandAuthorization } from "./command-auth.js";
import { hasControlCommand, hasInlineCommandTokens } from "./command-detection.js";
import { listChatCommands } from "./commands-registry.js";
import { parseActivationCommand } from "./group-activation.js";
import { parseSendPolicyCommand } from "./send-policy.js";
const createRegistry = () =>
createTestRegistry([
{
pluginId: "discord",
plugin: createOutboundTestPlugin({ id: "discord", outbound: { deliveryMode: "direct" } }),
source: "test",
},
]);
beforeEach(() => {
setActivePluginRegistry(createTestRegistry([]));
setActivePluginRegistry(createRegistry());
});
afterEach(() => {
setActivePluginRegistry(createTestRegistry([]));
setActivePluginRegistry(createRegistry());
});
describe("resolveCommandAuthorization", () => {