import type { OpenClawConfig } from "openclaw/plugin-sdk/config-runtime"; import { describe, expect, it } from "vitest"; import { createDiscordSetupWizardBase } from "./setup-core.js";
it("reports account-scoped config keys for named accounts", () => {
expect(discordSetupWizard.dmPolicy?.resolveConfigKeys?.({}, "alerts")).toEqual({
policyKey: "channels.discord.accounts.alerts.dmPolicy",
allowFromKey: "channels.discord.accounts.alerts.allowFrom",
});
});
it('writes open policy state to the named account and preserves inherited allowFrom with "*"', () => { const next = discordSetupWizard.dmPolicy?.setPolicy(
{
channels: {
discord: {
allowFrom: ["123"],
accounts: {
alerts: {
token: "discord-token",
},
},
},
},
} as OpenClawConfig, "open", "alerts",
);
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.