fix(plugins): allow Discord install repair

This commit is contained in:
Peter Steinberger
2026-05-02 23:48:43 +01:00
parent 57d6e63f30
commit e857c795a8
6 changed files with 90 additions and 39 deletions

View File

@@ -4,7 +4,7 @@ import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vite
import { loggingState } from "../../logging/state.js";
import { setCommandJsonMode } from "./json-mode.js";
const MATRIX_REPO_INSTALL_SPEC = repoInstallSpec("matrix");
const DISCORD_REPO_INSTALL_SPEC = repoInstallSpec("discord");
const setVerboseMock = vi.fn();
const emitCliBannerMock = vi.fn();
@@ -299,10 +299,10 @@ describe("registerPreActionHooks", () => {
expect(ensurePluginRegistryLoadedMock).not.toHaveBeenCalled();
});
it("only allows invalid config for explicit Matrix reinstall requests", async () => {
it("only allows invalid config for explicit Discord reinstall requests", async () => {
await runPreAction({
parseArgv: ["plugins", "install", "@openclaw/matrix"],
processArgv: ["node", "openclaw", "plugins", "install", "@openclaw/matrix"],
parseArgv: ["plugins", "install", "@openclaw/discord"],
processArgv: ["node", "openclaw", "plugins", "install", "@openclaw/discord"],
});
expect(ensureConfigReadyMock).toHaveBeenCalledWith({
@@ -324,8 +324,8 @@ describe("registerPreActionHooks", () => {
vi.clearAllMocks();
await runPreAction({
parseArgv: ["plugins", "install", MATRIX_REPO_INSTALL_SPEC],
processArgv: ["node", "openclaw", "plugins", "install", MATRIX_REPO_INSTALL_SPEC],
parseArgv: ["plugins", "install", DISCORD_REPO_INSTALL_SPEC],
processArgv: ["node", "openclaw", "plugins", "install", DISCORD_REPO_INSTALL_SPEC],
});
expect(ensureConfigReadyMock).toHaveBeenCalledWith({
@@ -336,13 +336,13 @@ describe("registerPreActionHooks", () => {
vi.clearAllMocks();
await runPreAction({
parseArgv: ["plugins", "install", "@openclaw/matrix", "--marketplace", "local/repo"],
parseArgv: ["plugins", "install", "@openclaw/discord", "--marketplace", "local/repo"],
processArgv: [
"node",
"openclaw",
"plugins",
"install",
"@openclaw/matrix",
"@openclaw/discord",
"--marketplace",
"local/repo",
],