Files
openclaw/packages/gateway-protocol/src/plugin-approvals-validators.test.ts
Peter Steinberger 3023d69fd8 feat(gateway): carry reviewer-only detail on plugin approvals (#113027)
* feat(gateway): carry reviewer-only detail on plugin approvals

* chore(protocol): regenerate projections for plugin approval detail

* chore(plugin-sdk): budget reviewer-detail surface additions
2026-07-23 06:28:23 -07:00

24 lines
895 B
TypeScript

import { describe, expect, it } from "vitest";
import { validatePluginApprovalRequestParams } from "./index.js";
describe("plugin approval protocol validators", () => {
it("validates bounded reviewer-only detail independently from the description", () => {
const request = {
title: "Apply workspace skill proposal",
description: "d".repeat(512),
};
expect(validatePluginApprovalRequestParams(request)).toBe(true);
expect(validatePluginApprovalRequestParams({ ...request, detail: "full tool input" })).toBe(
true,
);
expect(validatePluginApprovalRequestParams({ ...request, detail: "" })).toBe(false);
expect(validatePluginApprovalRequestParams({ ...request, detail: "x".repeat(16_385) })).toBe(
false,
);
expect(validatePluginApprovalRequestParams({ ...request, description: "d".repeat(513) })).toBe(
false,
);
});
});