mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 20:00:42 +00:00
fix(plugins): expose channel CLI metadata in discovery (#71309)
Merged via squash.
Prepared head SHA: ce6bb35812
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
This commit is contained in:
committed by
GitHub
parent
7ef4ecf499
commit
a5db42862d
@@ -69,6 +69,37 @@ describe("matrix plugin", () => {
|
||||
expect(entry.setChannelRuntime).toEqual(expect.any(Function));
|
||||
});
|
||||
|
||||
it("registers CLI metadata during discovery registration", () => {
|
||||
const registerChannel = vi.fn();
|
||||
const registerCli = vi.fn();
|
||||
const registerGatewayMethod = vi.fn();
|
||||
const api = createTestPluginApi({
|
||||
id: "matrix",
|
||||
name: "Matrix",
|
||||
source: "test",
|
||||
config: {},
|
||||
runtime: {} as never,
|
||||
registrationMode: "discovery",
|
||||
registerChannel,
|
||||
registerCli,
|
||||
registerGatewayMethod,
|
||||
});
|
||||
|
||||
entry.register(api);
|
||||
|
||||
expect(registerChannel).toHaveBeenCalledTimes(1);
|
||||
expect(registerCli).toHaveBeenCalledWith(expect.any(Function), {
|
||||
descriptors: [
|
||||
{
|
||||
name: "matrix",
|
||||
description: "Manage Matrix accounts, verification, devices, and profile state",
|
||||
hasSubcommands: true,
|
||||
},
|
||||
],
|
||||
});
|
||||
expect(registerGatewayMethod).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("registers subagent lifecycle hooks during full runtime registration", () => {
|
||||
const on = vi.fn();
|
||||
const registerGatewayMethod = vi.fn();
|
||||
|
||||
Reference in New Issue
Block a user