mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-11 00:20:42 +00:00
test: tighten node invoke policy assertions
This commit is contained in:
@@ -71,10 +71,15 @@ describe("applyPluginNodeInvokePolicy", () => {
|
||||
params: { path: "/tmp/x" },
|
||||
});
|
||||
|
||||
expect(result).toMatchObject({
|
||||
ok: false,
|
||||
code: "PLUGIN_POLICY_MISSING",
|
||||
});
|
||||
expect(result).not.toBeNull();
|
||||
if (result === null) {
|
||||
throw new Error("expected plugin policy failure");
|
||||
}
|
||||
expect(result.ok).toBe(false);
|
||||
if (result.ok) {
|
||||
throw new Error("expected plugin policy failure");
|
||||
}
|
||||
expect(result.code).toBe("PLUGIN_POLICY_MISSING");
|
||||
expect(invoke).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
@@ -113,7 +118,7 @@ describe("applyPluginNodeInvokePolicy", () => {
|
||||
params: { path: "/tmp/x" },
|
||||
});
|
||||
|
||||
expect(result).toMatchObject({ ok: true, payload: { ok: true, value: 1 } });
|
||||
expect(result).toStrictEqual({ ok: true, payload: { ok: true, value: 1 }, payloadJSON: null });
|
||||
expect(invoke).toHaveBeenCalledWith({
|
||||
nodeId: "node-1",
|
||||
command: "demo.read",
|
||||
|
||||
Reference in New Issue
Block a user