Files
openclaw/src/cli/plugins-cli.list.test.ts
Pavan Kumar Gondhi 31160dc069 fix(agents): enforce subagent envelope inheritance on ACP child sessions [AI-assisted] (#69383)
* fix: address issue

* fix: address review feedback

* fix: finalize issue changes

* fix: address PR review feedback

* address build faiure

* fix: address PR review feedback

* fix: address PR review feedback

* fix: address PR review feedback

* fix: address PR review feedback

* fix: address PR review feedback

* fix: address PR review feedback

* fix: address PR review feedback

* fix: address PR review feedback

* fix: address PR review feedback

* fix: address PR review feedback

* fix: address PR review feedback
2026-04-21 17:25:25 +05:30

68 lines
1.7 KiB
TypeScript

import { beforeEach, describe, expect, it } from "vitest";
import { createPluginRecord } from "../plugins/status.test-helpers.js";
import {
buildPluginDiagnosticsReport,
buildPluginSnapshotReport,
resetPluginsCliTestState,
runPluginsCommand,
runtimeLogs,
} from "./plugins-cli-test-helpers.js";
describe("plugins cli list", () => {
beforeEach(() => {
resetPluginsCliTestState();
});
it("includes imported state in JSON output", async () => {
buildPluginSnapshotReport.mockReturnValue({
workspaceDir: "/workspace",
plugins: [
createPluginRecord({
id: "demo",
imported: true,
activated: true,
explicitlyEnabled: true,
}),
],
diagnostics: [],
});
await runPluginsCommand(["plugins", "list", "--json"]);
expect(buildPluginSnapshotReport).toHaveBeenCalledWith(
expect.objectContaining({
logger: expect.objectContaining({
info: expect.any(Function),
warn: expect.any(Function),
error: expect.any(Function),
}),
}),
);
expect(JSON.parse(runtimeLogs[0] ?? "null")).toEqual({
workspaceDir: "/workspace",
plugins: [
expect.objectContaining({
id: "demo",
imported: true,
activated: true,
explicitlyEnabled: true,
}),
],
diagnostics: [],
});
});
it("keeps doctor on a module-loading snapshot", async () => {
buildPluginDiagnosticsReport.mockReturnValue({
plugins: [],
diagnostics: [],
});
await runPluginsCommand(["plugins", "doctor"]);
expect(buildPluginDiagnosticsReport).toHaveBeenCalledWith();
expect(runtimeLogs).toContain("No plugin issues detected.");
});
});