mirror of
https://github.com/morluto/rea
synced 2026-10-28 06:46:47 -04:00
4a6073810a
* fix(cli): validate native scenario and preserve JSON paths * fix(process): reject invalid UTF-8 JSON inputs * fix(cli): retain missing JSON path diagnostics * test(cli): cover relative brace and bracket JSON paths * test(cli): reject missing native scenario steps * fix(mcp): advertise reserved process environment key * fix(process): reject NUL in process scenario values * fix(process): advertise NUL input constraints to MCP * fix(cli): report scenario input schema issues * fix(contracts): align CLI and MCP input validation * fix(mcp): document semantic output constraints * fix(mcp): describe process journal compatibility * docs: regenerate catalog after schema grouping * docs: regenerate catalog after main merge * fix(cli): preserve JSON and native UI input diagnostics * test(mcp): reuse advertised tool schemas in managed flow
65 lines
1.7 KiB
TypeScript
65 lines
1.7 KiB
TypeScript
import { describe, expect } from "vitest";
|
|
|
|
import { cliTest } from "../../support/cli/cliFixture.js";
|
|
|
|
describe("scenario CLI schema diagnostics", () => {
|
|
cliTest("reports browser scenario schema paths", async ({ cli }) => {
|
|
const result = await cli.run({
|
|
arguments: ["capture-browser-scenario", "{}", "--json"],
|
|
environment: { REA_LOG_LEVEL: "silent" },
|
|
});
|
|
|
|
expect(result.exitCode).not.toBe(0);
|
|
expect(result.json).toMatchObject({
|
|
code: "invalid_request",
|
|
details: {
|
|
operation: "capture_browser_scenario",
|
|
issues: expect.arrayContaining([
|
|
{
|
|
path: ["browser"],
|
|
reason: "missing_argument",
|
|
expected: "object",
|
|
},
|
|
{
|
|
path: ["start_url"],
|
|
reason: "missing_argument",
|
|
expected: "object",
|
|
},
|
|
{
|
|
path: ["actions"],
|
|
reason: "missing_argument",
|
|
expected: "array",
|
|
},
|
|
]),
|
|
},
|
|
});
|
|
});
|
|
|
|
cliTest("reports Electron scenario schema paths", async ({ cli }) => {
|
|
const result = await cli.run({
|
|
arguments: ["capture-electron-scenario", "{}", "--json"],
|
|
environment: { REA_LOG_LEVEL: "silent" },
|
|
});
|
|
|
|
expect(result.exitCode).not.toBe(0);
|
|
expect(result.json).toMatchObject({
|
|
code: "invalid_request",
|
|
details: {
|
|
operation: "capture_electron_scenario",
|
|
issues: expect.arrayContaining([
|
|
{
|
|
path: ["executable_path"],
|
|
reason: "missing_argument",
|
|
expected: "string",
|
|
},
|
|
{
|
|
path: ["application_path"],
|
|
reason: "missing_argument",
|
|
expected: "string",
|
|
},
|
|
]),
|
|
},
|
|
});
|
|
});
|
|
});
|