mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 19:20:44 +00:00
fix(plugins): allow Discord install repair
This commit is contained in:
@@ -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",
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user