mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 08:20:43 +00:00
test(skill-workshop): pin disabled hook wiring
This commit is contained in:
@@ -51,6 +51,21 @@ function createProposal(
|
||||
}
|
||||
|
||||
describe("skill-workshop", () => {
|
||||
it("does not register hooks or tools when disabled", () => {
|
||||
const on = vi.fn();
|
||||
const registerTool = vi.fn();
|
||||
const api = createTestPluginApi({
|
||||
pluginConfig: { enabled: false },
|
||||
on,
|
||||
registerTool,
|
||||
});
|
||||
|
||||
plugin.register(api);
|
||||
|
||||
expect(registerTool).not.toHaveBeenCalled();
|
||||
expect(on).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("detects user corrections and creates an animated GIF proposal", async () => {
|
||||
const workspaceDir = await makeTempDir();
|
||||
const proposal = createProposalFromMessages({
|
||||
@@ -198,6 +213,19 @@ describe("skill-workshop", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("skips agent_end hook wiring when auto-capture is disabled", () => {
|
||||
const on = vi.fn();
|
||||
const api = createTestPluginApi({
|
||||
pluginConfig: { autoCapture: false },
|
||||
on,
|
||||
});
|
||||
|
||||
plugin.register(api);
|
||||
|
||||
expect(on).toHaveBeenCalledWith("before_prompt_build", expect.any(Function));
|
||||
expect(on).not.toHaveBeenCalledWith("agent_end", expect.any(Function));
|
||||
});
|
||||
|
||||
it("lets explicit tool suggestions stay pending in auto mode", async () => {
|
||||
const workspaceDir = await makeTempDir();
|
||||
const stateDir = await makeTempDir();
|
||||
|
||||
Reference in New Issue
Block a user